Source: python-pytest-shell-utilities Version: 1.9.7-1 Severity: wishlist Tags: patch User: reproducible-bui...@lists.alioth.debian.org Usertags: timestamps X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org
Hi, Whilst working on the Reproducible Builds effort [0], we noticed that python-pytest-shell-utilities could not be built reproducibly. This was because of two reasons. First, the documentation used the current build date instead of seeding it from SOURCE_DATE_EPOCH, and then the 'towncrier' Sphinx extension was adding its own date when adding stuff like "[UNRELEASED DRAFT]". Patch attached. [0] https://reproducible-builds.org/ Regards, -- ,''`. : :' : Chris Lamb `. `'` la...@debian.org / chris-lamb.co.uk `-
--- a/debian/patches/0002-Reproducible-build.patch 1970-01-01 01:00:00.000000000 +0100 --- b/debian/patches/0002-Reproducible-build.patch 2025-03-31 11:06:38.676581722 +0100 @@ -0,0 +1,34 @@ +Description: Make the build reproducible +Author: Chris Lamb <la...@debian.org> +Last-Update: 2025-03-31 + +--- python-pytest-shell-utilities-1.9.7.orig/docs/conf.py ++++ python-pytest-shell-utilities-1.9.7/docs/conf.py +@@ -14,6 +14,7 @@ + import datetime + import os + import pathlib ++import time + import sys + + import pytest +@@ -45,7 +46,10 @@ dist = distribution("pytest-shell-utilit + + + # -- Project information ----------------------------------------------------- +-this_year = datetime.datetime.today().year ++this_year = datetime.datetime.fromtimestamp( ++ int(os.environ.get('SOURCE_DATE_EPOCH', time.time())), ++ tz=datetime.timezone.utc, ++).year + if this_year == 2021: + copyright_year = 2021 + else: +@@ -83,7 +87,6 @@ extensions = [ + "sphinx.ext.coverage", + "sphinx_copybutton", + "sphinxcontrib.spelling", +- "sphinxcontrib.towncrier", + ] + + # Add any paths that contain templates here, relative to this directory. --- a/debian/patches/series 2025-03-31 10:46:25.529222853 +0100 --- b/debian/patches/series 2025-03-31 10:57:49.640652686 +0100 @@ -1 +1,2 @@ 0001-Use-local-objects.inv-in-intersphinx-mapping.patch +0002-Reproducible-build.patch