Source: snakemake
Version: 5.5.3-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: buildpath
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that snakemake could not be built reproducibly.

This is because it encoded the absolute buildpath in a Python keyword
argument which, when rendered in the documention, made the package
contents change when built from different locations.

Patch attached.

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/debian/patches/0012-reproducible-build.patch      1969-12-31 
21:00:00.000000000 -0300
--- b/debian/patches/0012-reproducible-build.patch      2019-07-15 
09:24:36.994818005 -0300
@@ -0,0 +1,40 @@
+Description: Make the build reproducible
+Author: Chris Lamb <la...@debian.org>
+Last-Update: 2019-07-15
+
+--- snakemake-5.5.3.orig/snakemake/report/__init__.py
++++ snakemake-5.5.3/snakemake/report/__init__.py
+@@ -98,10 +98,12 @@ def data_uri_from_file(file, defaultenc=
+ 
+ 
+ def report(text, path,
+-           stylesheet=os.path.join(os.path.dirname(__file__), "report.css"),
++           stylesheet=None,
+            defaultenc="utf8",
+            template=None,
+            metadata=None, **files):
++    if stylesheet is None:
++        stylesheet = os.path.join(os.path.dirname(__file__), "report.css")
+     outmime, _ = mimetypes.guess_type(path)
+     if outmime != "text/html":
+         raise ValueError("Path to report output has to be an HTML file.")
+--- snakemake-5.5.3.orig/snakemake/utils.py
++++ snakemake-5.5.3/snakemake/utils.py
+@@ -189,7 +189,7 @@ def makedirs(dirnames):
+ 
+ 
+ def report(text, path,
+-           stylesheet=os.path.join(os.path.dirname(__file__), "report.css"),
++           stylesheet=None,
+            defaultenc="utf8",
+            template=None,
+            metadata=None, **files):
+@@ -233,6 +233,8 @@ def report(text, path,
+         metadata (str):     E.g. an optional author name or email address.
+ 
+     """
++    if stylesheet is None:
++        stylesheet = os.path.join(os.path.dirname(__file__), "report.css")
+     try:
+         import snakemake.report
+     except ImportError:
--- a/debian/patches/series     2019-07-15 09:11:32.053668609 -0300
--- b/debian/patches/series     2019-07-15 09:24:34.722883985 -0300
@@ -9,3 +9,4 @@
 0009-skip-test-without-google-cloud-sdk.patch
 # 0010-skip-test-without-rmarkdown.patch
 0011-fix-privacy-breach.patch
+0012-reproducible-build.patch

Reply via email to