dev-python/aspectlib: bump EAPI and PYTHON_COMPAT

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Alfred Wingate <parona@protonmail.com>
This commit is contained in:
Alfred Wingate 2021-06-30 00:01:28 +03:00
parent 0de51dc05e
commit 4b9f8bc8d5
No known key found for this signature in database
GPG Key ID: A12750536B5E7010
2 changed files with 74 additions and 3 deletions

View File

@ -1,9 +1,9 @@
# Copyright 2021 Gentoo Authors # Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
EAPI=7 EAPI=8
PYTHON_COMPAT=( python3_{8..9} ) PYTHON_COMPAT=( python3_{8..10} )
inherit distutils-r1 inherit distutils-r1
DESCRIPTION="An aspect-oriented programming, monkey-patch and decorators library." DESCRIPTION="An aspect-oriented programming, monkey-patch and decorators library."
@ -31,7 +31,10 @@ BDEPEND="
distutils_enable_tests pytest distutils_enable_tests pytest
PATCHES=( "${FILESDIR}/Remove-tornado-6-test-constraint.patch" ) PATCHES=(
"${FILESDIR}/Fix-tests-for-python3_10.patch"
"${FILESDIR}/Remove-tornado-6-test-constraint.patch"
)
python_compile_all() { python_compile_all() {
if use doc; then if use doc; then

View File

@ -0,0 +1,68 @@
diff --git a/src/aspectlib/__init__.py b/src/aspectlib/__init__.py
index b85f1dd..b7d0f70 100644
--- a/src/aspectlib/__init__.py
+++ b/src/aspectlib/__init__.py
@@ -18,6 +18,7 @@ from logging import getLogger
from .utils import PY2
from .utils import PY3
from .utils import PY37plus
+from .utils import PY310
from .utils import Sentinel
from .utils import basestring
from .utils import force_bind
diff --git a/src/aspectlib/utils.py b/src/aspectlib/utils.py
index 9e0837e..b08f2d6 100644
--- a/src/aspectlib/utils.py
+++ b/src/aspectlib/utils.py
@@ -13,6 +13,7 @@ RegexType = type(re.compile(""))
PY3 = sys.version_info[0] == 3
PY37plus = PY3 and sys.version_info[1] >= 7
+PY310 = PY3 and sys.version_info[1] == 10
PY2 = sys.version_info[0] == 2
PY26 = PY2 and sys.version_info[1] == 6
PYPY = platform.python_implementation() == 'PyPy'
diff --git a/tests/test_aspectlib_test.py b/tests/test_aspectlib_test.py
index 05e2c25..37fe8e8 100644
--- a/tests/test_aspectlib_test.py
+++ b/tests/test_aspectlib_test.py
@@ -4,6 +4,7 @@ from pytest import raises
from test_pkg1.test_pkg2 import test_mod
from aspectlib import PY2
+from aspectlib import PY310
from aspectlib.test import OrderedDict
from aspectlib.test import Story
from aspectlib.test import StoryResultWrapper
@@ -414,6 +415,7 @@ def test_story_empty_play_proxy_class():
(('stuff_1', 'mix', "'a', 'b'", ''), _Returns("(1, 2, 'a', 'b')")),
(('stuff_1', 'meth', "123", ''), _Raises(repr_ex(TypeError(
'meth() takes exactly 1 argument (2 given)' if PY2 else
+ 'Stuff.meth() takes 1 positional argument but 2 were given' if PY310 else
'meth() takes 1 positional argument but 2 were given'
)))),
((None, 'test_pkg1.test_pkg2.test_mod.Stuff', "0, 1", ''), _Binds('stuff_2')),
@@ -421,6 +423,7 @@ def test_story_empty_play_proxy_class():
(('stuff_2', 'mix', "3, 4", ''), _Returns("(0, 1, 3, 4)")),
(('stuff_2', 'meth', "123", ''), _Raises(repr_ex(TypeError(
'meth() takes exactly 1 argument (2 given)' if PY2 else
+ 'Stuff.meth() takes 1 positional argument but 2 were given' if PY310 else
'meth() takes 1 positional argument but 2 were given'
))))
]))
@@ -449,6 +452,7 @@ def test_story_half_play_proxy_class():
(('stuff_1', 'meth', '', ''), _Returns('None')),
(('stuff_1', 'meth', '123', ''), _Raises(repr_ex(TypeError(
'meth() takes exactly 1 argument (2 given)' if PY2 else
+ 'Stuff.meth() takes 1 positional argument but 2 were given' if PY310 else
'meth() takes 1 positional argument but 2 were given'
)))),
((None, 'test_pkg1.test_pkg2.test_mod.Stuff', '0, 1', ''), _Binds("stuff_2")),
@@ -456,6 +460,7 @@ def test_story_half_play_proxy_class():
(('stuff_2', 'mix', '3, 4', ''), _Returns('(0, 1, 3, 4)')),
(('stuff_2', 'meth', '123', ''), _Raises(repr_ex(TypeError(
'meth() takes exactly 1 argument (2 given)' if PY2 else
+ 'Stuff.meth() takes 1 positional argument but 2 were given' if PY310 else
'meth() takes 1 positional argument but 2 were given'
))))
]))