Repository: scrapy/scrapy

Issue:
Make the build reproducible
Whilst working on the [Reproducible Builds](https://reproducible-builds.org/) effort I noticed that scrapy could not be built reproducibly

This is due to the documentation embedding the current build year in the generated files, therefore making the build vary depending on when you build it. The fix is to use [`SOURCE_DATE_EPOCH`](https://reproducible-builds.org/specs/source-date-epoch/) if it is exported to the surrounding environment.

I originally filed this in Debian as bug [#983852](https://bugs.debian.org/983852).


Discussion:
Auto-updating copyright at build time is a bad practice anyway, because building today's software next year, would produce `copyright 2008–2022, Scrapy developers` without any developer doing anything in 2022.

so the better fix could be to state `copyright 2008` or `copyright 2008-2021`
I agree that it’s a bad practice, only better than not updating it at all.

The best I can think of at the moment is to go for a pre-commit hook that updates the year if it is out of date. But then you need to get contributors to install pre-commit.

Alternatively, we could use https://github.com/c4urself/bump2version/issues/133 once implemented to make sure we update the year before every release.
Closing and reopening to re-run the tests with the latest changes from `master`…
# [Codecov](https://codecov.io/gh/scrapy/scrapy/pull/5019?src=pr&el=h1) Report
> Merging [#5019](https://codecov.io/gh/scrapy/scrapy/pull/5019?src=pr&el=desc) (c74703c) into [master](https://codecov.io/gh/scrapy/scrapy/commit/f95ebd8f7cca64ca868fa064ca74b74add2763ed?el=desc) (f95ebd8) will **decrease** coverage by `0.35%`.
> The diff coverage is `90.31%`.

> :exclamation: Current head c74703c differs from pull request most recent head 34ea7b8. Consider uploading reports for the commit 34ea7b8 to get more accurate results

```diff
@@            Coverage Diff             @@
##           master    #5019      +/-   ##
==========================================
- Coverage   88.01%   87.65%   -0.36%     
==========================================
  Files         158      162       +4     
  Lines        9726    10301     +575     
  Branches     1433     1501      +68     
==========================================
+ Hits         8560     9029     +469     
- Misses        911     1000      +89     
- Partials      255      272      +17     
```

| [Impacted Files](https://codecov.io/gh/scrapy/scrapy/pull/5019?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [scrapy/utils/log.py](https://codecov.io/gh/scrapy/scrapy/pull/5019/diff?src=pr&el=tree#diff-c2NyYXB5L3V0aWxzL2xvZy5weQ==) | `89.24% <ø> (ø)` | |
| [scrapy/pipelines/images.py](https://codecov.io/gh/scrapy/scrapy/pull/5019/diff?src=pr&el=tree#diff-c2NyYXB5L3BpcGVsaW5lcy9pbWFnZXMucHk=) | `90.35% <80.00%> (-1.47%)` | :arrow_down: |
| [scrapy/core/http2/protocol.py](https://codecov.io/gh/scrapy/scrapy/pull/5019/diff?src=pr&el=tree#diff-c2NyYXB5L2NvcmUvaHR0cDIvcHJvdG9jb2wucHk=) | `83.41% <83.41%> (ø)` | |
| [scrapy/core/downloader/contextfactory.py](https://codecov.io/gh/scrapy/scrapy/pull/5019/diff?src=pr&el=tree#diff-c2NyYXB5L2NvcmUvZG93bmxvYWRlci9jb250ZXh0ZmFjdG9yeS5weQ==) | `87.03% <84.61%> (-2.97%)` | :arrow_down: |
| [scrapy/core/http2/stream.py](https://codecov.io/gh/scrapy/scrapy/pull/5019/diff?src=pr&el=tree#diff-c2NyYXB5L2NvcmUvaHR0cDIvc3RyZWFtLnB5) | `91.37% <91.37%> (ø)` | |
| [scrapy/core/downloader/handlers/http11.py](https://codecov.io/gh/scrapy/scrapy/pull/5019/diff?src=pr&el=tree#diff-c2NyYXB5L2NvcmUvZG93bmxvYWRlci9oYW5kbGVycy9odHRwMTEucHk=) | `93.68% <95.00%> (+1.22%)` | :arrow_up: |
| [scrapy/core/http2/agent.py](https://codecov.io/gh/scrapy/scrapy/pull/5019/diff?src=pr&el=tree#diff-c2NyYXB5L2NvcmUvaHR0cDIvYWdlbnQucHk=) | `96.38% <96.38%> (ø)` | |
| [scrapy/core/downloader/handlers/http2.py](https://codecov.io/gh/scrapy/scrapy/pull/5019/diff?src=pr&el=tree#diff-c2NyYXB5L2NvcmUvZG93bmxvYWRlci9oYW5kbGVycy9odHRwMi5weQ==) | `100.00% <100.00%> (ø)` | |
| [scrapy/selector/unified.py](https://codecov.io/gh/scrapy/scrapy/pull/5019/diff?src=pr&el=tree#diff-c2NyYXB5L3NlbGVjdG9yL3VuaWZpZWQucHk=) | `100.00% <100.00%> (ø)` | |
| [scrapy/signals.py](https://codecov.io/gh/scrapy/scrapy/pull/5019/diff?src=pr&el=tree#diff-c2NyYXB5L3NpZ25hbHMucHk=) | `100.00% <100.00%> (ø)` | |
| ... and [16 more](https://codecov.io/gh/scrapy/scrapy/pull/5019/diff?src=pr&el=tree-more) | |


Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -10,7 +10,6 @@
 # serve to show the default.
 
 import sys
-from datetime import datetime
 from pathlib import Path
 
 # If your extensions are in another directory, add it here. If the directory
@@ -48,7 +47,7 @@
 
 # General information about the project.
 project = "Scrapy"
-copyright = f"2008–{datetime.now().year}, Scrapy developers"
+copyright = "Scrapy developers"
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the


Test patch: