Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
90fbd08bea
!9 Fix repr checks for Python 3.11
From: @wk333 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2023-07-23 10:24:25 +00:00
wk333
dd2454694f Fix repr checks for Python 3.11 2023-07-23 18:02:07 +08:00
openeuler-ci-bot
d0dc74fe87
!8 upgrade version to 4.1.0
From: @dingdingaaaaa 
Reviewed-by: @yangzhao_kl 
Signed-off-by: @yangzhao_kl
2022-12-08 06:33:11 +00:00
dingdingaaaaa
ac1d2c167f upgrade version to 4.1.0 2022-12-07 13:57:11 +08:00
openeuler-ci-bot
c49b2752c7
!6 修复python-hypothesis升级导致python-h2编译失败问题
From: @wu-leilei 
Reviewed-by: @shinwell_hu 
Signed-off-by: @shinwell_hu
2022-07-13 01:29:09 +00:00
wu-leilei
7ea846e2b9 fix the failure of python-h2 2022-07-08 11:29:33 +08:00
openeuler-ci-bot
d884e13547
!5 解决python-h2失败 error:file not foud .... -py?.?.egg-info
From: @penelope_y 
Reviewed-by: @shinwell_hu 
Signed-off-by: @shinwell_hu
2022-05-07 06:09:35 +00:00
penelope
d2535ef219 Fix build error caused by py3.10+ wildcard 2022-05-06 20:51:36 +08:00
openeuler-ci-bot
e061cef2c7 !4 update to 4.0.0
From: @lyn1001
Reviewed-by: @myeuler
Signed-off-by: @myeuler
2021-07-29 06:16:27 +00:00
lyn1001
6ecc6b8d52 update to 4.0.0 2021-07-28 15:17:09 +08:00
4 changed files with 133 additions and 7 deletions

View File

@ -0,0 +1,109 @@
From eabe727282e7a7aa3254773292f86cf341bdc597 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
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
Origin: https://github.com/python-hyper/h2/pull/1274
---
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) == (
- "<RemoteSettingsChanged changed_settings:{ChangedSetting("
- "setting=SettingCodes.INITIAL_WINDOW_SIZE, original_value=65536, "
- "new_value=32768)}>"
- )
+ if sys.version_info >= (3, 11):
+ assert repr(e) == (
+ "<RemoteSettingsChanged changed_settings:{ChangedSetting("
+ "setting=4, original_value=65536, "
+ "new_value=32768)}>"
+ )
+ else:
+ assert repr(e) == (
+ "<RemoteSettingsChanged changed_settings:{ChangedSetting("
+ "setting=SettingCodes.INITIAL_WINDOW_SIZE, original_value=65536, "
+ "new_value=32768)}>"
+ )
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) == (
- "<StreamReset stream_id:919, "
- "error_code:ErrorCodes.ENHANCE_YOUR_CALM, remote_reset:False>"
- )
+ if sys.version_info >= (3, 11):
+ assert repr(e) == (
+ "<StreamReset stream_id:919, "
+ "error_code:11, remote_reset:False>"
+ )
+ else:
+ assert repr(e) == (
+ "<StreamReset stream_id:919, "
+ "error_code:ErrorCodes.ENHANCE_YOUR_CALM, remote_reset:False>"
+ )
def test_pushedstreamreceived_repr(self):
"""
@@ -284,11 +297,18 @@ def test_settingsacknowledged_repr(self):
),
}
- assert repr(e) == (
- "<SettingsAcknowledged changed_settings:{ChangedSetting("
- "setting=SettingCodes.INITIAL_WINDOW_SIZE, original_value=65536, "
- "new_value=32768)}>"
- )
+ if sys.version_info >= (3, 11):
+ assert repr(e) == (
+ "<SettingsAcknowledged changed_settings:{ChangedSetting("
+ "setting=4, original_value=65536, "
+ "new_value=32768)}>"
+ )
+ else:
+ assert repr(e) == (
+ "<SettingsAcknowledged changed_settings:{ChangedSetting("
+ "setting=SettingCodes.INITIAL_WINDOW_SIZE, original_value=65536, "
+ "new_value=32768)}>"
+ )
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) == (
- "<ConnectionTerminated error_code:ErrorCodes.INADEQUATE_SECURITY, "
- "last_stream_id:33, additional_data:%s>" % data_repr
- )
+ if sys.version_info >= (3, 11):
+ assert repr(e) == (
+ "<ConnectionTerminated error_code:12, "
+ "last_stream_id:33, additional_data:%s>" % data_repr
+ )
+ else:
+ assert repr(e) == (
+ "<ConnectionTerminated error_code:ErrorCodes.INADEQUATE_SECURITY, "
+ "last_stream_id:33, additional_data:%s>" % data_repr
+ )
def test_alternativeserviceavailable_repr(self):
"""

Binary file not shown.

BIN
h2-4.1.0.tar.gz Normal file

Binary file not shown.

View File

@ -1,13 +1,15 @@
Name: python-h2
Version: 3.1.0
Release: 5
Version: 4.1.0
Release: 2
Summary: A HTTP/2 protocol stack for Python
License: MIT
URL: http://hyper.rtfd.org
Source0: https://files.pythonhosted.org/packages/c9/08/109f814130177273afc06b1f9851084397c337b09cdc6f17172c00f3d02b/h2-3.1.0.tar.gz
URL: https://python-hyper.org/projects/hyper-h2/en/v4.1.0/
Source0: https://files.pythonhosted.org/packages/2a/32/fec683ddd10629ea4ea46d206752a95a2d8a48c22521edd70b142488efe1/h2-4.1.0.tar.gz
Patch0: Fix-repr-checks-for-Python-3.11.patch
BuildArch: noarch
BuildRequires: (python3dist(hpack) >= 2.3 with python3dist(hpack) < 4) (python3dist(hyperframe) with python3dist(hyperframe) < 6)
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
@ -59,17 +61,32 @@ ln -s /usr/share/javascript/jquery/3.2.1/jquery.js html/_static/jquery-3.2.1.js
%py3_install
%check
%{__python3} -m pytest
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest
%files -n python3-h2
%doc README.rst LICENSE
%{python3_sitelib}/h2
%{python3_sitelib}/h2-%{version}-py?.?.egg-info
%{python3_sitelib}/h2-%{version}-py%{python3_version}.egg-info
%files help
%doc html LICENSE
%changelog
* Sun Jul 23 2023 wangkai <13474090681@163.com> - 4.1.0-2
- Fix repr checks for Python 3.11
* Thu Dec 01 2022 dingdingaaaaa <dingziwei@kylinos.cn> - 4.1.0-1
- upgrade version to 4.1.0
* Thu Jul 7 2022 wulei <wulei80@h-partners.com> - 4.0.0-3
- fix with hypothesis 6.6
* Fri May 06 2022 yangping <yangping69@h-partners.com> - 4.0.0-2
- Fix build error caused by py3.10+ wildcard
* 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