From 83afa7b41cc78e506c76d6eb4523d5ce443560cd1824dc1ce2f798b6ad8c94c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 4 Feb 2025 14:11:24 +0000 Subject: [PATCH] - Update to 4.1.0 * API Changes (Backward Incompatible)** - Support for Python 3.6 has been removed. - Support for Python 3.7 has been removed. - Support for Python 3.8 has been removed. - Renamed `InvalidTableIndex` exception to `InvalidTableIndexError`. * API Changes (Backward Compatible)** - Support for Python 3.9 has been added. - Support for Python 3.10 has been added. - Support for Python 3.11 has been added. - Support for Python 3.12 has been added. - Support for Python 3.13 has been added. - Optimized bytes encoding of headers. - Updated packaging and testing infrastructure. - Code cleanup and linting. - Added type hints. - Refresh healthcheck.patch - Refresh test_fixtures.tar.xz - 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 * Update name for dist directory in %files section OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hpack?expand=0&rev=24 --- .gitattributes | 23 ++++++ .gitignore | 1 + healthcheck.patch | 28 +++++++ hpack-4.0.0.tar.gz | 3 + hpack-4.1.0.tar.gz | 3 + python-hpack.changes | 186 +++++++++++++++++++++++++++++++++++++++++++ python-hpack.spec | 67 ++++++++++++++++ test_fixtures.tar.xz | 3 + 8 files changed, 314 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 healthcheck.patch create mode 100644 hpack-4.0.0.tar.gz create mode 100644 hpack-4.1.0.tar.gz create mode 100644 python-hpack.changes create mode 100644 python-hpack.spec create mode 100644 test_fixtures.tar.xz 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/healthcheck.patch b/healthcheck.patch new file mode 100644 index 0000000..18cc6ca --- /dev/null +++ b/healthcheck.patch @@ -0,0 +1,28 @@ +diff -Nru hpack-4.1.0.orig/tests/test_hpack.py hpack-4.1.0/tests/test_hpack.py +--- hpack-4.1.0.orig/tests/test_hpack.py 2024-11-23 09:35:36.000000000 +0100 ++++ hpack-4.1.0/tests/test_hpack.py 2025-02-04 12:22:54.679696648 +0100 +@@ -1,7 +1,7 @@ + import itertools + import pytest + +-from hypothesis import given ++from hypothesis import given, settings, HealthCheck + from hypothesis.strategies import text, binary, sets, one_of + + from hpack import ( +@@ -767,6 +767,7 @@ + binary().filter(lambda k: k and not k.startswith(b':')) + ) + ++ @settings(suppress_health_check=[HealthCheck.too_slow]) + @given( + special_keys=sets(keys), + boring_keys=sets(keys), +@@ -804,6 +805,7 @@ + assert special_keys == received_special + assert boring_keys == received_boring + ++ @settings(suppress_health_check=[HealthCheck.too_slow]) + @given( + special_keys=sets(keys), + boring_keys=sets(keys), diff --git a/hpack-4.0.0.tar.gz b/hpack-4.0.0.tar.gz new file mode 100644 index 0000000..1540d4f --- /dev/null +++ b/hpack-4.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc41de0c63e687ebffde81187a948221294896f6bdc0ae2312708df339430095 +size 49117 diff --git a/hpack-4.1.0.tar.gz b/hpack-4.1.0.tar.gz new file mode 100644 index 0000000..a705585 --- /dev/null +++ b/hpack-4.1.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec5eca154f7056aa06f196a557655c5b009b382873ac8d1e66e79e87535f1dca +size 51276 diff --git a/python-hpack.changes b/python-hpack.changes new file mode 100644 index 0000000..4f9fb12 --- /dev/null +++ b/python-hpack.changes @@ -0,0 +1,186 @@ +------------------------------------------------------------------- +Tue Feb 4 11:51:51 UTC 2025 - John Paul Adrian Glaubitz + +- Update to 4.1.0 + * API Changes (Backward Incompatible)** + - Support for Python 3.6 has been removed. + - Support for Python 3.7 has been removed. + - Support for Python 3.8 has been removed. + - Renamed `InvalidTableIndex` exception to `InvalidTableIndexError`. + * API Changes (Backward Compatible)** + - Support for Python 3.9 has been added. + - Support for Python 3.10 has been added. + - Support for Python 3.11 has been added. + - Support for Python 3.12 has been added. + - Support for Python 3.13 has been added. + - Optimized bytes encoding of headers. + - Updated packaging and testing infrastructure. + - Code cleanup and linting. + - Added type hints. +- Refresh healthcheck.patch +- Refresh test_fixtures.tar.xz +- 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 + * Update name for dist directory in %files section + +------------------------------------------------------------------- +Fri Apr 21 12:26:14 UTC 2023 - Dirk Müller + +- add sle15_python_module_pythons (jsc#PED-68) + +------------------------------------------------------------------- +Thu Apr 13 22:41:50 UTC 2023 - Matej Cepl + +- Make calling of %{sle15modernpython} optional. + +------------------------------------------------------------------- +Tue Dec 15 21:36:53 UTC 2020 - Matej Cepl + +- Upgrade to 4.0.0: + - remove pytest5.patch, which was included in the upstream tarball. + - support for Python < 3.6 (including 2.7) has been removed. + - support for Python 3.8 has been added. + - Performance improvement of static header search. Use dict search + instead of linear search. + - Fix debug output of headers during encoding. + +------------------------------------------------------------------- +Wed May 6 07:37:26 UTC 2020 - Tomáš Chvátal + +- Add patch to work with pytest5: + * pytest5.patch + +------------------------------------------------------------------- +Wed Jan 15 13:24:22 UTC 2020 - Ondřej Súkup + +- add healthcheck.patch to disarm too_slow healthcheck random fails + +------------------------------------------------------------------- +Fri Jul 19 09:49:33 UTC 2019 - Tomáš Chvátal + +- Restrict pytest5 for now + +------------------------------------------------------------------- +Wed Jan 2 12:47:37 UTC 2019 - Tomáš Chvátal + +- Skip one more flaky test +- Update url to point to upstream github + +------------------------------------------------------------------- +Tue Dec 4 12:48:55 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Sat Apr 22 08:11:31 UTC 2017 - aloisio@gmx.com + +- Update to version 3.0.0 + API Changes (Backward Incompatible): + * Removed nghttp2 support. This support had rotted and was + essentially non-functional, so it has now been removed until + someone has time to re-add the support in a functional form. + * Attempts by the encoder to exceed the maximum allowed header + table size via dynamic table size updates (or the absence + thereof) are now forbidden. + API Changes (Backward Compatible): + * Added a new InvalidTableSizeError thrown when the encoder does + not respect the maximum table size set by the user. + * Added a Decoder.max_allowed_table_size field that sets the + maximum allowed size of the decoder header table. See the + documentation for an indication of how this should be used. + Bugfixes: + * Up to 25% performance improvement decoding HPACK-packed + integers, depending on the platform. + * HPACK now tolerates receiving multiple header table size + changes in sequence, rather than only one. + * HPACK now forbids header table size changes anywhere but first + in a header block, as required by RFC 7541 § 4.2. + * Other miscellaneous performance improvements. + Version 2.3.0 + Security Fixes: + * CVE-2016-6581: HPACK Bomb. This release now enforces a maximum + value of the decompressed size of the header list. This is to + avoid the so-called “HPACK Bomb” vulnerability, which is caused + when a malicious peer sends a compressed HPACK body that + decompresses to a gigantic header list size. + This also adds a OversizedHeaderListError, which is thrown by + the decode method if the maximum header list size is being + violated. This places the HPACK decoder into a broken state: it + must not be used after this exception is thrown. + This also adds a max_header_list_size to the Decoder object. This + controls the maximum allowable decompressed size of the header + list. By default this is set to 64kB. + +- Converted to single-spec + +- Enabled tests + +------------------------------------------------------------------- +Mon May 2 12:00:12 UTC 2016 - freitag@owncloud.com + +- Fixed messy changelog. + +------------------------------------------------------------------- +Mon Apr 25 11:16:50 UTC 2016 - freitag@owncloud.com + +- Update to version 2.2.0: + API Changes (Backward Compatible) + * Added HeaderTuple and NeverIndexedHeaderTuple classes that signal + whether a given header field may ever be indexed in HTTP/2 header + compression. + * Changed Decoder.decode() to return the newly added HeaderTuple + class and subclass. These objects behave like two-tuples, so this + change does not break working code. + Bugfixes + * Improve Huffman decoding speed by 4x using an approach borrowed + from nghttp2. + * Improve HPACK decoding speed by 10% by caching header table sizes. + +- Bugfixes since 2.1.1: + * When passing a dictionary or dictionary subclass to Encoder.encode, + HPACK now ensures that HTTP/2 special headers (headers whose names + begin with `:` characters) appear first in the header block. + +- Changes in 2.1.0 (2016-02-02) + API Changes (Backward Compatible) + * Added new InvalidTableIndex exception, a subclass of + HPACKDecodingError. + * Instead of throwing IndexError when encountering invalid encoded + integers HPACK now throws HPACKDecodingError. + * Instead of throwing UnicodeDecodeError when encountering headers + that are not UTF-8 encoded, HPACK now throws HPACKDecodingError. + * Instead of throwing IndexError when encountering invalid table + offsets, HPACK now throws InvalidTableIndex. + * Added raw flag to decode, allowing decode to return bytes instead + of attempting to decode the headers as UTF-8. + Bugfixes + * memoryview objects are now used when decoding HPACK, improving + the performance by avoiding unnecessary data copies. + +------------------------------------------------------------------- +Wed Jan 6 19:43:13 UTC 2016 - freitag@opensuse.org + +- Update to version 2.0.1 + * Fixed a bug where the Python HPACK implementation would only + emit header table size changes for the total change between one + header block and another, rather than for the entire sequence + of changes. + +- Additional changes from version 2.0.0 (2015-10-12) + * Remove unused HPACKEncodingError. + * Add the shortcut ability to import the public API (Encoder, + Decoder, HPACKError, HPACKDecodingError) directly, rather than + from hpack.hpack. + +------------------------------------------------------------------- +Tue Aug 25 12:39:56 UTC 2015 - freitag@owncloud.com + +- Add forgotten doc files to filelist + +------------------------------------------------------------------- +Mon Aug 24 18:33:25 UTC 2015 - freitag@opensuse.org + +- Initial package version 1.1.0 + diff --git a/python-hpack.spec b/python-hpack.spec new file mode 100644 index 0000000..66f8a93 --- /dev/null +++ b/python-hpack.spec @@ -0,0 +1,67 @@ +# +# spec file for package python-hpack +# +# 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() python-%{**} python3-%{**}} +%{?sle15_python_module_pythons} +Name: python-hpack +Version: 4.1.0 +Release: 0 +Summary: Pure-Python HPACK header compression +License: MIT +URL: https://github.com/python-hyper/hpack +Source0: https://files.pythonhosted.org/packages/source/h/hpack/hpack-%{version}.tar.gz +# Content of https://github.com/python-hyper/hpack/tree/master/test/test_fixtures +Source1: test_fixtures.tar.xz +Patch0: healthcheck.patch +BuildRequires: %{python_module hypothesis} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildArch: noarch +%python_subpackages + +%description +This module contains a pure-Python HTTP/2 header encoding (HPACK) logic for use in +Python programs that implement HTTP/2. It also contains a compatibility layer that +automatically enables the use of nghttp2 if it’s available. + +%prep +%autosetup -p1 -a1 -n hpack-%{version} + +%build +export LC_ALL="en_US.UTF-8" +%pyproject_wheel + +%install +export LC_ALL="en_US.UTF-8" +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest -k "not (test_can_decode_a_story or test_can_decode_a_story_no_huffman or test_can_encode_a_story_with_huffman or test_can_encode_a_story_no_huffman or test_decode_either_succeeds_or_raises_error)" + +%files %{python_files} +%license LICENSE +%doc CHANGELOG.rst CONTRIBUTORS.rst README.rst +%{python_sitelib}/hpack +%{python_sitelib}/hpack-%{version}.dist-info + +%changelog diff --git a/test_fixtures.tar.xz b/test_fixtures.tar.xz new file mode 100644 index 0000000..9c67886 --- /dev/null +++ b/test_fixtures.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:565212937473caa4df7793d3cb3d5145f3703b17380ec371f4c74f93d1a3ae06 +size 2137208