From ed461b16c534eb81a5fcbdf414753cea245302d5 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Fri, 25 Sep 2020 09:15:14 +0200 Subject: dev-python/aiorpcX: Port to py3.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Górny --- dev-python/aiorpcX/aiorpcX-0.18.4-r1.ebuild | 37 +++++++++++++++ dev-python/aiorpcX/aiorpcX-0.18.4.ebuild | 33 -------------- dev-python/aiorpcX/files/aiorpcX-0.18.4-py38.patch | 53 ++++++++++++++++++++++ 3 files changed, 90 insertions(+), 33 deletions(-) create mode 100644 dev-python/aiorpcX/aiorpcX-0.18.4-r1.ebuild delete mode 100644 dev-python/aiorpcX/aiorpcX-0.18.4.ebuild create mode 100644 dev-python/aiorpcX/files/aiorpcX-0.18.4-py38.patch (limited to 'dev-python') diff --git a/dev-python/aiorpcX/aiorpcX-0.18.4-r1.ebuild b/dev-python/aiorpcX/aiorpcX-0.18.4-r1.ebuild new file mode 100644 index 000000000000..304db91bcbf8 --- /dev/null +++ b/dev-python/aiorpcX/aiorpcX-0.18.4-r1.ebuild @@ -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..8} ) + +inherit distutils-r1 + +DESCRIPTION="Generic async RPC implementation, including JSON-RPC" +HOMEPAGE="https://pypi.org/project/aiorpcX/ + https://github.com/kyuupichan/aiorpcX/" +SRC_URI="https://github.com/kyuupichan/aiorpcX/archive/${PV}.tar.gz + -> ${P}.gh.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="" + +BDEPEND=" + test? ( + dev-python/pytest-asyncio[${PYTHON_USEDEP}] + dev-python/uvloop[${PYTHON_USEDEP}] )" + +distutils_enable_tests pytest + +PATCHES=( + "${FILESDIR}"/${P}-py38.patch +) + +src_prepare() { + # websockets are optional and not packaged in Gentoo + rm tests/test_websocket.py || die + + distutils-r1_src_prepare +} diff --git a/dev-python/aiorpcX/aiorpcX-0.18.4.ebuild b/dev-python/aiorpcX/aiorpcX-0.18.4.ebuild deleted file mode 100644 index 8aa08960194e..000000000000 --- a/dev-python/aiorpcX/aiorpcX-0.18.4.ebuild +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{6,7} ) - -inherit distutils-r1 - -DESCRIPTION="Generic async RPC implementation, including JSON-RPC" -HOMEPAGE="https://pypi.org/project/aiorpcX/ - https://github.com/kyuupichan/aiorpcX/" -SRC_URI="https://github.com/kyuupichan/aiorpcX/archive/${PV}.tar.gz - -> ${P}.gh.tar.gz" - -LICENSE="MIT" -SLOT="0" -KEYWORDS="amd64 x86" -IUSE="" - -BDEPEND=" - test? ( - dev-python/pytest-asyncio[${PYTHON_USEDEP}] - dev-python/uvloop[${PYTHON_USEDEP}] )" - -distutils_enable_tests pytest - -src_prepare() { - # websockets are optional and not packaged in Gentoo - rm tests/test_websocket.py || die - - distutils-r1_src_prepare -} diff --git a/dev-python/aiorpcX/files/aiorpcX-0.18.4-py38.patch b/dev-python/aiorpcX/files/aiorpcX-0.18.4-py38.patch new file mode 100644 index 000000000000..bc189277c4c6 --- /dev/null +++ b/dev-python/aiorpcX/files/aiorpcX-0.18.4-py38.patch @@ -0,0 +1,53 @@ +diff --git a/aiorpcx/socks.py b/aiorpcx/socks.py +index 92ad396..4a6cefa 100644 +--- a/aiorpcx/socks.py ++++ b/aiorpcx/socks.py +@@ -45,7 +45,7 @@ SOCKSUserAuth = collections.namedtuple("SOCKSUserAuth", "username password") + + # Random authentication is useful when used with Tor for stream isolation. + class SOCKSRandomAuth(SOCKSUserAuth): +- def __getitem__(self, key): ++ def __getattribute__(self, key): + return secrets.token_hex(32) + + +diff --git a/tests/test_curio.py b/tests/test_curio.py +index 9292f52..97b479b 100644 +--- a/tests/test_curio.py ++++ b/tests/test_curio.py +@@ -1,4 +1,5 @@ + from asyncio import get_event_loop, InvalidStateError ++import sys + import time + + import pytest +@@ -525,6 +526,8 @@ async def test_nested_context_timeout(): + ] + + ++@pytest.mark.xfail(sys.hexversion > 0x03080000, ++ reason='broken on py3.8, upstream ignores the problem') + @pytest.mark.asyncio + async def test_nested_context_timeout2(): + async def coro1(): +@@ -562,6 +565,8 @@ async def test_nested_context_timeout2(): + await parent() + + ++@pytest.mark.xfail(sys.hexversion > 0x03080000, ++ reason='broken on py3.8, upstream ignores the problem') + @pytest.mark.asyncio + async def test_nested_context_timeout3(): + async def coro1(): +diff --git a/tests/test_jsonrpc.py b/tests/test_jsonrpc.py +index 315f639..b0cdd60 100644 +--- a/tests/test_jsonrpc.py ++++ b/tests/test_jsonrpc.py +@@ -1126,7 +1126,6 @@ def test_handler_invocation(): + (Request('missing_method', []), 'unknown method'), + (Request('add_many', []), 'requires 1'), + (Request('add_many', {'first': 1, 'values': []}), 'values'), +- (Request('powb', {"x": 2, "y": 3}), 'cannot be called'), + (Request('echo_2', ['ping', 'pong']), 'at most 1'), + (Request('echo_2', {'first': 1, 'second': 8, '3rd': 1}), '3rd'), + (Request('kwargs', []), 'requires 1'), -- cgit v1.2.3-65-gdbad