commit 2f797339dc05ab266ac00c2f2fd964c9c06388111543af2b571ab4d20f1854c2 Author: Nico Krapp Date: Tue Feb 11 12:41:29 2025 +0000 - Update to 4.2.0 * Support for Python 3.6 has been removed. * Support for Python 3.7 has been removed. * Support for Python 3.8 has been removed. * Remove mistakenly set `max_inbound_frame_size` attribute on `H2Stream`. * Support for Python 3.11 has been added. * Support for Python 3.12 has been added. * Support for Python 3.13 has been added. * Add an ability to send outbound cookies separately to improve headers compression. * Updated packaging and testing infrastructure. * Fix repr() checks for Python 3.11 * Fix asyncio / wsgi examples. * Clarify docs on using curl with http2. - Adjust path for patching tests/conftest.py - Drop fix-repr-checks-for-py311.patch, merged upstream - Switch build system from setuptools to pyproject.toml * Add python-pip and python-wheel to BuildRequires * Replace %python_build with %pyproject_wheel * Replace %python_install with %pyproject_install OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-h2?expand=0&rev=37 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/fix-repr-checks-for-py311.patch b/fix-repr-checks-for-py311.patch new file mode 100644 index 0000000..c6016b2 --- /dev/null +++ b/fix-repr-checks-for-py311.patch @@ -0,0 +1,107 @@ +From 8952c91606cd014720ccf202a25b5ee1fbed1591 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= +Date: Sun, 3 Jul 2022 12:05:05 +0200 +Subject: [PATCH] Fix repr() checks for Python 3.11 + +In Python 3.11, repr() was modified, this commit fixes the +assertions to match the new repr() behavior. + +Fix #1268 +--- + test/test_events.py | 62 ++++++++++++++++++++++++++++++++------------- + 1 file changed, 44 insertions(+), 18 deletions(-) + +diff --git a/test/test_events.py b/test/test_events.py +index a6e8d8379..c790fbaa0 100644 +--- a/test/test_events.py ++++ b/test/test_events.py +@@ -207,11 +207,18 @@ def test_remotesettingschanged_repr(self): + ), + } + +- assert repr(e) == ( +- "" +- ) ++ if sys.version_info >= (3, 11): ++ assert repr(e) == ( ++ "" ++ ) ++ else: ++ assert repr(e) == ( ++ "" ++ ) + + def test_pingreceived_repr(self): + """ +@@ -249,10 +256,16 @@ def test_streamreset_repr(self): + e.error_code = h2.errors.ErrorCodes.ENHANCE_YOUR_CALM + e.remote_reset = False + +- assert repr(e) == ( +- "" +- ) ++ if sys.version_info >= (3, 11): ++ assert repr(e) == ( ++ "" ++ ) ++ else: ++ assert repr(e) == ( ++ "" ++ ) + + def test_pushedstreamreceived_repr(self): + """ +@@ -284,11 +297,18 @@ def test_settingsacknowledged_repr(self): + ), + } + +- assert repr(e) == ( +- "" +- ) ++ if sys.version_info >= (3, 11): ++ assert repr(e) == ( ++ "" ++ ) ++ else: ++ assert repr(e) == ( ++ "" ++ ) + + def test_priorityupdated_repr(self): + """ +@@ -318,10 +338,16 @@ def test_connectionterminated_repr(self, additional_data, data_repr): + e.last_stream_id = 33 + e.additional_data = additional_data + +- assert repr(e) == ( +- "" % data_repr +- ) ++ if sys.version_info >= (3, 11): ++ assert repr(e) == ( ++ "" % data_repr ++ ) ++ else: ++ assert repr(e) == ( ++ "" % data_repr ++ ) + + def test_alternativeserviceavailable_repr(self): + """ diff --git a/h2-4.1.0.tar.gz b/h2-4.1.0.tar.gz new file mode 100644 index 0000000..ceafb46 --- /dev/null +++ b/h2-4.1.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a83aca08fbe7aacb79fec788c9c0bac936343560ed9ec18b82a13a12c28d2abb +size 2145593 diff --git a/h2-4.2.0.tar.gz b/h2-4.2.0.tar.gz new file mode 100644 index 0000000..61248b4 --- /dev/null +++ b/h2-4.2.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8a52129695e88b1a0578d8d2cc6842bbd79128ac685463b887ee278126ad01f +size 2150682 diff --git a/python-h2.changes b/python-h2.changes new file mode 100644 index 0000000..3f8f4f1 --- /dev/null +++ b/python-h2.changes @@ -0,0 +1,173 @@ +------------------------------------------------------------------- +Tue Feb 11 09:03:44 UTC 2025 - John Paul Adrian Glaubitz + +- Update to 4.2.0 + * Support for Python 3.6 has been removed. + * Support for Python 3.7 has been removed. + * Support for Python 3.8 has been removed. + * Remove mistakenly set `max_inbound_frame_size` attribute on `H2Stream`. + * Support for Python 3.11 has been added. + * Support for Python 3.12 has been added. + * Support for Python 3.13 has been added. + * Add an ability to send outbound cookies separately to improve headers compression. + * Updated packaging and testing infrastructure. + * Fix repr() checks for Python 3.11 + * Fix asyncio / wsgi examples. + * Clarify docs on using curl with http2. +- Adjust path for patching tests/conftest.py +- Drop fix-repr-checks-for-py311.patch, merged upstream +- Switch build system from setuptools to pyproject.toml + * Add python-pip and python-wheel to BuildRequires + * Replace %python_build with %pyproject_wheel + * Replace %python_install with %pyproject_install + +------------------------------------------------------------------- +Fri Apr 21 12:26:00 UTC 2023 - Dirk Müller + +- add sle15_python_module_pythons (jsc#PED-68) + +------------------------------------------------------------------- +Thu Apr 13 22:41:43 UTC 2023 - Matej Cepl + +- Make calling of %{sle15modernpython} optional. + +------------------------------------------------------------------- +Mon Dec 19 10:42:29 UTC 2022 - Dirk Müller + +- add fix-repr-checks-for-py311.patch + +------------------------------------------------------------------- +Thu Jan 6 14:23:47 UTC 2022 - Ben Greiner + +- Update to 4.1.0 + * Support for Python 3.9 has been added. + * Support for Python 3.10 has been added. + * New example for a Python socket HTTP/2 client. + * New `OutputLogger` for use with ``h2.config.logger``. This is + only provided for convenience and not part of the stable API. + * Header validation now rejects empty header names with a + ProtocolError. While hpack decodes such header blocks without + issues, they violate the HTTP semantics. + * Fix TE header name in error message. +- Drop h2-pr1248-disable-hypothesis-healthcheck.patch merged + upstream +- Register hypothesis profile for slow obs executions. + +------------------------------------------------------------------- +Mon Mar 29 19:50:36 UTC 2021 - Ben Greiner + +- Add h2-pr1248-disable-hypothesis-healthcheck.patch to disable + hypthesis health check failures. Thanks to the Fedora maintainer. + gh#python-hyper/h2#1248 + +------------------------------------------------------------------- +Sat Nov 21 17:07:56 UTC 2020 - John Vandenberg + +- Drop hyperframe.patch no longer needed +- Skip flaky tests test_connection_only_empty & test_delegated_eq + that hypothesis is failing on s390x +- Update to v4.0.0 + * Support for Python 2.7-3.5 has been dropped + * Support for Python 3.8 has been added. + * Receiving DATA before HEADERS now raises a ProtocolError + (see https://tools.ietf.org/html/rfc7540#section-8.1) + +------------------------------------------------------------------- +Tue Sep 15 13:10:43 UTC 2020 - Marketa Calabkova + +- Add hyperframe.patch to fix build with hyperframe 6 + +------------------------------------------------------------------- +Sat Mar 14 08:37:11 UTC 2020 - Tomáš Chvátal + +- Fix build without python2 + +------------------------------------------------------------------- +Thu Feb 27 05:43:42 UTC 2020 - Steve Kowalik + +- Update to 3.2.0: + * Receiving DATA frames on closed (or reset) streams now properly emit a + WINDOW_UPDATE to keep the connection flow window topped up. + * h2.config.logger now uses a trace(...) function, in addition to + debug(...). + +------------------------------------------------------------------- +Wed Dec 4 09:27:07 UTC 2019 - Tomáš Chvátal + +- Skip one test that is flaky + +------------------------------------------------------------------- +Thu Nov 14 06:57:45 UTC 2019 - Steve Kowalik + +- Drop unused dependancies on pytest-cov and pytest-xdist. + +------------------------------------------------------------------- +Thu Sep 12 10:04:22 UTC 2019 - Tomáš Chvátal + +- Update to 3.1.1: + * Ignore WINDOW_UPDATE and RST_STREAM frames received after stream closure. +- Drop patch pytest5.patch + +------------------------------------------------------------------- +Fri Jul 26 10:02:54 UTC 2019 - Tomáš Chvátal + +- Add patch to fix building with pytest5 pytest5.patch + +------------------------------------------------------------------- +Fri Jul 26 09:58:17 UTC 2019 - Tomáš Chvátal + +- Skip flaky test in OBS: + * test_changing_max_frame_size + +------------------------------------------------------------------- +Fri Jul 19 08:59:56 UTC 2019 - Tomáš Chvátal + +- Use pytest4 for now, link upstream ticket + +------------------------------------------------------------------- +Tue May 14 19:21:59 UTC 2019 - Drew Balliet + +- Updated testing line to current standard +- Removed symlink in install line + +------------------------------------------------------------------- +Thu Mar 28 04:06:48 UTC 2019 - John Vandenberg + +- Set URL to more useful https://github.com/python-hyper/hyper-h2 +- Update to v3.1.0 + * API Changes (Backward-Incompatible) + + h2.connection.H2Connection.data_to_send first and only + argument ``amt`` was renamed to ``amount`` + + Support for Python 3.3 has been removed. + * API Changes (Backward-Compatible) + + h2.connection.H2Connection.send_data now supports ``data`` + parameter being a ``memoryview`` object. + + Refactor ping-related events: a h2.events.PingReceived event is + fired when a PING frame is received and a h2.events.PingAckReceived + event is fired when a PING frame with an ACK flag is received + + h2.events.PingAcknowledged is deprecated in favour of the + identical h2.events.PingAckReceived + + Added ENABLE_CONNECT_PROTOCOL to h2.settings.SettingCodes + + Support CONNECT requests with a ``:protocol`` pseudo header + thereby supporting RFC 8441. + + A limit to the number of closed streams kept in memory by the + connection is applied. It can be configured by + h2.connection.H2Connection.MAX_CLOSED_STREAMS + * Debug logging when stream_id is None is now fixed and no longer errors. + +------------------------------------------------------------------- +Tue Dec 4 12:49:07 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Fri Apr 21 19:25:18 UTC 2017 - aloisio@gmx.com + +- Update to version 3.0.1 (see HISTORY.rst) +- Converted to single-spec +- Enabled tests + +------------------------------------------------------------------- +Tue Dec 27 14:34:57 UTC 2016 - aloisio@gmx.com + +- Initial package (2.5.1) diff --git a/python-h2.spec b/python-h2.spec new file mode 100644 index 0000000..f8d2d1a --- /dev/null +++ b/python-h2.spec @@ -0,0 +1,77 @@ +# +# spec file for package python-h2 +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?!python_module:%define python_module() python3-%{**}} +%define skip_python2 1 +%{?sle15_python_module_pythons} +Name: python-h2 +Version: 4.2.0 +Release: 0 +Summary: HTTP/2 State-Machine based protocol implementation +License: MIT +URL: https://github.com/python-hyper/hyper-h2 +Source0: https://files.pythonhosted.org/packages/source/h/h2/h2-%{version}.tar.gz +BuildRequires: %{python_module hpack >= 2.3} +BuildRequires: %{python_module hyperframe >= 6.0} +BuildRequires: %{python_module hypothesis >= 5.49} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-hpack >= 2.3 +Requires: python-hyperframe >= 6.0 +BuildArch: noarch +%python_subpackages + +%description +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. + +%prep +%autosetup -p1 -n h2-%{version} + +echo " +# increase test deadline for slow obs executions +import hypothesis +hypothesis.settings.register_profile( + 'obs', + deadline=5000, + suppress_health_check=[hypothesis.HealthCheck.too_slow] +) +" >> tests/conftest.py + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest --hypothesis-profile=obs + +%files %{python_files} +%license LICENSE +%doc CHANGELOG.rst README.rst +%{python_sitelib}/h2 +%{python_sitelib}/h2-%{version}*-info + +%changelog