From 520d6d4a83e265b2e21fb96c20140fccb831b3f1 Mon Sep 17 00:00:00 2001 From: Alfredo Moralejo Date: Sep 11 2021 12:16:34 +0000 Subject: Import python-h2-4.0.0-3.el9 in CloudSIG xena --- diff --git a/.python-h2.metadata b/.python-h2.metadata new file mode 100644 index 0000000..827a1f9 --- /dev/null +++ b/.python-h2.metadata @@ -0,0 +1 @@ +2d23cc9a7c8cbae068ffff7a933133b0318c9caf SOURCES/h2-4.0.0.tar.gz diff --git a/SOURCES/0001-Fix-repr-checks-for-Python-3.10.patch b/SOURCES/0001-Fix-repr-checks-for-Python-3.10.patch new file mode 100644 index 0000000..f7e3cda --- /dev/null +++ b/SOURCES/0001-Fix-repr-checks-for-Python-3.10.patch @@ -0,0 +1,86 @@ +From 7e9f7890dfa1f2283ac18fd561a28155f11e5759 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= +Date: Tue, 13 Apr 2021 21:45:57 +0200 +Subject: [PATCH 1/1] Fix repr() checks for Python 3.10 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Stating Python 3.10 alpha 7, repr() was modified as follow: + +bpo-40066: Enum: adjust repr() to show only enum and member name +(not value, nor angle brackets) and str() to show only member name. +Update and improve documentation to match. + +bpo-40066: Enum’s repr() and str() have changed: repr() is +now EnumClass.MemberName and str() is MemberName. Additionally, +stdlib Enum’s whose contents are available as module attributes, +such as RegexFlag.IGNORECASE, have their repr() as module.name, +e.g. re.IGNORECASE. + +See https://bugs.python.org/issue40066 + +This commit fixes the assertions to match the new repr() behavior. + +Fix #1253 +--- + test/test_basic_logic.py | 2 +- + test/test_events.py | 8 ++++---- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/test/test_basic_logic.py b/test/test_basic_logic.py +index fb54fe5..2e03e5d 100644 +--- a/test/test_basic_logic.py ++++ b/test/test_basic_logic.py +@@ -1845,7 +1845,7 @@ class TestBasicServer(object): + Ensure stream string representation is appropriate. + """ + s = h2.stream.H2Stream(4, None, 12, 14) +- assert repr(s) == ">" ++ assert repr(s) == "" + + + def sanity_check_data_frame(data_frame, +diff --git a/test/test_events.py b/test/test_events.py +index a6e8d83..c9250f8 100644 +--- a/test/test_events.py ++++ b/test/test_events.py +@@ -209,7 +209,7 @@ class TestEventReprs(object): + + assert repr(e) == ( + "" + ) + +@@ -251,7 +251,7 @@ class TestEventReprs(object): + + assert repr(e) == ( + "" ++ "error_code:ENHANCE_YOUR_CALM, remote_reset:False>" + ) + + def test_pushedstreamreceived_repr(self): +@@ -286,7 +286,7 @@ class TestEventReprs(object): + + assert repr(e) == ( + "" + ) + +@@ -319,7 +319,7 @@ class TestEventReprs(object): + e.additional_data = additional_data + + assert repr(e) == ( +- "" % data_repr + ) + +-- +2.31.1 + diff --git a/SOURCES/0001-Workaround-the-issues-with-hypothesis-6.6.patch b/SOURCES/0001-Workaround-the-issues-with-hypothesis-6.6.patch new file mode 100644 index 0000000..69a0456 --- /dev/null +++ b/SOURCES/0001-Workaround-the-issues-with-hypothesis-6.6.patch @@ -0,0 +1,109 @@ +From 0646279dab694a89562846c810202ce2c0b49be3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Mon, 8 Mar 2021 19:16:26 +0100 +Subject: [PATCH] Workaround the issues with hypothesis 6.6 + +Hypothesis 6.6 will produce: + + E hypothesis.errors.FailedHealthCheck: test/test_flow_control_window.py::TestAutomaticFlowControl::test_mixing_update_forms uses the 'frame_factory' fixture, which is reset between function calls but not between test cases generated by `@given(...)`. You can change it to a module- or session-scoped fixture if it is safe to reuse; if not we recommend using a context manager inside your test function. See https://docs.pytest.org/en/latest/fixture.html#sharing-test-data for details on fixture scope. + E See https://hypothesis.readthedocs.io/en/latest/healthchecks.html for more information about this. If you want to disable just this health check, add HealthCheck.function_scoped_fixture to the suppress_health_check settings for this test. + +Since the tests already workaround the problem, +acknowledging https://github.com/HypothesisWorks/hypothesis-python/issues/377, +we can safely disable the check. + +Hypothesis 5.49 introduced the function_scoped_fixture health check value, +hence it is now the lowest required version of hypothesis. +--- + test/test_basic_logic.py | 3 ++- + test/test_flow_control_window.py | 7 ++++++- + tox.ini | 2 +- + 3 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/test/test_basic_logic.py b/test/test_basic_logic.py +index fb54fe50..8c8f3b7d 100644 +--- a/test/test_basic_logic.py ++++ b/test/test_basic_logic.py +@@ -21,7 +21,7 @@ + + from . import helpers + +-from hypothesis import given ++from hypothesis import given, settings, HealthCheck + from hypothesis.strategies import integers + + +@@ -790,6 +790,7 @@ def test_headers_are_lowercase(self, frame_factory): + assert c.data_to_send() == expected_frame.serialize() + + @given(frame_size=integers(min_value=2**14, max_value=(2**24 - 1))) ++ @settings(suppress_health_check=[HealthCheck.function_scoped_fixture]) + def test_changing_max_frame_size(self, frame_factory, frame_size): + """ + When the user changes the max frame size and the change is ACKed, the +diff --git a/test/test_flow_control_window.py b/test/test_flow_control_window.py +index 24b345aa..7a445af1 100644 +--- a/test/test_flow_control_window.py ++++ b/test/test_flow_control_window.py +@@ -7,7 +7,7 @@ + """ + import pytest + +-from hypothesis import given ++from hypothesis import given, settings, HealthCheck + from hypothesis.strategies import integers + + import h2.config +@@ -715,6 +715,7 @@ def _setup_connection_and_send_headers(self, frame_factory): + return c + + @given(stream_id=integers(max_value=0)) ++ @settings(suppress_health_check=[HealthCheck.function_scoped_fixture]) + def test_must_acknowledge_for_stream(self, frame_factory, stream_id): + """ + Flow control acknowledgements must be done on a stream ID that is +@@ -740,6 +741,7 @@ def test_must_acknowledge_for_stream(self, frame_factory, stream_id): + ) + + @given(size=integers(max_value=-1)) ++ @settings(suppress_health_check=[HealthCheck.function_scoped_fixture]) + def test_cannot_acknowledge_less_than_zero(self, frame_factory, size): + """ + The user must acknowledge at least 0 bytes. +@@ -837,6 +839,7 @@ def test_acknowledging_streams_we_never_saw(self, frame_factory): + c.acknowledge_received_data(2048, stream_id=101) + + @given(integers(min_value=1025, max_value=DEFAULT_FLOW_WINDOW)) ++ @settings(suppress_health_check=[HealthCheck.function_scoped_fixture]) + def test_acknowledging_1024_bytes_when_empty_increments(self, + frame_factory, + increment): +@@ -873,6 +876,7 @@ def test_acknowledging_1024_bytes_when_empty_increments(self, + # This test needs to use a lower cap, because otherwise the algo will + # increment the stream window anyway. + @given(integers(min_value=1025, max_value=(DEFAULT_FLOW_WINDOW // 4) - 1)) ++ @settings(suppress_health_check=[HealthCheck.function_scoped_fixture]) + def test_connection_only_empty(self, frame_factory, increment): + """ + If the connection flow control window is empty, but the stream flow +@@ -916,6 +920,7 @@ def test_connection_only_empty(self, frame_factory, increment): + assert c.data_to_send() == expected_data + + @given(integers(min_value=1025, max_value=DEFAULT_FLOW_WINDOW)) ++ @settings(suppress_health_check=[HealthCheck.function_scoped_fixture]) + def test_mixing_update_forms(self, frame_factory, increment): + """ + If the user mixes ackowledging data with manually incrementing windows, +diff --git a/tox.ini b/tox.ini +index 69291df6..1f5e538b 100644 +--- a/tox.ini ++++ b/tox.ini +@@ -15,7 +15,7 @@ deps = + pytest==6.0.2 + pytest-cov==2.10.1 + pytest-xdist==2.1.0 +- hypothesis>=5.5,<6 ++ hypothesis>=5.49,<7 + commands = + pytest --cov-report=xml --cov-report=term --cov=h2 {posargs} + diff --git a/SPECS/python-h2.spec b/SPECS/python-h2.spec new file mode 100644 index 0000000..739ef50 --- /dev/null +++ b/SPECS/python-h2.spec @@ -0,0 +1,162 @@ +# Created by pyp2rpm-3.3.2 +%global pypi_name h2 + +%global common_description %{expand: +HTTP/2 Protocol Stack This repository contains a pure-Python +implementation of a HTTP/2 protocol stack. It's written from the ground up to +be embeddable in whatever program you choose to use, ensuring that you can +speak HTTP/2 regardless of your programming paradigm.} + +%bcond_with docs + +Name: python-%{pypi_name} +Version: 4.0.0 +Release: 3%{?dist} +Summary: HTTP/2 State-Machine based protocol implementation + +License: MIT +URL: https://hyper-h2.readthedocs.io +Source0: %pypi_source +# Workaround the issues with hypothesis 6.6 +Patch0: https://patch-diff.githubusercontent.com/raw/python-hyper/h2/pull/1248.patch#/0001-Workaround-the-issues-with-hypothesis-6.6.patch + +BuildArch: noarch + +BuildRequires: python3-devel +BuildRequires: (python3dist(hpack) >= 4 with python3dist(hpack) < 5) +BuildRequires: (python3dist(hyperframe) >= 6 with python3dist(hyperframe) < 7) +BuildRequires: python3dist(setuptools) +BuildRequires: python3dist(sphinx) +BuildRequires: python3dist(pytest) +BuildRequires: python3dist(hypothesis) + +%if %{with docs} +# Unbundle +BuildRequires: js-jquery +BuildRequires: js-underscore +%endif + +%description +%{common_description} + +%package -n python3-%{pypi_name} +Summary: %{summary} + +%description -n python3-%{pypi_name} +%{common_description} + +%if %{with docs} +%package doc +Summary: Documentation for %{name} + +Requires: js-jquery +Requires: js-underscore + +%description doc +%{common_description} + +This is the documentation package for h2. +%endif + +%prep +%autosetup -p1 -n %{pypi_name}-%{version} +# Remove bundled egg-info +rm -rf %{pypi_name}.egg-info + +%build +%py3_build + +%if %{with docs} +# generate html docs +PYTHONPATH=${PWD} sphinx-build-3 docs/source html +# remove the sphinx-build leftovers +rm -rf html/.{doctrees,buildinfo} + +# Unbundle JS +rm -f html/_static/underscore.js +ln -s /usr/share/javascript/underscore/underscore-min.js html/_static/underscore.js +rm -f html/_static/underscore-1.3.1.js +ln -s /usr/share/javascript/underscore/underscore.js html/_static/underscore-1.3.1.js +rm -f html/_static/jquery.js +ln -s /usr/share/javascript/jquery/3.2.1/jquery.min.js html/_static/jquery.js +rm -f html/_static/jquery-3.2.1.js +ln -s /usr/share/javascript/jquery/3.2.1/jquery.js html/_static/jquery-3.2.1.js +%endif + +%install +%py3_install + +%check +PYTHONPATH=$PYTHONPATH:%{buildroot}%{python3_sitelib} %{__python3} -m pytest + +%files -n python3-%{pypi_name} +%license LICENSE +%doc README.rst +%{python3_sitelib}/%{pypi_name} +%{python3_sitelib}/%{pypi_name}-%{version}-py*.egg-info + +%if %{with docs} +%files doc +%doc html +%license LICENSE +%endif + + +%changelog +* Tue Mar 9 08:32:35 CET 2021 Robert-André Mauchin - 4.0.0-3 +- Add patch to workaround the issues with hypothesis 6.6 +- Close: rhbz#1936524 + +* Wed Jan 27 2021 Fedora Release Engineering - 4.0.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Sat Nov 14 15:28:57 CET 2020 Robert-André Mauchin - 4.0.0-1 +- Update to 4.0.0 +- Close: rhbz#1880732 + +* Wed Jul 29 2020 Fedora Release Engineering - 3.2.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Sun May 24 2020 Miro Hrončok - 3.2.0-3 +- Rebuilt for Python 3.9 + +* Mon Feb 17 03:14:38 CET 2020 Robert-André Mauchin - 3.2.0-1 +- Update to 3.2.0 + +* Thu Jan 30 2020 Fedora Release Engineering - 3.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Sep 18 2019 Robert-André Mauchin - 3.1.1-1 +- Release 3.1.1 (#1742451) + +* Mon Sep 09 2019 Miro Hrončok - 3.1.0-6 +- Subpackage python2-h2 has been removed + See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal + +* Sat Aug 17 2019 Miro Hrončok - 3.1.0-5 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 3.1.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Wed Jul 03 2019 Miro Hrončok - 3.1.0-3 +- Rebuilt to update automatic Python dependencies + +* Fri Mar 08 2019 Jeroen van Meeuwen - 3.1.0-2 +- Add bcond_without docs + +* Thu Mar 07 2019 Robert-André Mauchin - 3.1.0-1 +- Release 3.1.0 +- Run tests + +* Sat Feb 02 2019 Fedora Release Engineering - 3.0.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 3.0.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 19 2018 Miro Hrončok - 3.0.1-2 +- Rebuilt for Python 3.7 + +* Mon May 14 2018 Robert-André Mauchin - 3.0.1-1 +- Initial package.