Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 30cbdf7

Browse files
authored
Merge pull request #20608 from vagrantc/respect-source-date-epoch-in-documentation
2 parents ef89fb7 + c3e8602 commit 30cbdf7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

doc/conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
import sphinx
2121

2222
from datetime import datetime
23+
import time
24+
25+
# Parse year using SOURCE_DATE_EPOCH, falling back to current time.
26+
# https://reproducible-builds.org/specs/source-date-epoch/
27+
sourceyear = datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))).year
2328

2429
# If your extensions are in another directory, add it here. If the directory
2530
# is relative to the documentation root, use os.path.abspath to make it
@@ -212,7 +217,7 @@ def _check_dependencies():
212217
project = 'Matplotlib'
213218
copyright = ('2002 - 2012 John Hunter, Darren Dale, Eric Firing, '
214219
'Michael Droettboom and the Matplotlib development '
215-
f'team; 2012 - {datetime.now().year} The Matplotlib development team')
220+
f'team; 2012 - {sourceyear} The Matplotlib development team')
216221

217222

218223
# The default replacements for |version| and |release|, also used in various

0 commit comments

Comments
 (0)