dev-python/aiohttp-cors: Revision for python 3.7 support
authorGino McCarty <onigino@protonmail.com>
Mon, 20 Apr 2020 02:00:20 +0000 (19:00 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 4 May 2020 02:33:49 +0000 (19:33 -0700)
Bug: https://bugs.gentoo.org/712964
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Gino McCarty <onigino@protonmail.com>
Signed-off-by: Zac Medico <zmedico@gentoo.org>
dev-python/aiohttp-cors/aiohttp-cors-0.7.0-r1.ebuild [new file with mode: 0644]
dev-python/aiohttp-cors/files/aiohttp-cors-0.7.0-py3_7.patch [new file with mode: 0644]
dev-python/aiohttp-cors/metadata.xml
profiles/package.mask

diff --git a/dev-python/aiohttp-cors/aiohttp-cors-0.7.0-r1.ebuild b/dev-python/aiohttp-cors/aiohttp-cors-0.7.0-r1.ebuild
new file mode 100644 (file)
index 0000000..eded3a0
--- /dev/null
@@ -0,0 +1,37 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7,8} )
+
+inherit distutils-r1
+
+DESCRIPTION="Implements CORS support for aiohttp asyncio-powered asynchronous HTTP server"
+HOMEPAGE="https://github.com/aio-libs/aiohttp-cors"
+SRC_URI="https://github.com/aio-libs/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND=">=dev-python/aiohttp-1.1.1[${PYTHON_USEDEP}]"
+BDEPEND="
+       test? (
+               dev-python/pytest-aiohttp[${PYTHON_USEDEP}]
+               dev-python/selenium[${PYTHON_USEDEP}]
+       )"
+
+distutils_enable_tests pytest
+
+# https://github.com/aio-libs/aiohttp-cors/pull/278
+PATCHES=(
+       "${FILESDIR}/${P}-tests.patch"
+       "${FILESDIR}/${P}-py3_7.patch"
+)
+
+src_prepare() {
+       sed -i -e '/^addopts=/d' setup.cfg || die
+       echo "    ignore::DeprecationWarning" >> pytest.ini
+       distutils-r1_src_prepare
+}
diff --git a/dev-python/aiohttp-cors/files/aiohttp-cors-0.7.0-py3_7.patch b/dev-python/aiohttp-cors/files/aiohttp-cors-0.7.0-py3_7.patch
new file mode 100644 (file)
index 0000000..9a46108
--- /dev/null
@@ -0,0 +1,23 @@
+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
+
+https://github.com/aio-libs/aiohttp-cors/pull/278
+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
index 90e51cd48781291a935bddf4c3d8614fc167a97a..a00e54b3e81fc7e8c11db6ae7b4a9c6caf34db94 100644 (file)
@@ -1,7 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-       <!-- maintainer-needed -->
+       <maintainer type="person">
+               <email>onigino@protonmail.com</email>
+               <name>Gino McCarty</name>
+       </maintainer>
+       <maintainer type="project">
+               <email>proxy-maint@gentoo.org</email>
+               <name>Proxy Maintainers</name>
+       </maintainer>
        <upstream>
                <remote-id type="github">aio-libs/aiohttp-cors</remote-id>
        </upstream>
index 8fd5df9b721f8cd5e9311736808a9fa69853f21e..2a8609c0e3e42ae84157a3d41c554375c93c9609 100644 (file)
@@ -837,7 +837,6 @@ dev-java/icedtea-web
 # that's pending for a long time (bug #688016) but not aiohttp-cors dep.
 #
 # Removal in 30 days.  Bug #712964.
-dev-python/aiohttp-cors
 net-misc/gns3-converter
 net-misc/gns3-gui
 net-misc/gns3-server