Compare commits
10 Commits
a0cb74d6bd
...
8bbe38b403
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bbe38b403 | ||
|
|
202ed0a27f | ||
|
|
e061cef2c7 | ||
|
|
6ecc6b8d52 | ||
|
|
3a79e741ac | ||
|
|
f07fe52ead | ||
|
|
047b8a5a47 | ||
|
|
eee6f7c7cb | ||
|
|
880a9e6e5f | ||
|
|
d8bd7a945b |
101
fix-with-hypothesis-6.6.patch
Normal file
101
fix-with-hypothesis-6.6.patch
Normal file
@ -0,0 +1,101 @@
|
||||
From 164c74ee3d5b6a3a15c2d8e472c6ca1c79ec85f9 Mon Sep 17 00:00:00 2001
|
||||
From: Miro <miro@hroncok.cz>
|
||||
Date: Mon, 8 Mar 2021 19:16:26 +0100
|
||||
Subject: [PATCH] Workaround the issues with hypothesis 6.6
|
||||
|
||||
---
|
||||
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 fb54fe5..8c8f3b7 100644
|
||||
--- a/test/test_basic_logic.py
|
||||
+++ b/test/test_basic_logic.py
|
||||
@@ -21,7 +21,7 @@ import h2.stream
|
||||
|
||||
from . import helpers
|
||||
|
||||
-from hypothesis import given
|
||||
+from hypothesis import given, settings, HealthCheck
|
||||
from hypothesis.strategies import integers
|
||||
|
||||
|
||||
@@ -790,6 +790,7 @@ class TestBasicClient(object):
|
||||
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 24b345a..7a445af 100644
|
||||
--- a/test/test_flow_control_window.py
|
||||
+++ b/test/test_flow_control_window.py
|
||||
@@ -7,7 +7,7 @@ Tests of the flow control management in h2
|
||||
"""
|
||||
import pytest
|
||||
|
||||
-from hypothesis import given
|
||||
+from hypothesis import given, settings, HealthCheck
|
||||
from hypothesis.strategies import integers
|
||||
|
||||
import h2.config
|
||||
@@ -715,6 +715,7 @@ class TestAutomaticFlowControl(object):
|
||||
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 @@ class TestAutomaticFlowControl(object):
|
||||
)
|
||||
|
||||
@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 @@ class TestAutomaticFlowControl(object):
|
||||
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 @@ class TestAutomaticFlowControl(object):
|
||||
# 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 @@ class TestAutomaticFlowControl(object):
|
||||
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 69291df..56af927 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.5,<7
|
||||
commands =
|
||||
pytest --cov-report=xml --cov-report=term --cov=h2 {posargs}
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
||||
BIN
h2-4.0.0.tar.gz
Normal file
BIN
h2-4.0.0.tar.gz
Normal file
Binary file not shown.
88
python-h2.spec
Normal file
88
python-h2.spec
Normal file
@ -0,0 +1,88 @@
|
||||
Name: python-h2
|
||||
Version: 4.0.0
|
||||
Release: 2
|
||||
Summary: A HTTP/2 protocol stack for Python
|
||||
License: MIT
|
||||
URL: http://hyper.rtfd.org
|
||||
Source0: https://files.pythonhosted.org/packages/05/b8/cc1692aab910c0319b7c35e03c043bdda1cfeff67fa25b555eb2864a36e3/h2-4.0.0.tar.gz
|
||||
Patch0: fix-with-hypothesis-6.6.patch
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: (python3dist(hpack) >= 4 with python3dist(hpack) < 5)
|
||||
BuildRequires: (python3dist(hyperframe) >= 6 with python3dist(hyperframe) < 7)
|
||||
BuildRequires: python3-devel python3dist(setuptools) python3dist(sphinx) python3dist(pytest) python3dist(hypothesis)
|
||||
BuildRequires: js-jquery js-underscore
|
||||
|
||||
%{?python_enable_dependency_generator}
|
||||
|
||||
%description
|
||||
This repository contains a pure-Python implementation of a HTTP/2
|
||||
protocol stack. It is 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.
|
||||
|
||||
%package -n python3-h2
|
||||
Summary: A HTTP/2 protocol stack for Python 3
|
||||
%{?python_provide:%python_provide python3-h2}
|
||||
|
||||
%description -n python3-h2
|
||||
This repository contains a pure-Python implementation of a HTTP/2
|
||||
protocol stack. It is 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.
|
||||
|
||||
%package help
|
||||
Summary: Documents for python-h2
|
||||
|
||||
Requires: js-jquery js-underscore
|
||||
|
||||
Provides: python-h2-doc = %{version}-%{release}
|
||||
Obsoletes: python-h2-doc < %{version}-%{release}
|
||||
|
||||
%description help
|
||||
The python-h2-help package contains related documents.
|
||||
|
||||
%prep
|
||||
%autosetup -n h2-%{version} -p1
|
||||
rm -rf h2.egg-info
|
||||
|
||||
%build
|
||||
%py3_build
|
||||
|
||||
PYTHONPATH=${PWD} sphinx-build-3 docs/source html
|
||||
rm -rf html/{.doctrees,.buildinfo}
|
||||
rm -f html/_static/{underscore.js,underscore-1.3.1.js,jquery.js,jquery-3.2.1.js}
|
||||
ln -s /usr/share/javascript/underscore/underscore-min.js html/_static/underscore.js
|
||||
ln -s /usr/share/javascript/underscore/underscore.js html/_static/underscore-1.3.1.js
|
||||
ln -s /usr/share/javascript/jquery/3.2.1/jquery.min.js html/_static/jquery.js
|
||||
ln -s /usr/share/javascript/jquery/3.2.1/jquery.js html/_static/jquery-3.2.1.js
|
||||
|
||||
%install
|
||||
%py3_install
|
||||
|
||||
%check
|
||||
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest
|
||||
|
||||
%files -n python3-h2
|
||||
%doc README.rst LICENSE
|
||||
%{python3_sitelib}/h2
|
||||
%{python3_sitelib}/h2-%{version}-py%{python3_version}.egg-info
|
||||
|
||||
%files help
|
||||
%doc html LICENSE
|
||||
|
||||
%changelog
|
||||
* Mon Oct 31 2022 Ge Wang <wangge20@huawei.com> - 4.0.0-2
|
||||
- fix compile error due to python-hypothesis update to 6.47.0
|
||||
|
||||
* Wed Jul 28 2021 liyanan <liyanan32@huawei.com> - 4.0.0-1
|
||||
- update to 4.0.0
|
||||
|
||||
* Mon Oct 26 2020 maminjie <maminjie1@huawei.com> - 3.1.0-5
|
||||
- Drop python2 support
|
||||
|
||||
* Tue Mar 17 2020 yanglijin <yanglijin@huawei.com> - 3.1.0-4
|
||||
- modify buildrequires
|
||||
|
||||
* Tue Mar 03 2020 Jiangping Hu <hujp1985@foxmail.com> - 3.1.0-3
|
||||
- Package init
|
||||
Loading…
x
Reference in New Issue
Block a user