diff options
author | Michał Górny <mgorny@gentoo.org> | 2022-05-22 20:44:20 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2022-05-23 06:54:59 +0200 |
commit | f4b265b211168f2e33f3fc49a05b58e89b18744d (patch) | |
tree | 23626007e86cc679751578bf7813ba1ff0e39d48 /dev-python/cherrypy | |
parent | sci-libs/trilinos: ebuild maintenance (diff) | |
download | gentoo-f4b265b211168f2e33f3fc49a05b58e89b18744d.tar.gz gentoo-f4b265b211168f2e33f3fc49a05b58e89b18744d.tar.bz2 gentoo-f4b265b211168f2e33f3fc49a05b58e89b18744d.zip |
dev-python/cherrypy: Enable py3.11
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/cherrypy')
-rw-r--r-- | dev-python/cherrypy/cherrypy-18.6.1-r1.ebuild | 14 | ||||
-rw-r--r-- | dev-python/cherrypy/files/cherrypy-18.6.1-py311.patch | 32 |
2 files changed, 45 insertions, 1 deletions
diff --git a/dev-python/cherrypy/cherrypy-18.6.1-r1.ebuild b/dev-python/cherrypy/cherrypy-18.6.1-r1.ebuild index 85965bd7d707..ddcd4181ee8c 100644 --- a/dev-python/cherrypy/cherrypy-18.6.1-r1.ebuild +++ b/dev-python/cherrypy/cherrypy-18.6.1-r1.ebuild @@ -4,7 +4,7 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{8..10} pypy3 ) +PYTHON_COMPAT=( python3_{8..11} pypy3 ) inherit distutils-r1 @@ -52,6 +52,7 @@ python_prepare_all() { local PATCHES=( # https://github.com/cherrypy/cherrypy/pull/1946 "${FILESDIR}"/${P}-close-files.patch + "${FILESDIR}"/${P}-py311.patch ) sed -r -e '/(pytest-sugar|pytest-cov)/ d' \ @@ -64,3 +65,14 @@ python_prepare_all() { distutils-r1_python_prepare_all } + +python_test() { + local EPYTEST_DESELECT=() + [[ ${EPYTHON} == python3.11 ]] && EPYTEST_DESELECT+=( + # broken by changes in traceback output + cherrypy/test/test_request_obj.py::RequestObjectTests::testErrorHandling + cherrypy/test/test_tools.py::ToolTests::testHookErrors + ) + + epytest +} diff --git a/dev-python/cherrypy/files/cherrypy-18.6.1-py311.patch b/dev-python/cherrypy/files/cherrypy-18.6.1-py311.patch new file mode 100644 index 000000000000..5d629dd8c333 --- /dev/null +++ b/dev-python/cherrypy/files/cherrypy-18.6.1-py311.patch @@ -0,0 +1,32 @@ +From 8245a74aa4e090c40445535a9ce3997ed9904798 Mon Sep 17 00:00:00 2001 +From: Dominic Davis-Foster <dominic@davis-foster.co.uk> +Date: Fri, 28 Jan 2022 23:11:52 +0000 +Subject: [PATCH] Switch from inspect.getargspec to inspect.getfullargspec + +inspect.getargspec has been deprecated since 3.0 +--- + cherrypy/_cpdispatch.py | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/cherrypy/_cpdispatch.py b/cherrypy/_cpdispatch.py +index 83eb79cb..5c506e99 100644 +--- a/cherrypy/_cpdispatch.py ++++ b/cherrypy/_cpdispatch.py +@@ -206,12 +206,8 @@ except ImportError: + def test_callable_spec(callable, args, kwargs): # noqa: F811 + return None + else: +- getargspec = inspect.getargspec +- # Python 3 requires using getfullargspec if +- # keyword-only arguments are present +- if hasattr(inspect, 'getfullargspec'): +- def getargspec(callable): +- return inspect.getfullargspec(callable)[:4] ++ def getargspec(callable): ++ return inspect.getfullargspec(callable)[:4] + + + class LateParamPageHandler(PageHandler): +-- +2.35.1 + |