Accepting request 679843 from home:mimi_vx:branches:devel:languages:python

- update to 3.5.4
- drop invalid-escapes-in-tests.patch and rename-request-fixture.patch
  * big list of changes from 3.4.4 - https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst

OBS-URL: https://build.opensuse.org/request/show/679843
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-aiohttp?expand=0&rev=33
This commit is contained in:
Tomáš Chvátal 2019-02-27 14:32:14 +00:00 committed by Git OBS Bridge
parent 49c1d3a489
commit ba20c15e9e
6 changed files with 14 additions and 277 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:51afec6ffa50a9da4cdef188971a802beb1ca8e8edb40fa429e5e529db3475fa
size 822110

3
aiohttp-3.5.4.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9c4c83f4fa1938377da32bc2d59379025ceeee8e24b89f72fcbccd8ca22dc9bf
size 1097647

View File

@ -1,98 +0,0 @@
--- 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("<StreamReader w=<Future pending[\S ]*>>",
+ assert re.search(r"<StreamReader w=<Future pending[\S ]*>>",
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'

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Feb 27 14:25:09 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com>
- update to 3.5.4
- drop invalid-escapes-in-tests.patch and rename-request-fixture.patch
* big list of changes from 3.4.4 - https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst
-------------------------------------------------------------------
Tue Jan 15 13:15:30 UTC 2019 - Alberto Planas Dominguez <aplanas@suse.com>

View File

@ -19,19 +19,13 @@
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
Name: python-aiohttp
Version: 3.4.4
Version: 3.5.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-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
# PATCH-FIX-UPSTREAM glaubitz@suse.com -- Fix failing test due to naming conflict with pytest fixtures
# https://github.com/aio-libs/aiohttp/issues/3392
Patch1: rename-request-fixture.patch
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module devel >= 3.5.3}
BuildRequires: %{python_module setuptools}
@ -43,7 +37,6 @@ Requires: python-attrs >= 17.3.0
Requires: python-brotlipy
Requires: python-chardet >= 2.0
Requires: python-gunicorn
Requires: python-idna_ssl >= 1.0.0
Requires: python-multidict >= 4.0
Requires: python-yarl >= 1.0
Recommends: python-aiodns
@ -56,13 +49,15 @@ BuildRequires: %{python_module attrs >= 17.3.0}
BuildRequires: %{python_module brotlipy}
BuildRequires: %{python_module chardet >= 2.0}
BuildRequires: %{python_module gunicorn}
BuildRequires: %{python_module idna_ssl >= 1.0.0}
BuildRequires: %{python_module multidict >= 4.0}
BuildRequires: %{python_module pluggy}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module pytest-runner}
BuildRequires: %{python_module pytest-timeout}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module trustme}
BuildRequires: %{python_module yarl >= 1.0}
# /SECTION
# SECTION docs
@ -92,7 +87,6 @@ HTML documentation on the API and examples for %{name}.
%prep
%setup -q -n aiohttp-%{version}
%autopatch -p1
%build
export CFLAGS="%{optflags}"
@ -109,7 +103,6 @@ find %{buildroot}%{$python_sitearch} -name "*.c" -delete
}
%check
rm tests/test_pytest_plugin.py
%python_exec setup.py test
%files %{python_files}

View File

@ -1,165 +0,0 @@
diff -Nru aiohttp-3.4.4.orig/aiohttp/web_response.py aiohttp-3.4.4/aiohttp/web_response.py
--- aiohttp-3.4.4.orig/aiohttp/web_response.py 2018-09-05 09:40:54.000000000 +0200
+++ aiohttp-3.4.4/aiohttp/web_response.py 2018-11-20 13:49:49.197173589 +0100
@@ -279,27 +279,27 @@
# remove the header
self._headers.popall(hdrs.CONTENT_LENGTH, None)
- def _start_compression(self, request):
+ def _start_compression(self, mock_request):
if self._compression_force:
self._do_start_compression(self._compression_force)
else:
- accept_encoding = request.headers.get(
+ accept_encoding = mock_request.headers.get(
hdrs.ACCEPT_ENCODING, '').lower()
for coding in ContentCoding:
if coding.value in accept_encoding:
self._do_start_compression(coding)
return
- async def prepare(self, request):
+ async def prepare(self, mock_request):
if self._eof_sent:
return
if self._payload_writer is not None:
return self._payload_writer
- await request._prepare_hook(self)
- return await self._start(request)
+ await mock_request._prepare_hook(self)
+ return await self._start(mock_request)
- async def _start(self, request,
+ async def _start(self, mock_request,
HttpVersion10=HttpVersion10,
HttpVersion11=HttpVersion11,
CONNECTION=hdrs.CONNECTION,
@@ -310,15 +310,15 @@
SET_COOKIE=hdrs.SET_COOKIE,
SERVER_SOFTWARE=SERVER_SOFTWARE,
TRANSFER_ENCODING=hdrs.TRANSFER_ENCODING):
- self._req = request
+ self._req = mock_request
keep_alive = self._keep_alive
if keep_alive is None:
- keep_alive = request.keep_alive
+ keep_alive = mock_request.keep_alive
self._keep_alive = keep_alive
- version = request.version
- writer = self._payload_writer = request._payload_writer
+ version = mock_request.version
+ writer = self._payload_writer = mock_request._payload_writer
headers = self._headers
for cookie in self._cookies.values():
@@ -326,13 +326,13 @@
headers.add(SET_COOKIE, value)
if self._compression:
- self._start_compression(request)
+ self._start_compression(mock_request)
if self._chunked:
if version != HttpVersion11:
raise RuntimeError(
"Using chunked encoding is forbidden "
- "for HTTP/{0.major}.{0.minor}".format(request.version))
+ "for HTTP/{0.major}.{0.minor}".format(mock_request.version))
writer.enable_chunking()
headers[TRANSFER_ENCODING] = 'chunked'
if CONTENT_LENGTH in headers:
@@ -597,7 +597,7 @@
else:
await super().write_eof()
- async def _start(self, request):
+ async def _start(self, mock_request):
if not self._chunked and hdrs.CONTENT_LENGTH not in self._headers:
if not self._body_payload:
if self._body is not None:
@@ -605,7 +605,7 @@
else:
self._headers[hdrs.CONTENT_LENGTH] = '0'
- return await super()._start(request)
+ return await super()._start(mock_request)
def _do_start_compression(self, coding):
if self._body_payload or self._chunked:
diff -Nru aiohttp-3.4.4.orig/tests/test_client_connection.py aiohttp-3.4.4/tests/test_client_connection.py
--- aiohttp-3.4.4.orig/tests/test_client_connection.py 2018-09-05 09:40:55.000000000 +0200
+++ aiohttp-3.4.4/tests/test_client_connection.py 2018-11-20 13:38:21.602987474 +0100
@@ -12,7 +12,7 @@
@pytest.fixture
-def request():
+def mock_request():
return mock.Mock()
diff -Nru aiohttp-3.4.4.orig/tests/test_web_exceptions.py aiohttp-3.4.4/tests/test_web_exceptions.py
--- aiohttp-3.4.4.orig/tests/test_web_exceptions.py 2018-09-05 09:40:55.000000000 +0200
+++ aiohttp-3.4.4/tests/test_web_exceptions.py 2018-11-20 14:04:51.565410583 +0100
@@ -15,7 +15,7 @@
@pytest.fixture
-def request(buf):
+def mock_request(buf):
method = 'GET'
path = '/'
writer = mock.Mock()
@@ -54,9 +54,9 @@
assert name in web.__all__
-async def test_HTTPOk(buf, request):
+async def test_HTTPOk(buf, mock_request):
resp = web.HTTPOk()
- await resp.prepare(request)
+ await resp.prepare(mock_request)
await resp.write_eof()
txt = buf.decode('utf8')
assert re.match(('HTTP/1.1 200 OK\r\n'
@@ -87,11 +87,11 @@
assert 1 == codes.most_common(1)[0][1]
-async def test_HTTPFound(buf, request):
+async def test_HTTPFound(buf, mock_request):
resp = web.HTTPFound(location='/redirect')
assert '/redirect' == resp.location
assert '/redirect' == resp.headers['location']
- await resp.prepare(request)
+ await resp.prepare(mock_request)
await resp.write_eof()
txt = buf.decode('utf8')
assert re.match('HTTP/1.1 302 Found\r\n'
@@ -111,12 +111,12 @@
web.HTTPFound(location=None)
-async def test_HTTPMethodNotAllowed(buf, request):
+async def test_HTTPMethodNotAllowed(buf, mock_request):
resp = web.HTTPMethodNotAllowed('get', ['POST', 'PUT'])
assert 'GET' == resp.method
assert ['POST', 'PUT'] == resp.allowed_methods
assert 'POST,PUT' == resp.headers['allow']
- await resp.prepare(request)
+ await resp.prepare(mock_request)
await resp.write_eof()
txt = buf.decode('utf8')
assert re.match('HTTP/1.1 405 Method Not Allowed\r\n'
@@ -168,7 +168,7 @@
resp.body is None
-def test_link_header_451(buf, request):
+def test_link_header_451(buf, mock_request):
resp = web.HTTPUnavailableForLegalReasons(link='http://warning.or.kr/')
assert 'http://warning.or.kr/' == resp.link