Skip to content

Commit 0f33e6c

Browse files
author
Alexis Bienvenüe
committed
Add pointers to the SOURCE_DATE_EPOCH specification.
1 parent d978f93 commit 0f33e6c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

sphinx/builders/gettext.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ def write_doc(self, docname, doctree):
130130
timestamp = time()
131131
tzdelta = datetime.fromtimestamp(timestamp) - \
132132
datetime.utcfromtimestamp(timestamp)
133+
# set timestamp from SOURCE_DATE_EPOCH if set
134+
# see https://reproducible-builds.org/specs/source-date-epoch/
133135
source_date_epoch = getenv('SOURCE_DATE_EPOCH')
134136
if source_date_epoch is not None:
135137
timestamp = float(source_date_epoch)

sphinx/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ def __init__(self, dirname, filename, overrides, tags):
301301
self.extensions = config.get('extensions', [])
302302

303303
# correct values of copyright year that are not coherent with
304-
# the SOURCE_DATE_EPOCH environment variable:
304+
# the SOURCE_DATE_EPOCH environment variable (if set)
305+
# See https://reproducible-builds.org/specs/source-date-epoch/
305306
if getenv('SOURCE_DATE_EPOCH') is not None:
306307
for k in ('copyright', 'epub_copyright'):
307308
if k in config:

0 commit comments

Comments
 (0)