Bug#1032057: pyproject-api: please make the build reproducible
Chris Lamb
lamby at debian.org
Mon Feb 27 07:53:12 GMT 2023
Source: pyproject-api
Version: 1.5.0-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org
Hi,
Whilst working on the Reproducible Builds effort [0] we noticed
that pyproject-api could not be built reproducibly.
This is because the documentation embeds the current date in the
build system's current timezone. A patch is attached that uses
SOURCE_DATE_EPOCH [1] if available.
[0] https://reproducible-builds.org/
[1] https://reproducible-builds.org/specs/source-date-epoch/
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby at debian.org / chris-lamb.co.uk
`-
-------------- next part --------------
--- a/debian/patches/reproducible-build.patch 1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/reproducible-build.patch 2023-02-27 07:50:58.360366831 +0000
@@ -0,0 +1,26 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2023-02-27
+
+--- pyproject-api-1.5.0.orig/docs/conf.py
++++ pyproject-api-1.5.0/docs/conf.py
+@@ -1,5 +1,7 @@
+ from __future__ import annotations
+
++import os
++import time
+ from datetime import datetime
+
+ from pyproject_api import __version__
+@@ -20,7 +22,10 @@ extensions = [
+ master_doc, source_suffix = "index", ".rst"
+
+ html_theme = "furo"
+-html_title, html_last_updated_fmt = "pyproject-api docs", datetime.now().isoformat()
++build_date = datetime.utcfromtimestamp(
++ int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
++)
++html_title, html_last_updated_fmt = "pyproject-api docs", build_date.isoformat()
+ pygments_style, pygments_dark_style = "sphinx", "monokai"
+
+ autoclass_content, autodoc_typehints = "both", "none"
--- a/debian/patches/series 1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/series 2023-02-27 07:50:56.832357814 +0000
@@ -0,0 +1 @@
+reproducible-build.patch
More information about the Reproducible-bugs
mailing list