990339">

Debian Bug report logs - #990339
matplotlib: reproducible builds: embeds current year in documentation

version graph

Package: src:matplotlib; Maintainer for src:matplotlib is Debian Python Team <team+python@tracker.debian.org>;

Reported by: Vagrant Cascadian <vagrant@reproducible-builds.org>

Date: Sat, 26 Jun 2021 04:09:01 UTC

Severity: normal

Tags: fixed-upstream, patch

Fixed in version matplotlib/3.5.0~rc1-1

Done: Mattia Rizzolo <mattia@debian.org>

Bug is archived. No further changes may be made.

Forwarded to https://github.com/matplotlib/matplotlib/pull/20608

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, reproducible-bugs@lists.alioth.debian.org, Sandro Tosi <morph@debian.org>:
Bug#990339; Package src:matplotlib. (Sat, 26 Jun 2021 04:09:03 GMT) (full text, mbox, link).


Acknowledgement sent to Vagrant Cascadian <vagrant@reproducible-builds.org>:
New Bug report received and forwarded. Copy sent to reproducible-bugs@lists.alioth.debian.org, Sandro Tosi <morph@debian.org>. (Sat, 26 Jun 2021 04:09:03 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@reproducible-builds.org>
To: submit@bugs.debian.org
Subject: matplotlib: reproducible builds: embeds current year in documentation
Date: Fri, 25 Jun 2021 21:05:06 -0700
[Message part 1 (text/plain, inline)]
Source: matplotlib
Severity: normal
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org

The build date is embedded in copyright statements in various .html
documentation:

  https://tests.reproducible-builds.org/debian/rb-pkg/bullseye/amd64/diffoscope-results/matplotlib.html

  ./usr/share/doc/python-matplotlib-doc/html/users/whats_new_old.html

  &copy;·Copyright·2021·-·2012·John·Hunter...·2012·-·2021·The·Matplotlib·development·team.
  vs.
  &copy;·Copyright·2021·-·2012·John·Hunter...·2012·-·2022·The·Matplotlib·development·team.

The attached patch fixes this by patching doc/conf.py to respect
SOURCE_DATE_EPOCH, which is set by dpkg during package builds.


Arguably, dynamically generating the copyright dates during the build is
not correct behavior; no new copyrighted material was generated as a
result of the building at a later date.


This patch does not fix all reproducibility issues in matplotlib, but it
should reduce the overall diff.


Thanks for maintaining matplotlib!


live well,
  vagrant
[0001-doc-conf.py-if-set-use-SOURCE_DATE_EPOCH-to-set-copy.patch (text/x-diff, inline)]
From 94c1a1387f88279e31808ad3a9f08270f3e3d37b Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Sat, 26 Jun 2021 03:12:37 +0000
Subject: [PATCH] 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 174c8935..06d5534c 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -18,6 +18,11 @@ import matplotlib
 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
@@ -189,7 +194,7 @@ html_context = {'sha': SHA}
 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
-- 
2.32.0

[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#990339; Package src:matplotlib. (Sat, 26 Jun 2021 15:45:05 GMT) (full text, mbox, link).


Acknowledgement sent to Sandro Tosi <morph@debian.org>:
Extra info received and forwarded to list. (Sat, 26 Jun 2021 15:45:05 GMT) (full text, mbox, link).


Message #10 received at 990339@bugs.debian.org (full text, mbox, My website: http://sandrotosi.me/ > Me at Debian: http://wiki.debian.org/SandroTosi > Twitter: https://twitter.com/sandrotosi > > &subject=Re: Bug#990339: matplotlib: reproducible builds: embeds current year in documentation">reply):

From: Sandro Tosi <morph@debian.org>
To: Vagrant Cascadian <vagrant@reproducible-builds.org>, 990339@bugs.debian.org
Subject: Re: Bug#990339: matplotlib: reproducible builds: embeds current year in documentation
Date: Sat, 26 Jun 2021 11:43:10 -0400
> The build date is embedded in copyright statements in various .html
> documentation:
>
>   https://tests.reproducible-builds.org/debian/rb-pkg/bullseye/amd64/diffoscope-results/matplotlib.html
>
>   ./usr/share/doc/python-matplotlib-doc/html/users/whats_new_old.html
>
>   &copy;·Copyright·2021·-·2012·John·Hunter...·2012·-·2021·The·Matplotlib·development·team.
>   vs.
>   &copy;·Copyright·2021·-·2012·John·Hunter...·2012·-·2022·The·Matplotlib·development·team.
>
> The attached patch fixes this by patching doc/conf.py to respect
> SOURCE_DATE_EPOCH, which is set by dpkg during package builds.

did you forward this patch upstream? can you link the PR/commit here?

this change should go upstream first and Debian will get it once
merged. Please follow up with them if you havent done so, this will
avoid an unproductive back-and-forth in case there are changes
upstream wants.

Regards
-- 
Sandro "morph" Tosi
My website: http://sandrotosi.me/
Me at Debian: http://wiki.debian.org/SandroTosi
Twitter: https://twitter.com/sandrotosi



Information forwarded to debian-bugs-dist@lists.debian.org, Sandro Tosi <morph@debian.org>:
Bug#990339; Package src:matplotlib. (Sat, 26 Jun 2021 17:03:03 GMT) (full text, mbox, link).


Acknowledgement sent to Vagrant Cascadian <vagrant@reproducible-builds.org>:
Extra info received and forwarded to list. Copy sent to Sandro Tosi <morph@debian.org>. (Sat, 26 Jun 2021 17:03:03 GMT) (full text, mbox, link).


Message #15 received at 990339@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@reproducible-builds.org>
To: Sandro Tosi <morph@debian.org>, 990339@bugs.debian.org
Subject: Re: Bug#990339: matplotlib: reproducible builds: embeds current year in documentation
Date: Sat, 26 Jun 2021 10:01:06 -0700
[Message part 1 (text/plain, inline)]
On 2021-06-26, Sandro Tosi wrote:
>> The build date is embedded in copyright statements in various .html
>> documentation:
>>
>>   https://tests.reproducible-builds.org/debian/rb-pkg/bullseye/amd64/diffoscope-results/matplotlib.html
>>
>>   ./usr/share/doc/python-matplotlib-doc/html/users/whats_new_old.html
>>
>>   &copy;·Copyright·2021·-·2012·John·Hunter...·2012·-·2021·The·Matplotlib·development·team.
>>   vs.
>>   &copy;·Copyright·2021·-·2012·John·Hunter...·2012·-·2022·The·Matplotlib·development·team.
>>
>> The attached patch fixes this by patching doc/conf.py to respect
>> SOURCE_DATE_EPOCH, which is set by dpkg during package builds.
>
> did you forward this patch upstream? can you link the PR/commit here?

Will follow up at:

  https://github.com/matplotlib/matplotlib/issues

They appear to support SOURCE_DATE_EPOCH in other parts of the code, so
hopefully won't have any objection here. :)


> this change should go upstream first and Debian will get it once
> merged. Please follow up with them if you havent done so, this will
> avoid an unproductive back-and-forth in case there are changes
> upstream wants.

Sure thing.


live well,
  vagrant
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Sandro Tosi <morph@debian.org>:
Bug#990339; Package src:matplotlib. (Thu, 08 Jul 2021 21:00:02 GMT) (full text, mbox, link).


Acknowledgement sent to Vagrant Cascadian <vagrant@reproducible-builds.org>:
Extra info received and forwarded to list. Copy sent to Sandro Tosi <morph@debian.org>. (Thu, 08 Jul 2021 21:00:02 GMT) (full text, mbox, link).


Message #20 received at 990339@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@reproducible-builds.org>
To: Sandro Tosi <morph@debian.org>, 990339@bugs.debian.org
Subject: Re: Bug#990339: matplotlib: reproducible builds: embeds current year in documentation
Date: Thu, 08 Jul 2021 13:56:32 -0700
[Message part 1 (text/plain, inline)]
Control: forwarded 990339 https://github.com/matplotlib/matplotlib/pull/20608

On 2021-06-26, Vagrant Cascadian wrote:
> On 2021-06-26, Sandro Tosi wrote:
>>> The build date is embedded in copyright statements in various .html
>>> documentation:
>>>
>>>   https://tests.reproducible-builds.org/debian/rb-pkg/bullseye/amd64/diffoscope-results/matplotlib.html
>>>
>>>   ./usr/share/doc/python-matplotlib-doc/html/users/whats_new_old.html
>>>
>>>   &copy;·Copyright·2021·-·2012·John·Hunter...·2012·-·2021·The·Matplotlib·development·team.
>>>   vs.
>>>   &copy;·Copyright·2021·-·2012·John·Hunter...·2012·-·2022·The·Matplotlib·development·team.
>>>
>>> The attached patch fixes this by patching doc/conf.py to respect
>>> SOURCE_DATE_EPOCH, which is set by dpkg during package builds.
>>
>> did you forward this patch upstream? can you link the PR/commit here?
>
> Will follow up at:
>
>   https://github.com/matplotlib/matplotlib/issues

Done:

  https://github.com/matplotlib/matplotlib/pull/20608


live well,
  vagrant
[signature.asc (application/pgp-signature, inline)]

Set Bug forwarded-to-address to 'https://github.com/matplotlib/matplotlib/pull/20608'. Request was from Vagrant Cascadian <vagrant@reproducible-builds.org> to 990339-submit@bugs.debian.org. (Thu, 08 Jul 2021 21:00:03 GMT) (full text, mbox, link).


Added tag(s) fixed-upstream. Request was from Paul Wise <pabs@debian.org> to control@bugs.debian.org. (Sun, 11 Jul 2021 00:51:01 GMT) (full text, mbox, link).


Marked as fixed in versions matplotlib/3.5.0~rc1-1. Request was from Mattia Rizzolo <mattia@debian.org> to control@bugs.debian.org. (Fri, 10 Dec 2021 12:30:02 GMT) (full text, mbox, link).


Marked Bug as done Request was from Mattia Rizzolo <mattia@debian.org> to control@bugs.debian.org. (Fri, 10 Dec 2021 12:30:02 GMT) (full text, mbox, link).


Notification sent to Vagrant Cascadian <vagrant@reproducible-builds.org>:
Bug acknowledged by developer. (Fri, 10 Dec 2021 12:30:03 GMT) (full text, mbox, link).


Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sat, 29 Jan 2022 07:26:36 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Jan 31 00:05:01 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.