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/hyper-h2/, dev-python/hyper-h2/files/
Date: Tue, 18 May 2021 11:40:16
Message-Id: 1621337999.407c950bbfad43abb4553c0211dce8dda309723a.mgorny@gentoo
1 commit: 407c950bbfad43abb4553c0211dce8dda309723a
2 Author: Ekaterina Vaartis <vaartis <AT> kotobank <DOT> ch>
3 AuthorDate: Sun May 16 09:27:13 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue May 18 11:39:59 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=407c950b
7
8 dev-python/hyper-h2: Bump to python 3.10
9
10 Signed-off-by: Ekaterina Vaartis <vaartis <AT> kotobank.ch>
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12
13 .../files/hyper-h2-3.2.0-failed-healthcheck.patch | 74 ++++++++++++++++++++++
14 dev-python/hyper-h2/hyper-h2-3.2.0.ebuild | 29 +++++++--
15 dev-python/hyper-h2/hyper-h2-4.0.0.ebuild | 23 ++++++-
16 3 files changed, 118 insertions(+), 8 deletions(-)
17
18 diff --git a/dev-python/hyper-h2/files/hyper-h2-3.2.0-failed-healthcheck.patch b/dev-python/hyper-h2/files/hyper-h2-3.2.0-failed-healthcheck.patch
19 new file mode 100644
20 index 00000000000..04adc2748c2
21 --- /dev/null
22 +++ b/dev-python/hyper-h2/files/hyper-h2-3.2.0-failed-healthcheck.patch
23 @@ -0,0 +1,74 @@
24 +diff --git a/test/test_basic_logic.py b/test/test_basic_logic.py
25 +index fb54fe50..8c8f3b7d 100644
26 +--- a/test/test_basic_logic.py
27 ++++ b/test/test_basic_logic.py
28 +@@ -21,7 +21,7 @@
29 +
30 + from . import helpers
31 +
32 +-from hypothesis import given
33 ++from hypothesis import given, settings, HealthCheck
34 + from hypothesis.strategies import integers
35 +
36 +
37 +@@ -790,6 +790,7 @@ def test_headers_are_lowercase(self, frame_factory):
38 + assert c.data_to_send() == expected_frame.serialize()
39 +
40 + @given(frame_size=integers(min_value=2**14, max_value=(2**24 - 1)))
41 ++ @settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
42 + def test_changing_max_frame_size(self, frame_factory, frame_size):
43 + """
44 + When the user changes the max frame size and the change is ACKed, the
45 +diff --git a/test/test_flow_control_window.py b/test/test_flow_control_window.py
46 +index 24b345aa..7a445af1 100644
47 +--- a/test/test_flow_control_window.py
48 ++++ b/test/test_flow_control_window.py
49 +@@ -7,7 +7,7 @@
50 + """
51 + import pytest
52 +
53 +-from hypothesis import given
54 ++from hypothesis import given, settings, HealthCheck
55 + from hypothesis.strategies import integers
56 +
57 + import h2.config
58 +@@ -715,6 +715,7 @@ def _setup_connection_and_send_headers(self, frame_factory):
59 + return c
60 +
61 + @given(stream_id=integers(max_value=0))
62 ++ @settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
63 + def test_must_acknowledge_for_stream(self, frame_factory, stream_id):
64 + """
65 + Flow control acknowledgements must be done on a stream ID that is
66 +@@ -740,6 +741,7 @@ def test_must_acknowledge_for_stream(self, frame_factory, stream_id):
67 + )
68 +
69 + @given(size=integers(max_value=-1))
70 ++ @settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
71 + def test_cannot_acknowledge_less_than_zero(self, frame_factory, size):
72 + """
73 + The user must acknowledge at least 0 bytes.
74 +@@ -837,6 +839,7 @@ def test_acknowledging_streams_we_never_saw(self, frame_factory):
75 + c.acknowledge_received_data(2048, stream_id=101)
76 +
77 + @given(integers(min_value=1025, max_value=DEFAULT_FLOW_WINDOW))
78 ++ @settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
79 + def test_acknowledging_1024_bytes_when_empty_increments(self,
80 + frame_factory,
81 + increment):
82 +@@ -873,6 +876,7 @@ def test_acknowledging_1024_bytes_when_empty_increments(self,
83 + # This test needs to use a lower cap, because otherwise the algo will
84 + # increment the stream window anyway.
85 + @given(integers(min_value=1025, max_value=(DEFAULT_FLOW_WINDOW // 4) - 1))
86 ++ @settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
87 + def test_connection_only_empty(self, frame_factory, increment):
88 + """
89 + If the connection flow control window is empty, but the stream flow
90 +@@ -916,5 +920,6 @@ def test_connection_only_empty(self, frame_factory, increment):
91 + assert c.data_to_send() == expected_data
92 +
93 + @given(integers(min_value=1025, max_value=DEFAULT_FLOW_WINDOW))
94 ++ @settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
95 + def test_mixing_update_forms(self, frame_factory, increment):
96 + """
97 + If the user mixes ackowledging data with manually incrementing windows,
98
99 diff --git a/dev-python/hyper-h2/hyper-h2-3.2.0.ebuild b/dev-python/hyper-h2/hyper-h2-3.2.0.ebuild
100 index 50176089cdd..819953993d9 100644
101 --- a/dev-python/hyper-h2/hyper-h2-3.2.0.ebuild
102 +++ b/dev-python/hyper-h2/hyper-h2-3.2.0.ebuild
103 @@ -2,7 +2,7 @@
104 # Distributed under the terms of the GNU General Public License v2
105
106 EAPI=7
107 -PYTHON_COMPAT=( python3_{7,8,9} )
108 +PYTHON_COMPAT=( python3_{7..10} )
109
110 inherit distutils-r1
111
112 @@ -13,8 +13,6 @@ SRC_URI="https://github.com/python-hyper/${PN}/archive/v${PV}.tar.gz -> ${P}.tar
113 LICENSE="MIT"
114 SLOT="0"
115 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86"
116 -IUSE="test"
117 -RESTRICT="!test? ( test )"
118
119 RDEPEND="
120 >=dev-python/hyperframe-5.2.0[${PYTHON_USEDEP}]
121 @@ -22,14 +20,31 @@ RDEPEND="
122 >=dev-python/hpack-3.0.0[${PYTHON_USEDEP}]
123 <dev-python/hpack-4.0.0[${PYTHON_USEDEP}]
124 "
125 -DEPEND="${RDEPEND}
126 +BDEPEND="
127 test? (
128 dev-python/hypothesis[${PYTHON_USEDEP}]
129 - dev-python/pytest[${PYTHON_USEDEP}]
130 )
131 "
132
133 +distutils_enable_tests pytest
134 +
135 +PATCHES=(
136 + # From https://github.com/python-hyper/h2/pull/1248
137 + # Disables some failing healthchecks
138 + "${FILESDIR}/${P}-failed-healthcheck.patch"
139 +)
140 +
141 python_test() {
142 - pytest -vv --hypothesis-profile=travis test ||
143 - die "Tests fail with ${EPYTHON}"
144 + local deselect=()
145 + [[ ${EPYTHON} == python3.10 ]] && deselect+=(
146 + # these rely on fixed string repr() and fail because enum repr
147 + # changed in py3.10
148 + test/test_basic_logic.py::TestBasicServer::test_stream_repr
149 + test/test_events.py::TestEventReprs::test_remotesettingschanged_repr
150 + test/test_events.py::TestEventReprs::test_streamreset_repr
151 + test/test_events.py::TestEventReprs::test_settingsacknowledged_repr
152 + test/test_events.py::TestEventReprs::test_connectionterminated_repr
153 + )
154 +
155 + epytest --hypothesis-profile=travis ${deselect[@]/#/--deselect }
156 }
157
158 diff --git a/dev-python/hyper-h2/hyper-h2-4.0.0.ebuild b/dev-python/hyper-h2/hyper-h2-4.0.0.ebuild
159 index 9698bdee39b..a133fd58b9c 100644
160 --- a/dev-python/hyper-h2/hyper-h2-4.0.0.ebuild
161 +++ b/dev-python/hyper-h2/hyper-h2-4.0.0.ebuild
162 @@ -2,7 +2,7 @@
163 # Distributed under the terms of the GNU General Public License v2
164
165 EAPI=7
166 -PYTHON_COMPAT=( python3_{7,8,9} )
167 +PYTHON_COMPAT=( python3_{7..10} )
168
169 inherit distutils-r1
170
171 @@ -27,3 +27,24 @@ BDEPEND="
172 "
173
174 distutils_enable_tests pytest
175 +
176 +PATCHES=(
177 + # From https://github.com/python-hyper/h2/pull/1248
178 + # Disables some failing healthchecks
179 + "${FILESDIR}/${PN}-3.2.0-failed-healthcheck.patch"
180 +)
181 +
182 +python_test() {
183 + local deselect=()
184 + [[ ${EPYTHON} == python3.10 ]] && deselect+=(
185 + # these rely on fixed string repr() and fail because enum repr
186 + # changed in py3.10
187 + test/test_basic_logic.py::TestBasicServer::test_stream_repr
188 + test/test_events.py::TestEventReprs::test_remotesettingschanged_repr
189 + test/test_events.py::TestEventReprs::test_streamreset_repr
190 + test/test_events.py::TestEventReprs::test_settingsacknowledged_repr
191 + test/test_events.py::TestEventReprs::test_connectionterminated_repr
192 + )
193 +
194 + epytest ${deselect[@]/#/--deselect }
195 +}