Source: numcodecs
Version: 0.8.1+ds-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Hi,

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

This is because the automatically-generated documentation includes the
repr(...) of a Python "mock" object, which happens to include a
nondeterministic id number.

(Patch attached that uses the common Python idiom for having a default
kwarg without specifying it directly in the method's definition.)

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/debian/patches/0006-Reproducible-build.patch      1970-01-01 
01:00:00.000000000 +0100
--- b/debian/patches/0006-Reproducible-build.patch      2021-08-23 
17:25:16.439560711 +0100
@@ -0,0 +1,22 @@
+Description: Make the build reproducible
+Author: Chris Lamb <la...@debian.org>
+Last-Update: 2021-08-23
+
+--- numcodecs-0.8.1+ds.orig/numcodecs/zfpy.py
++++ numcodecs-0.8.1+ds/numcodecs/zfpy.py
+@@ -32,12 +32,14 @@ if _zfpy:
+ 
+         def __init__(
+             self,
+-            mode=_zfpy.mode_fixed_accuracy,
++            mode=None,
+             tolerance=-1,
+             rate=-1,
+             precision=-1,
+             compression_kwargs=None,
+         ):
++            if mode is None:
++                mode = _zfpy.mode_fixed_accuracy
+             self.mode = mode
+             if mode == _zfpy.mode_fixed_accuracy:
+                 self.compression_kwargs = {"tolerance": tolerance}
--- a/debian/patches/series     2021-08-23 17:17:43.045547377 +0100
--- b/debian/patches/series     2021-08-23 17:25:13.915567506 +0100
@@ -3,3 +3,4 @@
 0003-Clean-fixtures.patch
 0004-Cpuinfo.patch
 0005-Skip-broken-tests-on-BE-archs.patch
+0006-Reproducible-build.patch

Reply via email to