From 16ca8be3f0dbb3a897aaa6cae2a5b8bf6463e2ff Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Sat, 26 Jun 2021 03:12:37 +0000 Subject: [PATCH 1/2] doc/conf.py: if set, use SOURCE_DATE_EPOCH to set copyright year. The build date of the software shouldn't really have any bearing on the copyright dates, but by respecting SOURCE_DATE_EPOCH, it at least limits this to the last time something in the source was changed. https://reproducible-builds.org/specs/source-date-epoch/ --- doc/conf.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index bd7921b14b3b..d401029d9770 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -20,6 +20,11 @@ import sphinx from datetime import datetime +import time + +# Parse year using SOURCE_DATE_EPOCH, falling back to current time. +# https://reproducible-builds.org/specs/source-date-epoch/ +sourceyear=datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))).year # If your extensions are in another directory, add it here. If the directory # is relative to the documentation root, use os.path.abspath to make it @@ -212,7 +217,7 @@ def _check_dependencies(): project = 'Matplotlib' copyright = ('2002 - 2012 John Hunter, Darren Dale, Eric Firing, ' 'Michael Droettboom and the Matplotlib development ' - f'team; 2012 - {datetime.now().year} The Matplotlib development team') + f'team; 2012 - {sourceyear} The Matplotlib development team') # The default replacements for |version| and |release|, also used in various From c3e8602bd399b31ba3174a2b9dc10f6d218195f3 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Sat, 10 Jul 2021 02:19:21 +0000 Subject: [PATCH 2/2] Add whitespace around setting the "sourceyear" variable to pass flake8. --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index d401029d9770..b77413ab4735 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -24,7 +24,7 @@ # Parse year using SOURCE_DATE_EPOCH, falling back to current time. # https://reproducible-builds.org/specs/source-date-epoch/ -sourceyear=datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))).year +sourceyear = datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))).year # If your extensions are in another directory, add it here. If the directory # is relative to the documentation root, use os.path.abspath to make it