From bdcd1ba0cab23c57f5d926ff7d260f8d83d54ddc Mon Sep 17 00:00:00 2001 From: "Liguros - Gitlab CI/CD [develop]" Date: Fri, 13 May 2022 14:04:41 +0000 Subject: Adding metadata --- .../twisted/files/twisted-22.4.0-py311.patch | 55 ++++++++++++++++++++++ dev-python/twisted/twisted-22.4.0.ebuild | 38 +++++++++------ 2 files changed, 79 insertions(+), 14 deletions(-) create mode 100644 dev-python/twisted/files/twisted-22.4.0-py311.patch (limited to 'dev-python/twisted') diff --git a/dev-python/twisted/files/twisted-22.4.0-py311.patch b/dev-python/twisted/files/twisted-22.4.0-py311.patch new file mode 100644 index 000000000000..ed8ded87d4de --- /dev/null +++ b/dev-python/twisted/files/twisted-22.4.0-py311.patch @@ -0,0 +1,55 @@ +From 074fc742a699278ea5266b34aace1e34049b3de3 Mon Sep 17 00:00:00 2001 +From: Colin Watson +Date: Sat, 23 Apr 2022 22:29:07 +0100 +Subject: [PATCH] Implement twisted.python.failure._Code.co_positions + +This is needed for compatibility with Python 3.11. +--- + src/twisted/newsfragments/10336.bugfix | 1 + + src/twisted/python/failure.py | 5 ++++- + src/twisted/test/test_failure.py | 1 + + 3 files changed, 6 insertions(+), 1 deletion(-) + create mode 100644 src/twisted/newsfragments/10336.bugfix + +diff --git a/src/twisted/newsfragments/10336.bugfix b/src/twisted/newsfragments/10336.bugfix +new file mode 100644 +index 00000000000..a7ffab3627d +--- /dev/null ++++ b/src/twisted/newsfragments/10336.bugfix +@@ -0,0 +1 @@ ++Implement twisted.python.failure._Code.co_positions for compatibility with Python 3.11. +diff --git a/src/twisted/python/failure.py b/src/twisted/python/failure.py +index 6471e7bca59..c5a359e405b 100644 +--- a/src/twisted/python/failure.py ++++ b/src/twisted/python/failure.py +@@ -130,7 +130,7 @@ def _Traceback(stackFrames, tbFrames): + + + # The set of attributes for _TracebackFrame, _Frame and _Code were taken from +-# https://docs.python.org/3.10/library/inspect.html Other Pythons may have a ++# https://docs.python.org/3.11/library/inspect.html Other Pythons may have a + # few more attributes that should be added if needed. + class _TracebackFrame: + """ +@@ -202,6 +202,9 @@ def __init__(self, name, filename): + self.co_nlocals = 0 + self.co_stacksize = 0 + ++ def co_positions(self): ++ return ((None, None, None, None),) ++ + + _inlineCallbacksExtraneous = [] + +diff --git a/src/twisted/test/test_failure.py b/src/twisted/test/test_failure.py +index 6dd7c682bf9..6fd82c868ec 100644 +--- a/src/twisted/test/test_failure.py ++++ b/src/twisted/test/test_failure.py +@@ -825,6 +825,7 @@ def test_fakeCodeAttributes(self): + self.assertIsInstance(code.co_nlocals, int) + self.assertIsInstance(code.co_stacksize, int) + self.assertIsInstance(code.co_varnames, list) ++ self.assertIsInstance(code.co_positions(), tuple) + + def test_fakeTracebackFrame(self): + """ diff --git a/dev-python/twisted/twisted-22.4.0.ebuild b/dev-python/twisted/twisted-22.4.0.ebuild index ec13541f8ff0..48578954c45c 100644 --- a/dev-python/twisted/twisted-22.4.0.ebuild +++ b/dev-python/twisted/twisted-22.4.0.ebuild @@ -54,28 +54,32 @@ RDEPEND=" BDEPEND=" >=dev-python/incremental-21.3.0[${PYTHON_USEDEP}] test? ( - >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}] - dev-python/bcrypt[${PYTHON_USEDEP}] - >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}] - dev-python/cython-test-exception-raiser[${PYTHON_USEDEP}] - dev-python/idna[${PYTHON_USEDEP}] - dev-python/pyasn1[${PYTHON_USEDEP}] - dev-python/pyserial[${PYTHON_USEDEP}] - net-misc/openssh + $(python_gen_cond_dep ' + >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}] + dev-python/bcrypt[${PYTHON_USEDEP}] + >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}] + dev-python/cython-test-exception-raiser[${PYTHON_USEDEP}] + dev-python/idna[${PYTHON_USEDEP}] + dev-python/pyasn1[${PYTHON_USEDEP}] + dev-python/pyserial[${PYTHON_USEDEP}] + net-misc/openssh + !alpha? ( !hppa? ( !ia64? ( + >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}] + >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}] + dev-python/service_identity[${PYTHON_USEDEP}] + ) ) ) + ' python3_{8..10} pypy3) $(python_gen_cond_dep ' dev-python/gmpy[${PYTHON_USEDEP}] - ' 'python*') - !alpha? ( !hppa? ( !ia64? ( - >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}] - >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}] - dev-python/service_identity[${PYTHON_USEDEP}] - ) ) ) + ' python3_{8..10}) ) " PATCHES=( # https://twistedmatrix.com/trac/ticket/10200 "${FILESDIR}/${PN}-22.1.0-force-gtk3.patch" + # https://github.com/twisted/twisted/pull/1723 + "${FILESDIR}/${P}-py311.patch" ) python_prepare_all() { @@ -114,6 +118,12 @@ src_test() { } python_test() { + # please keep in sync with python_gen_cond_dep! + if ! has "${EPYTHON}" python3_{8..10} pypy3; then + einfo "Skipping tests on ${EPYTHON} (xfail)" + return + fi + "${EPYTHON}" -m twisted.trial twisted || die "Tests failed with ${EPYTHON}" } -- cgit v1.3