aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-hypothesis/attrs.patch
blob: a10708fb3c6d0819dfd0cf09fab8fe142cf3d42b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
diff --git a/setup.py b/setup.py
index 62eeabb..b7edb53 100644
--- a/setup.py
+++ b/setup.py
@@ -68,7 +68,7 @@ extras = {
 extras["all"] = sorted(sum(extras.values(), []))
 
 
-install_requires = ["attrs>=19.2.0"]
+install_requires = ["attrs>=16.0.0"]
 # Using an environment marker on enum34 makes the dependency condition
 # independent of the build environemnt, which is important for wheels.
 # https://www.python.org/dev/peps/pep-0345/#environment-markers
diff --git a/src/hypothesis/internal/conjecture/shrinker.py b/src/hypothesis/internal/conjecture/shrinker.py
index 95c6de1..c0d485c 100644
--- a/src/hypothesis/internal/conjecture/shrinker.py
+++ b/src/hypothesis/internal/conjecture/shrinker.py
@@ -1442,7 +1442,7 @@ def block_program(description):
     return name
 
 
-@attr.s(slots=True, eq=False)
+@attr.s(slots=True, cmp=False)
 class ShrinkPass(object):
     run_with_chooser = attr.ib()
     index = attr.ib()
diff --git a/src/hypothesis/searchstrategy/attrs.py b/src/hypothesis/searchstrategy/attrs.py
index a3c287a..1e08bc3 100644
--- a/src/hypothesis/searchstrategy/attrs.py
+++ b/src/hypothesis/searchstrategy/attrs.py
@@ -45,12 +45,12 @@ def from_attrs(target, args, kwargs, to_infer):
 
 def from_attrs_attribute(attrib, target):
     """Infer a strategy from the metadata on an attr.Attribute object."""
-    # Try inferring from the default argument.  Note that this will only help if
+    # Try inferring from the default argument.  Note that this will only help
     # the user passed `infer` to builds() for this attribute, but in that case
     # we use it as the minimal example.
     default = st.nothing()
     if isinstance(attrib.default, attr.Factory):
-        if not attrib.default.takes_self:
+        if not getattr(attrib.default, "takes_self", False):  # new in 17.1
             default = st.builds(attrib.default.factory)
     elif attrib.default is not attr.NOTHING:
         default = st.just(attrib.default)