Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/hypothesis/, dev-python/hypothesis/files/
Date: Wed, 05 May 2021 17:06:06
Message-Id: 1620234349.31b8a4c83acc4122f3823f77464a9b077c53b65f.mgorny@gentoo
1 commit: 31b8a4c83acc4122f3823f77464a9b077c53b65f
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 5 15:41:10 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed May 5 17:05:49 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31b8a4c8
7
8 dev-python/hypothesis: Enable python3.10
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 .../hypothesis/files/hypothesis-6.10.1-py310.patch | 75 ++++++++++++++++++++++
13 dev-python/hypothesis/hypothesis-6.10.1.ebuild | 11 ++--
14 2 files changed, 82 insertions(+), 4 deletions(-)
15
16 diff --git a/dev-python/hypothesis/files/hypothesis-6.10.1-py310.patch b/dev-python/hypothesis/files/hypothesis-6.10.1-py310.patch
17 new file mode 100644
18 index 00000000000..f81186a46e6
19 --- /dev/null
20 +++ b/dev-python/hypothesis/files/hypothesis-6.10.1-py310.patch
21 @@ -0,0 +1,75 @@
22 +From 27ee073728e70e930118a36ffa4f8123ce363099 Mon Sep 17 00:00:00 2001
23 +From: Zac-HD <zac.hatfield.dodds@×××××.com>
24 +Date: Wed, 5 May 2021 13:01:21 +1000
25 +Subject: [PATCH] Test on 3.10-dev again
26 +
27 +now that pytest has been fixed
28 +---
29 + tests/cover/test_annotations.py | 4 +---
30 + tests/cover/test_lookup.py | 7 +------
31 + tests/cover/test_lookup_py38.py | 2 --
32 + 4 files changed, 3 insertions(+), 12 deletions(-)
33 +
34 +diff --git a/tests/cover/test_annotations.py b/tests/cover/test_annotations.py
35 +index 564339d39..95ebea3c5 100644
36 +--- a/tests/cover/test_annotations.py
37 ++++ b/tests/cover/test_annotations.py
38 +@@ -13,7 +13,6 @@
39 + #
40 + # END HEADER
41 +
42 +-import sys
43 + from inspect import getfullargspec
44 +
45 + import attr
46 +@@ -116,8 +115,7 @@ def test_composite_edits_annotations():
47 + @pytest.mark.parametrize("nargs", [1, 2, 3])
48 + def test_given_edits_annotations(nargs):
49 + spec_given = getfullargspec(given(*(nargs * [st.none()]))(pointless_composite))
50 +- expected = None if sys.version_info[:2] < (3, 10) else type(None)
51 +- assert spec_given.annotations.pop("return") == expected
52 ++ assert spec_given.annotations.pop("return") is None
53 + assert len(spec_given.annotations) == 3 - nargs
54 +
55 +
56 +diff --git a/tests/cover/test_lookup.py b/tests/cover/test_lookup.py
57 +index b74eccc62..33cb78050 100644
58 +--- a/tests/cover/test_lookup.py
59 ++++ b/tests/cover/test_lookup.py
60 +@@ -756,12 +756,7 @@ def test_compat_get_type_hints_aware_of_None_default():
61 + find_any(strategy, lambda x: x.a is not None)
62 +
63 + assert typing.get_type_hints(constructor)["a"] == typing.Optional[str]
64 +- annotation = inspect.signature(constructor).parameters["a"].annotation
65 +- assert annotation == str or (
66 +- # See https://bugs.python.org/issue43006
67 +- annotation == typing.Optional[str]
68 +- and sys.version_info[:2] >= (3, 10)
69 +- )
70 ++ assert inspect.signature(constructor).parameters["a"].annotation == str
71 +
72 +
73 + _ValueType = typing.TypeVar("_ValueType")
74 +diff --git a/tests/cover/test_lookup_py38.py b/tests/cover/test_lookup_py38.py
75 +index 6a68254a7..db11777fe 100644
76 +--- a/tests/cover/test_lookup_py38.py
77 ++++ b/tests/cover/test_lookup_py38.py
78 +@@ -14,7 +14,6 @@
79 + # END HEADER
80 +
81 + import dataclasses
82 +-import sys
83 + import typing
84 +
85 + import pytest
86 +@@ -103,7 +102,6 @@ class NestedDict(typing.TypedDict):
87 + inner: A
88 +
89 +
90 +-@×××××××××××.skipif(sys.version_info[:2] >= (3, 10), reason="see issue #2897")
91 + @given(from_type(NestedDict))
92 + def test_typeddict_with_nested_value(value):
93 + assert type(value) == dict
94 +--
95 +2.31.1
96 +
97
98 diff --git a/dev-python/hypothesis/hypothesis-6.10.1.ebuild b/dev-python/hypothesis/hypothesis-6.10.1.ebuild
99 index d2766062540..7afc12a8028 100644
100 --- a/dev-python/hypothesis/hypothesis-6.10.1.ebuild
101 +++ b/dev-python/hypothesis/hypothesis-6.10.1.ebuild
102 @@ -3,8 +3,7 @@
103
104 EAPI=7
105
106 -DISTUTILS_USE_SETUPTOOLS=rdepend
107 -PYTHON_COMPAT=( python3_{7..9} pypy3 )
108 +PYTHON_COMPAT=( python3_{7..10} pypy3 )
109 PYTHON_REQ_USE="threads(+),sqlite"
110
111 inherit distutils-r1 multiprocessing optfeature
112 @@ -26,7 +25,7 @@ RDEPEND="
113 $(python_gen_cond_dep '
114 dev-python/black[${PYTHON_USEDEP}]
115 dev-python/click[${PYTHON_USEDEP}]
116 - ' 'python*')
117 + ' python3_{7..9})
118 )
119 "
120 BDEPEND="
121 @@ -40,8 +39,12 @@ BDEPEND="
122
123 distutils_enable_tests --install pytest
124
125 +PATCHES=(
126 + "${FILESDIR}"/${P}-py310.patch
127 +)
128 +
129 python_prepare() {
130 - if ! use cli || [[ ${EPYTHON} != python* ]]; then
131 + if ! use cli || ! has "${EPYTHON}" python3_{7..9}; then
132 sed -i -e '/console_scripts/d' setup.py || die
133 fi
134 }