From 7ed81b114e4e0e1e51bca98bc8f32c302ede7a9c2576cf5ecc24f04e1efc6d96 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sat, 6 Oct 2018 09:20:40 +0000 Subject: [PATCH] - Upgrade to 3.4.4: - Multiple small bugfixes - Remove remove-failing-tests-due-to-pytest-timeout-issues.patch - Add invalid-escapes-in-tests.patch to fix invalid escapes in non-raw regexp strings. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-aiohttp?expand=0&rev=26 --- aiohttp-3.4.0.tar.gz | 3 - aiohttp-3.4.4.tar.gz | 3 + invalid-escapes-in-tests.patch | 98 +++++++++++++++++++ python-aiohttp.changes | 10 ++ python-aiohttp.spec | 11 ++- ...g-tests-due-to-pytest-timeout-issues.patch | 35 ------- 6 files changed, 117 insertions(+), 43 deletions(-) delete mode 100644 aiohttp-3.4.0.tar.gz create mode 100644 aiohttp-3.4.4.tar.gz create mode 100644 invalid-escapes-in-tests.patch delete mode 100644 remove-failing-tests-due-to-pytest-timeout-issues.patch diff --git a/aiohttp-3.4.0.tar.gz b/aiohttp-3.4.0.tar.gz deleted file mode 100644 index a5e2eee..0000000 --- a/aiohttp-3.4.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9b15efa7411dcf3b59c1f4766eb16ba1aba4531a33e54d469ee22106eabce460 -size 821067 diff --git a/aiohttp-3.4.4.tar.gz b/aiohttp-3.4.4.tar.gz new file mode 100644 index 0000000..87f616b --- /dev/null +++ b/aiohttp-3.4.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51afec6ffa50a9da4cdef188971a802beb1ca8e8edb40fa429e5e529db3475fa +size 822110 diff --git a/invalid-escapes-in-tests.patch b/invalid-escapes-in-tests.patch new file mode 100644 index 0000000..17036cb --- /dev/null +++ b/invalid-escapes-in-tests.patch @@ -0,0 +1,98 @@ +--- a/tests/test_http_parser.py ++++ b/tests/test_http_parser.py +@@ -369,7 +369,7 @@ def test_max_header_field_size(parser, s + name = b't' * size + text = (b'GET /test HTTP/1.1\r\n' + name + b':data\r\n\r\n') + +- match = ("400, message='Got more than 8190 bytes \({}\) when reading" ++ match = (r"400, message='Got more than 8190 bytes \({}\) when reading" + .format(size)) + with pytest.raises(http_exceptions.LineTooLong, match=match): + parser.feed_data(text) +@@ -399,7 +399,7 @@ def test_max_header_value_size(parser, s + text = (b'GET /test HTTP/1.1\r\n' + b'data:' + name + b'\r\n\r\n') + +- match = ("400, message='Got more than 8190 bytes \({}\) when reading" ++ match = (r"400, message='Got more than 8190 bytes \({}\) when reading" + .format(size)) + with pytest.raises(http_exceptions.LineTooLong, match=match): + parser.feed_data(text) +@@ -430,7 +430,7 @@ def test_max_header_value_size_continuat + text = (b'GET /test HTTP/1.1\r\n' + b'data: test\r\n ' + name + b'\r\n\r\n') + +- match = ("400, message='Got more than 8190 bytes \({}\) when reading" ++ match = (r"400, message='Got more than 8190 bytes \({}\) when reading" + .format(size)) + with pytest.raises(http_exceptions.LineTooLong, match=match): + parser.feed_data(text) +@@ -551,7 +551,7 @@ def test_http_request_parser_bad_version + @pytest.mark.parametrize('size', [40965, 8191]) + def test_http_request_max_status_line(parser, size): + path = b't' * (size - 5) +- match = ("400, message='Got more than 8190 bytes \({}\) when reading" ++ match = (r"400, message='Got more than 8190 bytes \({}\) when reading" + .format(size)) + with pytest.raises(http_exceptions.LineTooLong, match=match): + parser.feed_data( +@@ -595,7 +595,7 @@ def test_http_response_parser_utf8(respo + @pytest.mark.parametrize('size', [40962, 8191]) + def test_http_response_parser_bad_status_line_too_long(response, size): + reason = b't' * (size - 2) +- match = ("400, message='Got more than 8190 bytes \({}\) when reading" ++ match = (r"400, message='Got more than 8190 bytes \({}\) when reading" + .format(size)) + with pytest.raises(http_exceptions.LineTooLong, match=match): + response.feed_data( +--- a/tests/test_streams.py ++++ b/tests/test_streams.py +@@ -721,7 +721,7 @@ class TestStreamReader: + async def test___repr__waiter(self, loop): + stream = self._make_one() + stream._waiter = loop.create_future() +- assert re.search(">", ++ assert re.search(r">", + repr(stream)) + stream._waiter.set_result(None) + await stream._waiter +--- a/tests/test_urldispatch.py ++++ b/tests/test_urldispatch.py +@@ -586,7 +586,7 @@ def test_add_route_with_invalid_re(route + + def test_route_dynamic_with_regex_spec(router): + handler = make_handler() +- route = router.add_route('GET', '/get/{num:^\d+}', handler, ++ route = router.add_route('GET', r'/get/{num:^\d+}', handler, + name='name') + + url = route.url_for(num='123') +@@ -595,7 +595,7 @@ def test_route_dynamic_with_regex_spec(r + + def test_route_dynamic_with_regex_spec_and_trailing_slash(router): + handler = make_handler() +- route = router.add_route('GET', '/get/{num:^\d+}/', handler, ++ route = router.add_route('GET', r'/get/{num:^\d+}/', handler, + name='name') + + url = route.url_for(num='123') +@@ -1125,7 +1125,7 @@ def test_plain_resource_canonical(): + def test_dynamic_resource_canonical(): + canonicals = { + '/get/{name}': '/get/{name}', +- '/get/{num:^\d+}': '/get/{num}', ++ r'/get/{num:^\d+}': '/get/{num}', + r'/handler/{to:\d+}': r'/handler/{to}', + r'/{one}/{two:.+}': r'/{one}/{two}', + } +--- a/tests/test_web_request.py ++++ b/tests/test_web_request.py +@@ -340,7 +340,7 @@ def test_single_forwarded_header_multipl + + + def test_single_forwarded_header_quoted_escaped(): +- header = 'BY=identifier;pROTO="\lala lan\d\~ 123\!&"' ++ header = r'BY=identifier;pROTO="\lala lan\d\~ 123\!&"' + req = make_mocked_request('GET', '/', + headers=CIMultiDict({'Forwarded': header})) + assert req.forwarded[0]['by'] == 'identifier' diff --git a/python-aiohttp.changes b/python-aiohttp.changes index 170415a..0790825 100644 --- a/python-aiohttp.changes +++ b/python-aiohttp.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Sat Oct 6 11:10:41 CEST 2018 - mcepl@suse.com + +- Upgrade to 3.4.4: + - Multiple small bugfixes + +- Remove remove-failing-tests-due-to-pytest-timeout-issues.patch +- Add invalid-escapes-in-tests.patch to fix invalid escapes in + non-raw regexp strings. + ------------------------------------------------------------------- Fri Aug 31 11:50:26 UTC 2018 - Tomáš Chvátal diff --git a/python-aiohttp.spec b/python-aiohttp.spec index 85f95bf..ee437c9 100644 --- a/python-aiohttp.spec +++ b/python-aiohttp.spec @@ -12,22 +12,23 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # %{?!python_module:%define python_module() python3-%{**}} %define skip_python2 1 Name: python-aiohttp -Version: 3.4.0 +Version: 3.4.4 Release: 0 Summary: Asynchronous HTTP client/server framework License: Apache-2.0 Group: Development/Languages/Python URL: https://github.com/aio-libs/aiohttp Source: https://files.pythonhosted.org/packages/source/a/aiohttp/aiohttp-%{version}.tar.gz -# PATCH-FIX-OPENSUSE alarrosa@suse.com -- Fix failing tests due to issue in pytest-timeout -Patch0: remove-failing-tests-due-to-pytest-timeout-issues.patch +# PATCH-FIX-UPSTREAM mcepl@suse.com -- Fix failing tests due to invalid escapes in regexps +# https://github.com/aio-libs/aiohttp/issues/3325 +Patch0: invalid-escapes-in-tests.patch BuildRequires: %{python_module Cython >= 0.28.4} BuildRequires: %{python_module devel >= 3.5.3} BuildRequires: %{python_module setuptools} @@ -88,7 +89,7 @@ HTML documentation on the API and examples for %{name}. %prep %setup -q -n aiohttp-%{version} -%patch0 -p1 +%autopatch -p1 %build export CFLAGS="%{optflags}" diff --git a/remove-failing-tests-due-to-pytest-timeout-issues.patch b/remove-failing-tests-due-to-pytest-timeout-issues.patch deleted file mode 100644 index 0e9bdf4..0000000 --- a/remove-failing-tests-due-to-pytest-timeout-issues.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: Antonio Larrosa - -Remove failing test due to a DeprecationWarning being issued -by pytest because pytest-timeout is using a wrong parameter -when calling addoption. - -I tested changing pytest-timeout from using type='choice' to -type=str and that passed the tests, so I choosed to remove the -test while the fix gets to the python-pytest-timeout package. - -Index: aiohttp-3.0.1/tests/test_test_utils.py -=================================================================== ---- aiohttp-3.0.1.orig/tests/test_test_utils.py -+++ aiohttp-3.0.1/tests/test_test_utils.py -@@ -243,20 +243,6 @@ async def test_server_make_url_yarl_comp - make_url(URL('http://foo.com')) - - --def test_testcase_no_app(testdir, loop): -- testdir.makepyfile( -- """ -- from aiohttp.test_utils import AioHTTPTestCase -- -- -- class InvalidTestCase(AioHTTPTestCase): -- def test_noop(self): -- pass -- """) -- result = testdir.runpytest() -- result.stdout.fnmatch_lines(["*RuntimeError*"]) -- -- - async def test_server_context_manager(app, loop): - async with _TestServer(app, loop=loop) as server: - async with aiohttp.ClientSession(loop=loop) as client: