[Python-modules-team] Bug#854549: python-hypothesis: please make the build reproducible

Chris Lamb lamby at debian.org
Wed Feb 8 09:42:11 UTC 2017


Source: python-hypothesis
Version: 3.6.1-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: buildpath
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

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

Patch attached.

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/patches/reproducible-build.patch	1970-01-01 12:00:00.000000000 +1200
--- b/debian/patches/reproducible-build.patch	2017-02-08 22:37:52.813855440 +1300
@@ -0,0 +1,56 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2017-02-08
+
+--- python-hypothesis-3.6.1.orig/src/hypothesis/_settings.py
++++ python-hypothesis-3.6.1/src/hypothesis/_settings.py
+@@ -49,8 +49,9 @@ _db_cache = {}
+ 
+ class settingsProperty(object):
+ 
+-    def __init__(self, name):
++    def __init__(self, name, show_default):
+         self.name = name
++        self.show_default = show_default
+ 
+     def __get__(self, obj, type=None):
+         if obj is None:
+@@ -69,9 +70,11 @@ class settingsProperty(object):
+ 
+     @property
+     def __doc__(self):
++        default = repr(getattr(settings.default, self.name)) if \
++            self.show_default else '(dynamically calculated)'
+         return '\n'.join((
+             all_settings[self.name].description,
+-            'default value: %r' % (getattr(settings.default, self.name),)
++            'default value: %s' % (default,)
+         ))
+ 
+ 
+@@ -167,7 +170,7 @@ class settings(settingsMeta('settings',
+     @classmethod
+     def define_setting(
+         cls, name, description, default, options=None, deprecation=None,
+-        validator=None,
++        validator=None, show_default=True,
+     ):
+         """Add a new setting.
+ 
+@@ -191,7 +194,7 @@ class settings(settingsMeta('settings',
+         all_settings[name] = Setting(
+             name, description.strip(), default, options, validator
+         )
+-        setattr(settings, name, settingsProperty(name))
++        setattr(settings, name, settingsProperty(name, show_default))
+ 
+     @classmethod
+     def lock_further_definitions(cls):
+@@ -423,6 +426,7 @@ settings.define_setting(
+         os.getenv('HYPOTHESIS_DATABASE_FILE') or
+         os.path.join(hypothesis_home_dir(), 'examples')
+     ),
++    show_default=False,
+     description="""
+     database: An instance of hypothesis.database.ExampleDatabase that will be
+ used to save examples to and load previous examples from. May be None
--- a/debian/patches/series	1970-01-01 12:00:00.000000000 +1200
--- b/debian/patches/series	2017-02-08 22:37:40.849765541 +1300
@@ -0,0 +1 @@
+reproducible-build.patch


More information about the Python-modules-team mailing list