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:
Chris Lamb 2020-06-19 12:54:21 +01:00
parent 0c08adc411
commit e6c8046320
1 changed files with 5 additions and 1 deletions

View File

@ -11,6 +11,7 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import time
import sys
import os
from datetime import datetime
@ -46,7 +47,10 @@ master_doc = 'index'
# General information about the project.
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
# |version| and |release|, also used in various other places throughout the