Compare commits
4 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| e4a2e57573 | |||
| 0e34140a11 | |||
| 543f9a4c3d | |||
| 6ce6cc126f |
@@ -1,26 +0,0 @@
|
||||
From 89e66325b9dbad03554a649c42c46e752c4a7d5d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Diogo=20Magalh=C3=A3es=20Martins?=
|
||||
<magalhaesmartins@icloud.com>
|
||||
Date: Fri, 14 Jun 2019 08:27:37 -0300
|
||||
Subject: [PATCH] #215 - fixing exception message (#216)
|
||||
|
||||
---
|
||||
aiohttp_cors/urldispatcher_router_adapter.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/aiohttp_cors/urldispatcher_router_adapter.py b/aiohttp_cors/urldispatcher_router_adapter.py
|
||||
index 1a65e99..f2b02ab 100644
|
||||
--- a/aiohttp_cors/urldispatcher_router_adapter.py
|
||||
+++ b/aiohttp_cors/urldispatcher_router_adapter.py
|
||||
@@ -97,7 +97,7 @@ def _is_web_view(entity, strict=True):
|
||||
if not issubclass(handler, CorsViewMixin):
|
||||
if strict:
|
||||
raise ValueError("web view should be derived from "
|
||||
- "aiohttp_cors.WebViewMixig for working "
|
||||
+ "aiohttp_cors.CorsViewMixin for working "
|
||||
"with the library")
|
||||
else:
|
||||
return False
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
From eb4f5a4bb28f8260d4edc32969e838d9abace051 Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Svetlov <andrew.svetlov@gmail.com>
|
||||
Date: Mon, 15 Oct 2018 21:32:48 +0300
|
||||
Subject: [PATCH] Fix tests
|
||||
|
||||
---
|
||||
tests/integration/test_real_browser.py | 18 ++++++++----------
|
||||
tests/unit/test_cors_config.py | 5 ++---
|
||||
2 files changed, 10 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/tests/integration/test_real_browser.py b/tests/integration/test_real_browser.py
|
||||
index a5c9030..5dff79a 100644
|
||||
--- a/tests/integration/test_real_browser.py
|
||||
+++ b/tests/integration/test_real_browser.py
|
||||
@@ -193,22 +193,20 @@ class IntegrationServers:
|
||||
|
||||
# Start servers.
|
||||
for server_name, server_descr in self.servers.items():
|
||||
- handler = server_descr.app.make_handler()
|
||||
- server = await self.loop.create_server(
|
||||
- handler,
|
||||
- sock=server_sockets[server_name])
|
||||
- server_descr.handler = handler
|
||||
- server_descr.server = server
|
||||
+ runner = web.AppRunner(server_descr.app)
|
||||
+ await runner.setup()
|
||||
+ site = web.SockSite(runner, server_sockets[server_name])
|
||||
+ await site.start()
|
||||
+ server_descr.runner = runner
|
||||
|
||||
self._logger.info("Started server '%s' at '%s'",
|
||||
server_name, server_descr.url)
|
||||
|
||||
async def stop_servers(self):
|
||||
for server_descr in self.servers.values():
|
||||
- server_descr.server.close()
|
||||
- await server_descr.handler.shutdown()
|
||||
- await server_descr.server.wait_closed()
|
||||
- await server_descr.app.cleanup()
|
||||
+ runner = server_descr.runner
|
||||
+ await runner.shutdown()
|
||||
+ await runner.cleanup()
|
||||
|
||||
self.servers = {}
|
||||
|
||||
diff --git a/tests/unit/test_cors_config.py b/tests/unit/test_cors_config.py
|
||||
index 5b8d8f3..817410e 100644
|
||||
--- a/tests/unit/test_cors_config.py
|
||||
+++ b/tests/unit/test_cors_config.py
|
||||
@@ -58,11 +58,10 @@ def options_route(app):
|
||||
"OPTIONS", "/options_path", _handler)
|
||||
|
||||
|
||||
-def test_add_options_route(cors, options_route):
|
||||
+def test_add_options_route(app, cors, options_route):
|
||||
"""Test configuring OPTIONS route"""
|
||||
-
|
||||
with pytest.raises(ValueError,
|
||||
- match="/options_path already has OPTIONS handler"):
|
||||
+ match="already has OPTIONS handler"):
|
||||
cors.add(options_route.resource)
|
||||
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
||||
23
278.patch
23
278.patch
@@ -1,23 +0,0 @@
|
||||
From e64b95848f3253157d831f4934841fceeaf9b2e3 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
||||
Date: Thu, 14 Nov 2019 12:54:47 +0100
|
||||
Subject: [PATCH] Test instance type by isinstance, not issubclass
|
||||
|
||||
Fixes https://github.com/aio-libs/aiohttp-cors/issues/277
|
||||
---
|
||||
tests/unit/test_cors_config.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tests/unit/test_cors_config.py b/tests/unit/test_cors_config.py
|
||||
index 817410e..d494e20 100644
|
||||
--- a/tests/unit/test_cors_config.py
|
||||
+++ b/tests/unit/test_cors_config.py
|
||||
@@ -103,7 +103,7 @@ def test_static_resource(app, cors):
|
||||
"/file", "/", name="dynamic_named_route")
|
||||
assert len(app.router.keys()) == 1
|
||||
for resource in list(app.router.resources()):
|
||||
- if issubclass(resource, web.StaticResource):
|
||||
+ if isinstance(resource, web.StaticResource):
|
||||
cors.add(resource)
|
||||
assert len(app.router.keys()) == 1
|
||||
|
||||
27
412.patch
27
412.patch
@@ -1,27 +0,0 @@
|
||||
From 1eb2226aaf664d0be746753a32f82ee2e04c2f0b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
|
||||
Date: Tue, 1 Mar 2022 15:31:54 +0100
|
||||
Subject: [PATCH] Replace @asyncio.coroutine decorator with async def
|
||||
|
||||
In Python 3.11 @asyncio.coroutine decorator was removed and it should
|
||||
be replaced with async def call.
|
||||
|
||||
Fixes: #280
|
||||
---
|
||||
tests/unit/test_cors_config.py | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tests/unit/test_cors_config.py b/tests/unit/test_cors_config.py
|
||||
index 817410e..9fe1052 100644
|
||||
--- a/tests/unit/test_cors_config.py
|
||||
+++ b/tests/unit/test_cors_config.py
|
||||
@@ -29,8 +29,7 @@ async def _handler(request):
|
||||
|
||||
class _View(web.View, CorsViewMixin):
|
||||
|
||||
- @asyncio.coroutine
|
||||
- def get(self):
|
||||
+ async def get(self):
|
||||
return web.Response(text="Done")
|
||||
|
||||
|
||||
BIN
aiohttp-cors-0.7.0.tar.gz
LFS
BIN
aiohttp-cors-0.7.0.tar.gz
LFS
Binary file not shown.
3
aiohttp_cors-0.8.1.tar.gz
Normal file
3
aiohttp_cors-0.8.1.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ccacf9cb84b64939ea15f859a146af1f662a6b1d68175754a07315e305fb1403
|
||||
size 38626
|
||||
@@ -1,3 +1,20 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 11 04:47:19 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Update to 0.8.1:
|
||||
* Fix packaging to not install on Python 3.8.
|
||||
* Make the library compatible with aiohttp 3.9+ and Python 3.9+
|
||||
- Drop patches, merged upstream:
|
||||
* 0001-215-fixing-exception-message-216.patch
|
||||
* 0001-Fix-tests.patch
|
||||
* 278.patch
|
||||
* 412.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 13 05:35:04 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Switch to pyproject macros.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 1 09:24:04 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-aiohttp_cors
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC and contributors
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -18,37 +18,24 @@
|
||||
|
||||
%{?sle15_python_module_pythons}
|
||||
Name: python-aiohttp_cors
|
||||
Version: 0.7.0
|
||||
Version: 0.8.1
|
||||
Release: 0
|
||||
Summary: Asynchronous HTTP client/server framework
|
||||
License: Apache-2.0
|
||||
Group: Development/Languages/Python
|
||||
URL: https://github.com/aio-libs/aiohttp-cors
|
||||
Source: https://files.pythonhosted.org/packages/source/a/aiohttp-cors/aiohttp-cors-%{version}.tar.gz
|
||||
Patch0: 0001-Fix-tests.patch
|
||||
Patch1: 0001-215-fixing-exception-message-216.patch
|
||||
Patch2: 278.patch
|
||||
# PATCH-FIX-UPSTREAM 412.patch gh#aio-libs/aiohttp-cors#412
|
||||
Patch3: 412.patch
|
||||
Source: https://files.pythonhosted.org/packages/source/a/aiohttp-cors/aiohttp_cors-%{version}.tar.gz
|
||||
BuildRequires: %{python_module base >= 3.9}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-aiohttp >= 1.1
|
||||
Requires: python-async_timeout >= 2.0.0
|
||||
Requires: python-chardet
|
||||
Requires: python-multidict >= 3.3.0
|
||||
Requires: python-yarl >= 0.13.0
|
||||
Requires: python-aiohttp >= 3.9
|
||||
Suggests: %{name}-doc
|
||||
# SECTION test requirements
|
||||
BuildRequires: %{python_module aiohttp >= 1.1}
|
||||
BuildRequires: %{python_module async_timeout >= 2.0.0}
|
||||
BuildRequires: %{python_module chardet}
|
||||
BuildRequires: %{python_module gunicorn}
|
||||
BuildRequires: %{python_module multidict >= 3.3.0}
|
||||
BuildRequires: %{python_module pytest-mock}
|
||||
BuildRequires: %{python_module pytest-timeout}
|
||||
BuildRequires: %{python_module aiohttp >= 3.9}
|
||||
BuildRequires: %{python_module pytest-aiohttp >= 0.3.0}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module yarl >= 0.13.0}
|
||||
BuildArch: noarch
|
||||
%python_subpackages
|
||||
|
||||
@@ -60,24 +47,24 @@ Asynchronous HTTP client/server framework for Python.
|
||||
- Web-server has middleware and pluggable routing.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n aiohttp-cors-%{version}
|
||||
%autosetup -p1 -n aiohttp_cors-%{version}
|
||||
# remove code coverage flags from pytest
|
||||
sed -i '/addopts/d' setup.cfg
|
||||
|
||||
%build
|
||||
%python_build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%check
|
||||
%pytest tests/unit
|
||||
%pytest --asyncio-mode=auto tests/unit
|
||||
|
||||
%files %{python_files}
|
||||
%license LICENSE
|
||||
%doc CHANGES.rst README.rst
|
||||
%{python_sitelib}/aiohttp_cors
|
||||
%{python_sitelib}/aiohttp_cors-%{version}*-info
|
||||
%{python_sitelib}/aiohttp_cors-%{version}.dist-info
|
||||
|
||||
%changelog
|
||||
|
||||
Reference in New Issue
Block a user