Make the documentation reproducible
Whilst working on the Reproducible Builds effort [0] we noticed that pyqtgraph could not be built reproducibly. This is because it generates copyright years from the current build date and therefore will vary on when you build it. This commit uses SOURCE_DATE_EPOCH [1] for the "current" build date. This was originally filed in Debian as #963124 [2]. [0] https://reproducible-builds.org/ [1] https://reproducible-builds.org/specs/source-date-epoch/ [2] https://bugs.debian.org/963124
This commit is contained in:
parent
0c08adc411
commit
e6c8046320
@ -11,6 +11,7 @@
|
|||||||
# All configuration values have a default; values that are commented out
|
# All configuration values have a default; values that are commented out
|
||||||
# serve to show the default.
|
# serve to show the default.
|
||||||
|
|
||||||
|
import time
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@ -46,7 +47,10 @@ master_doc = 'index'
|
|||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = 'pyqtgraph'
|
project = 'pyqtgraph'
|
||||||
copyright = '2011 - {}, Luke Campagnola'.format(datetime.now().year)
|
now = datetime.utcfromtimestamp(
|
||||||
|
int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
|
||||||
|
)
|
||||||
|
copyright = '2011 - {}, Luke Campagnola'.format(now.year)
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
|
Loading…
Reference in New Issue
Block a user