Update to 3.8.3

This commit is contained in:
Tomáš Hrnčiar 2022-09-26 13:41:07 +02:00
parent 70f433ae85
commit 4c165d745a
6 changed files with 9 additions and 193 deletions

1
.gitignore vendored
View File

@ -71,3 +71,4 @@
/aiohttp-3.7.4.tar.gz
/aiohttp-3.8.0.tar.gz
/aiohttp-3.8.1.tar.gz
/aiohttp-3.8.3.tar.gz

View File

@ -1,95 +0,0 @@
From 4e637fc268bdd976490aaacb8c28a204f6955156 Mon Sep 17 00:00:00 2001
From: Ben Greiner <code@bnavigator.de>
Date: Tue, 29 Mar 2022 00:24:49 +0200
Subject: [PATCH 2/2] Fix pytest.warns(None) usage, deprecated in pytest 7
(#6664)
* remove pytest.warns(None)
Deprecated misuse of pytest.warns()
https://docs.pytest.org/en/latest/deprecations.html#using-pytest-warns-none
* Remove duplicate test
test_session_close_awaitable() does the exact same thing and should throw a deprecation warning already which is caught by the general filter
* PR 6664 metadata
* "Fix" spelling. Bots everywhere!
* Update 6663.bugfix
* Update 6663.bugfix
Co-authored-by: Sam Bull <aa6bs0@sambull.org>
(cherry picked from commit 936e682d1ab6c833b3e5f0cc3596882cb9cb2444)
---
CHANGES/6663.bugfix | 1 +
CONTRIBUTORS.txt | 1 +
tests/test_client_functional.py | 19 +++----------------
3 files changed, 5 insertions(+), 16 deletions(-)
create mode 100644 CHANGES/6663.bugfix
diff --git a/CHANGES/6663.bugfix b/CHANGES/6663.bugfix
new file mode 100644
index 00000000..ee89799a
--- /dev/null
+++ b/CHANGES/6663.bugfix
@@ -0,0 +1 @@
+Remove a deprecated usage of pytest.warns(None)
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index 52c6b5c3..d0dc04fe 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -50,6 +50,7 @@ Artem Yushkovskiy
Arthur Darcet
Austin Scola
Ben Bader
+Ben Greiner
Ben Timby
Benedikt Reinartz
Bob Haddleton
diff --git a/tests/test_client_functional.py b/tests/test_client_functional.py
index 77126e14..479aca33 100644
--- a/tests/test_client_functional.py
+++ b/tests/test_client_functional.py
@@ -2428,32 +2428,19 @@ async def test_drop_auth_on_redirect_to_other_host(
async def test_async_with_session() -> None:
- with pytest.warns(None) as cm:
- async with aiohttp.ClientSession() as session:
- pass
- assert len(cm.list) == 0
+ async with aiohttp.ClientSession() as session:
+ pass
assert session.closed
async def test_session_close_awaitable() -> None:
session = aiohttp.ClientSession()
- with pytest.warns(None) as cm:
- await session.close()
- assert len(cm.list) == 0
+ await session.close()
assert session.closed
-async def test_close_run_until_complete_not_deprecated() -> None:
- session = aiohttp.ClientSession()
-
- with pytest.warns(None) as cm:
- await session.close()
-
- assert len(cm.list) == 0
-
-
async def test_close_resp_on_error_async_with_session(aiohttp_server) -> None:
async def handler(request):
resp = web.StreamResponse(headers={"content-length": "100"})
--
2.35.1

View File

@ -1,57 +0,0 @@
From 204779b7732a403e819df9a12b8f605c0c666e06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=3D=3FUTF-8=3Fq=3FVille=3D20Skytt=3DC3=3DA4=3F=3D?=
<ville.skytta@iki.fi>
Date: Mon, 16 May 2022 08:48:31 +0200
Subject: [PATCH] Stop using the cgi module, deprecated in Python 3.11 per PEP
594 (#6708)
* Stop using the cgi module, deprecated in Python 3.11 per PEP 594
https://peps.python.org/pep-0594/#cgi
* Simplify creating params dict
Co-authored-by: Sam Bull <aa6bs0@sambull.org>
* Create 6708.misc
Co-authored-by: Sam Bull <aa6bs0@sambull.org>
---
aiohttp/helpers.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/aiohttp/helpers.py b/aiohttp/helpers.py
index 536d219..f30f76b 100644
--- a/aiohttp/helpers.py
+++ b/aiohttp/helpers.py
@@ -3,7 +3,6 @@
import asyncio
import base64
import binascii
-import cgi
import datetime
import functools
import inspect
@@ -17,6 +16,7 @@ import warnings
import weakref
from collections import namedtuple
from contextlib import suppress
+from email.parser import HeaderParser
from email.utils import parsedate
from math import ceil
from pathlib import Path
@@ -756,7 +756,10 @@ class HeadersMixin:
self._content_type = "application/octet-stream"
self._content_dict = {}
else:
- self._content_type, self._content_dict = cgi.parse_header(raw)
+ msg = HeaderParser().parsestr("Content-Type: " + raw)
+ self._content_type = msg.get_content_type()
+ params = msg.get_params()
+ self._content_dict = dict(params[1:]) # First element is content type again
@property
def content_type(self) -> str:
--
2.33.1

View File

@ -1,29 +0,0 @@
From 19d8c96aea383b7856e46cd285e52428a56a207b Mon Sep 17 00:00:00 2001
From: Thomas Grainger <tagrain@gmail.com>
Date: Thu, 16 Jun 2022 11:07:28 +0100
Subject: [PATCH] set the global event loop in _setupAsyncioRunner
---
aiohttp/test_utils.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/aiohttp/test_utils.py b/aiohttp/test_utils.py
index 82956986b9..510e35e363 100644
--- a/aiohttp/test_utils.py
+++ b/aiohttp/test_utils.py
@@ -412,6 +412,15 @@ class AioHTTPTestCase(TestCase):
Note that the TestClient's methods are asynchronous: you have to
execute function on the test client using asynchronous methods.
"""
+ def _setupAsyncioRunner(self):
+ super()._setupAsyncioRunner()
+ asyncio.set_event_loop(self._asyncioRunner.get_loop())
+
+ def _tearDownAsyncioRunner(self):
+ try:
+ super()._tearDownAsyncioRunner()
+ finally:
+ asyncio.set_event_loop(None)
async def get_application(self) -> Application:
"""Get application.

View File

@ -3,8 +3,8 @@
%bcond_without tests
Name: python-%{srcname}
Version: 3.8.1
Release: 8%{?dist}
Version: 3.8.3
Release: 1%{?dist}
Summary: Python HTTP client/server for asyncio
License: ASL 2.0
@ -13,12 +13,6 @@ Source0: %{pypi_source}
# downstream only patch
Patch: 0001-Unbundle-llhttp.patch
# https://github.com/aio-libs/aiohttp/commit/936e682d1ab6c833b3e5f0cc3596882cb9cb2444
Patch: 0002-Fix-pytest.warns-None-usage-deprecated-in-pytest-7-6.patch
# https://github.com/aio-libs/aiohttp/pull/6734
Patch: 0003-Stop-using-the-cgi-module-deprecated-in-Python-3.11.patch
# https://github.com/aio-libs/aiohttp/commit/19d8c96aea383b7856e46cd285e52428a56a207b
Patch: 0004-Set-the-global-event-loop-in-setupAsyncioRunner.patch
BuildRequires: gcc
@ -93,11 +87,11 @@ cython -3 aiohttp/*.pyx -I aiohttp
%if %{with tests}
%check
export PYTHONSAFEPATH=1
# test_proxy_functional.py requires python3dist(proxy-py)
# test_client_session_timeout_zero requires DNS
# the 3 pyloop tests are still failing with 3.11, TODO report and investigate
%pytest --ignore=tests/test_proxy_functional.py \
-k 'not test_client_session_timeout_zero and not (pyloop and ((test_timeout_on and _headers) or test_data_stream_exc_chain))'
-k 'not test_client_session_timeout_zero'
%endif
%files -n python3-%{srcname}
@ -105,9 +99,11 @@ cython -3 aiohttp/*.pyx -I aiohttp
%license LICENSE.txt
%{python3_sitearch}/%{srcname}-*.egg-info/
%{python3_sitearch}/%{srcname}/
%exclude %{python3_sitearch}/examples/
%changelog
* Mon Sep 26 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.8.3-1
- Update to 3.8.3
* Thu Aug 18 2022 Stephen Gallagher <sgallagh@redhat.com> - 3.8.1-8
- Rebuilt for llhttp soname bump

View File

@ -1 +1 @@
SHA512 (aiohttp-3.8.1.tar.gz) = 3611549393e50c8d30426aee9ddd23794a71ddefe4384eb549049b93e452fafb38de7ad900737213b61fbe717bd85035a780c1622593eae250328f17d484a0a7
SHA512 (aiohttp-3.8.3.tar.gz) = 248c232604c91442b2fc9fa55fbf7df8e3af56dcf4cd9c516414a3a738c5c60a8a06395cd9c6e2c8ea9884728aea757423735c7b9be889e6f17e3ee6395a2f64