[Debian-med-packaging] Bug#1148979: python-mne: please make the build reproducible

Chris Lamb lamby at debian.org
Fri Sep 25 21:45:26 BST 2026


Source: python-mne
Version: 1.13.2-2
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
python-mne could not be built reproducibly.

This is because the documentation embeds the current date. A patch is
attached that will use the date encoded in SOURCE_DATE_EPOCH if it is
present.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/patches/0016-Reproducible-documentation.patch	1969-12-31 16:00:00.000000000 -0800
--- b/debian/patches/0016-Reproducible-documentation.patch	2026-09-25 13:11:16.959108307 -0700
@@ -0,0 +1,26 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2026-09-25
+
+--- python-mne-1.13.2.orig/doc/conf.py
++++ python-mne-1.13.2/doc/conf.py
+@@ -14,6 +14,7 @@ import os
+ import subprocess
+ import sys
+ import tomllib
++import time
+ from datetime import UTC, datetime
+ from importlib.metadata import metadata
+ from pathlib import Path
+@@ -63,7 +64,10 @@ from mne_doc_utils import (  # noqa: E40
+ # -- Project information -----------------------------------------------------
+ 
+ project = "MNE"
+-td = datetime.now(tz=UTC)
++td = datetime.fromtimestamp(
++    int(os.environ.get('SOURCE_DATE_EPOCH', time.time())),
++    tz=UTC,
++)
+ 
+ # We need to triage which date type we use so that incremental builds work
+ # (Sphinx looks at variable changes and rewrites all files if some change)
--- a/debian/patches/series	2026-09-25 11:45:40.118305716 -0700
--- b/debian/patches/series	2026-09-25 13:11:15.020401277 -0700
@@ -13,3 +13,4 @@
 0013-Use-local-MathJax-installation-for-doc.patch
 0014-Disable-nitpicky-Sphinx-mode-for-the-Debian-document.patch
 0015-Resolve-the-NumPy-glossary-term.patch
+0016-Reproducible-documentation.patch


More information about the Debian-med-packaging mailing list