From f65711168e51b6adbeae5172f826a2e8f7a527522440222f5fc2fc78032931b8 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 11 Aug 2025 04:48:59 +0000 Subject: [PATCH] - 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 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-aiohttp_cors?expand=0&rev=14 --- 0001-215-fixing-exception-message-216.patch | 26 -------- 0001-Fix-tests.patch | 66 --------------------- 278.patch | 23 ------- 412.patch | 27 --------- aiohttp-cors-0.7.0.tar.gz | 3 - aiohttp_cors-0.8.1.tar.gz | 3 + python-aiohttp_cors.changes | 12 ++++ python-aiohttp_cors.spec | 33 +++-------- 8 files changed, 24 insertions(+), 169 deletions(-) delete mode 100644 0001-215-fixing-exception-message-216.patch delete mode 100644 0001-Fix-tests.patch delete mode 100644 278.patch delete mode 100644 412.patch delete mode 100644 aiohttp-cors-0.7.0.tar.gz create mode 100644 aiohttp_cors-0.8.1.tar.gz diff --git a/0001-215-fixing-exception-message-216.patch b/0001-215-fixing-exception-message-216.patch deleted file mode 100644 index 552702d..0000000 --- a/0001-215-fixing-exception-message-216.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 89e66325b9dbad03554a649c42c46e752c4a7d5d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Diogo=20Magalh=C3=A3es=20Martins?= - -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 - diff --git a/0001-Fix-tests.patch b/0001-Fix-tests.patch deleted file mode 100644 index 2fde04e..0000000 --- a/0001-Fix-tests.patch +++ /dev/null @@ -1,66 +0,0 @@ -From eb4f5a4bb28f8260d4edc32969e838d9abace051 Mon Sep 17 00:00:00 2001 -From: Andrew Svetlov -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 - diff --git a/278.patch b/278.patch deleted file mode 100644 index fa821c3..0000000 --- a/278.patch +++ /dev/null @@ -1,23 +0,0 @@ -From e64b95848f3253157d831f4934841fceeaf9b2e3 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -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 - diff --git a/412.patch b/412.patch deleted file mode 100644 index 1c6da0e..0000000 --- a/412.patch +++ /dev/null @@ -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?= -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") - - diff --git a/aiohttp-cors-0.7.0.tar.gz b/aiohttp-cors-0.7.0.tar.gz deleted file mode 100644 index 46e7fcf..0000000 --- a/aiohttp-cors-0.7.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4d39c6d7100fd9764ed1caf8cebf0eb01bf5e3f24e2e073fda6234bc48b19f5d -size 35966 diff --git a/aiohttp_cors-0.8.1.tar.gz b/aiohttp_cors-0.8.1.tar.gz new file mode 100644 index 0000000..71ee47e --- /dev/null +++ b/aiohttp_cors-0.8.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ccacf9cb84b64939ea15f859a146af1f662a6b1d68175754a07315e305fb1403 +size 38626 diff --git a/python-aiohttp_cors.changes b/python-aiohttp_cors.changes index ad37c9c..6d932c3 100644 --- a/python-aiohttp_cors.changes +++ b/python-aiohttp_cors.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Mon Aug 11 04:47:19 UTC 2025 - Steve Kowalik + +- 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 diff --git a/python-aiohttp_cors.spec b/python-aiohttp_cors.spec index d0e5bdc..156d743 100644 --- a/python-aiohttp_cors.spec +++ b/python-aiohttp_cors.spec @@ -1,7 +1,7 @@ # # spec file for package python-aiohttp_cors # -# Copyright (c) 2025 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,39 +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 @@ -62,7 +47,7 @@ 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 @@ -74,7 +59,7 @@ sed -i '/addopts/d' setup.cfg %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%pytest tests/unit +%pytest --asyncio-mode=auto tests/unit %files %{python_files} %license LICENSE