diff options
Diffstat (limited to 'dev-python/twisted')
-rw-r--r-- | dev-python/twisted/Manifest | 2 | ||||
-rw-r--r-- | dev-python/twisted/files/twisted-22.1.0-force-gtk3.patch | 67 | ||||
-rw-r--r-- | dev-python/twisted/files/twisted-22.4.0-py311.patch | 55 | ||||
-rw-r--r-- | dev-python/twisted/metadata.xml | 6 | ||||
-rw-r--r-- | dev-python/twisted/twisted-24.3.0.ebuild (renamed from dev-python/twisted/twisted-22.4.0-r2.ebuild) | 104 |
5 files changed, 46 insertions, 188 deletions
diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest index a09e09f8b963..437756ad44fa 100644 --- a/dev-python/twisted/Manifest +++ b/dev-python/twisted/Manifest @@ -1,2 +1,2 @@ -DIST twisted-22.4.0.tar.gz 3896724 BLAKE2B 830a724156473a28394e6c731f6cec184c491410dc880bc2e37a99cb460c7fe040219463f224941532b12478abe953aa0228c70676e5baecda4a3b2bdd6a0a32 SHA512 776d36040bcefb9ca65e471d9058fe1067ffc8171a501cb451e9d4824a88dd83f79dc9b27a127ca898451587454ee661000acbce6c4c39b069aeadd64710f103 +DIST twisted-24.3.0.tar.gz 3500456 BLAKE2B b2cebb2f3482dbeba250786b1977ddbb09e1a9a81f71ce5906efe8289b0e134a8b26c191c2262e8ee8ba3fccccea508c34145016b29ecf301541134dcea19e08 SHA512 c3dd227f5936ffa586a0b7447f5df4c2257dce0c0ba740373d82197a72029e7eeb0aef9789247dde73e2f24dd043f3b0b7d795f16e6e908583b054aad9b9eb6a DIST twisted-regen-cache.gz 911 BLAKE2B ffd3fcda6c67ffe6fd3ef581c8d507548396b66ed0708e9a5c790095e579c0d5f0f71596acf05712989da2ddef2b8d437eca973bc4d80ef8a9fa852915f38305 SHA512 95a9b931c73017d16d1b5e6b41345dddffe62b6af1a8e93b5e40d06d3d15be17b0dd0181c767ffeeb791534d463764ef9e066fa6c2ee2ac4b53c86d1da8fce03 diff --git a/dev-python/twisted/files/twisted-22.1.0-force-gtk3.patch b/dev-python/twisted/files/twisted-22.1.0-force-gtk3.patch deleted file mode 100644 index 7c9f2d558d65..000000000000 --- a/dev-python/twisted/files/twisted-22.1.0-force-gtk3.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 9344f8cd80ecb2907dbfddfeeb8cc9ffdb50bc94 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> -Date: Sat, 22 May 2021 01:11:48 +0200 -Subject: [PATCH] Force using GTK+3 in twisted.internet.gireactor - -Modify twisted.internet.gireactor to explicitly request GTK+ version 3. -Otherwise it uses the newest version installed which could be GTK+4 -that gireactor is currently incompatible with. ---- - src/twisted/internet/gireactor.py | 3 +++ - src/twisted/internet/test/test_gireactor.py | 3 +++ - src/twisted/newsfragments/10200.bugfix | 1 + - 3 files changed, 7 insertions(+) - create mode 100644 src/twisted/newsfragments/10200.bugfix - -diff --git a/src/twisted/internet/gireactor.py b/src/twisted/internet/gireactor.py -index e2d24b599..838fa982e 100644 ---- a/src/twisted/internet/gireactor.py -+++ b/src/twisted/internet/gireactor.py -@@ -21,6 +21,7 @@ On Python 3, pygobject v3.4 or later is required. - """ - - -+import gi # type: ignore[import] - import gi.pygtkcompat # type: ignore[import] - from gi.repository import GLib # type: ignore[import] - -@@ -69,6 +70,7 @@ class GIReactor(_glibbase.GlibReactorBase): - def __init__(self, useGtk=False): - _gtk = None - if useGtk is True: -+ gi.require_version("Gtk", "3.0") - from gi.repository import Gtk as _gtk - - _glibbase.GlibReactorBase.__init__(self, GLib, _gtk, useGtk=useGtk) -@@ -113,6 +115,7 @@ class PortableGIReactor(_glibbase.PortableGlibReactorBase): - def __init__(self, useGtk=False): - _gtk = None - if useGtk is True: -+ gi.require_version("Gtk", "3.0") - from gi.repository import Gtk as _gtk - - _glibbase.PortableGlibReactorBase.__init__(self, GLib, _gtk, useGtk=useGtk) -diff --git a/src/twisted/internet/test/test_gireactor.py b/src/twisted/internet/test/test_gireactor.py -index c25ada63f..3bb88a07f 100644 ---- a/src/twisted/internet/test/test_gireactor.py -+++ b/src/twisted/internet/test/test_gireactor.py -@@ -26,6 +26,9 @@ else: - gtk3reactor = None - else: - gtk3reactor = _gtk3reactor -+ import gi # type: ignore[import] -+ -+ gi.require_version("Gtk", "3.0") - from gi.repository import Gtk - - from twisted.internet.error import ReactorAlreadyRunning -diff --git a/src/twisted/newsfragments/10200.bugfix b/src/twisted/newsfragments/10200.bugfix -new file mode 100644 -index 000000000..7afb343be ---- /dev/null -+++ b/src/twisted/newsfragments/10200.bugfix -@@ -0,0 +1 @@ -+twisted.internet.gireactor was fixed to force GTK+3 in order to fix use of incompatible GTK+4 API when installed --- -2.35.1 - diff --git a/dev-python/twisted/files/twisted-22.4.0-py311.patch b/dev-python/twisted/files/twisted-22.4.0-py311.patch deleted file mode 100644 index ed8ded87d4de..000000000000 --- a/dev-python/twisted/files/twisted-22.4.0-py311.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 074fc742a699278ea5266b34aace1e34049b3de3 Mon Sep 17 00:00:00 2001 -From: Colin Watson <cjwatson@canonical.com> -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/metadata.xml b/dev-python/twisted/metadata.xml index 1b215147691e..5fb905aee3f7 100644 --- a/dev-python/twisted/metadata.xml +++ b/dev-python/twisted/metadata.xml @@ -6,15 +6,11 @@ <name>Python</name> </maintainer> <upstream> - <maintainer> - <email>twisted-python@twistedmatrix.com</email> - <name>Twisted Matrix Laboratories</name> - </maintainer> <remote-id type="pypi">Twisted</remote-id> + <remote-id type="github">twisted/twisted</remote-id> </upstream> <use> <flag name="conch">include Twisted SSHv2 implementation</flag> - <flag name="http2">include http2 support</flag> <flag name="serial">include serial port support</flag> </use> <longdescription>Twisted is an event-based framework for internet diff --git a/dev-python/twisted/twisted-22.4.0-r2.ebuild b/dev-python/twisted/twisted-24.3.0.ebuild index 5acedaa99e6a..2d913b858d7d 100644 --- a/dev-python/twisted/twisted-22.4.0-r2.ebuild +++ b/dev-python/twisted/twisted-24.3.0.ebuild @@ -1,99 +1,90 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{8..11} pypy3 ) +DISTUTILS_USE_PEP517=hatchling +PYTHON_TESTED=( python3_{10..12} pypy3 ) +PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" ) PYTHON_REQ_USE="threads(+)" -inherit distutils-r1 virtualx +inherit distutils-r1 pypi virtualx DESCRIPTION="An asynchronous networking framework written in Python" -HOMEPAGE="https://www.twistedmatrix.com/trac/" -SRC_URI=" - https://github.com/twisted/twisted/archive/${P}.tar.gz +HOMEPAGE=" + https://twisted.org/ + https://github.com/twisted/twisted/ + https://pypi.org/project/Twisted/ +" +SRC_URI+=" https://dev.gentoo.org/~mgorny/dist/twisted-regen-cache.gz " -S=${WORKDIR}/${PN}-${P} LICENSE="MIT" SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ppc ppc64 ~riscv ~s390 sparc x86" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~arm64-macos ~x64-macos" IUSE="conch http2 serial ssl test" RESTRICT="!test? ( test )" RDEPEND=" >=dev-python/attrs-19.2.0[${PYTHON_USEDEP}] - >=dev-python/automat-0.3.0[${PYTHON_USEDEP}] - >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}] + >=dev-python/automat-0.8.0[${PYTHON_USEDEP}] + >=dev-python/constantly-15.1[${PYTHON_USEDEP}] >=dev-python/hyperlink-17.1.1[${PYTHON_USEDEP}] - >=dev-python/incremental-21.3.0[${PYTHON_USEDEP}] - >=dev-python/pyhamcrest-1.9.0[${PYTHON_USEDEP}] - >=dev-python/typing-extensions-3.6.5[${PYTHON_USEDEP}] - >=dev-python/zope-interface-4.4.2[${PYTHON_USEDEP}] + >=dev-python/incremental-22.10.0[${PYTHON_USEDEP}] + >=dev-python/typing-extensions-4.2.0[${PYTHON_USEDEP}] + >=dev-python/zope-interface-5[${PYTHON_USEDEP}] conch? ( >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}] - dev-python/bcrypt[${PYTHON_USEDEP}] - >=dev-python/cryptography-1.5.0[${PYTHON_USEDEP}] + >=dev-python/bcrypt-3.0.0[${PYTHON_USEDEP}] + >=dev-python/cryptography-3.3[${PYTHON_USEDEP}] dev-python/pyasn1[${PYTHON_USEDEP}] ) http2? ( + <dev-python/h2-5.0[${PYTHON_USEDEP}] >=dev-python/h2-3.0.0[${PYTHON_USEDEP}] - <dev-python/h2-5.0.0[${PYTHON_USEDEP}] - >=dev-python/priority-1.1.0[${PYTHON_USEDEP}] <dev-python/priority-2.0[${PYTHON_USEDEP}] + >=dev-python/priority-1.1.0[${PYTHON_USEDEP}] + ) + serial? ( + >=dev-python/pyserial-3.0[${PYTHON_USEDEP}] ) - serial? ( >=dev-python/pyserial-3.0[${PYTHON_USEDEP}] ) ssl? ( - >=dev-python/pyopenssl-16.0.0[${PYTHON_USEDEP}] - dev-python/service_identity[${PYTHON_USEDEP}] - >=dev-python/idna-0.6[${PYTHON_USEDEP}] + >=dev-python/pyopenssl-21.0.0[${PYTHON_USEDEP}] + >=dev-python/service-identity-18.1.0[${PYTHON_USEDEP}] + >=dev-python/idna-2.4[${PYTHON_USEDEP}] ) " BDEPEND=" - >=dev-python/incremental-21.3.0[${PYTHON_USEDEP}] + >=dev-python/hatch-fancy-pypi-readme-22.5.0[${PYTHON_USEDEP}] + >=dev-python/incremental-22.10.0[${PYTHON_USEDEP}] test? ( + ${RDEPEND} $(python_gen_cond_dep ' >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}] + >=dev-python/bcrypt-3.0.0[${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/cython-test-exception-raiser-2[${PYTHON_USEDEP}] + >=dev-python/cython-test-exception-raiser-1.0.2[${PYTHON_USEDEP}] + >=dev-python/idna-2.4[${PYTHON_USEDEP}] + >=dev-python/hypothesis-6.56[${PYTHON_USEDEP}] dev-python/pyasn1[${PYTHON_USEDEP}] - dev-python/pyserial[${PYTHON_USEDEP}] - net-misc/openssh - conch? ( - dev-python/bcrypt[${PYTHON_USEDEP}] - >=dev-python/cryptography-1.5.0[${PYTHON_USEDEP}] - ) + >=dev-python/pyhamcrest-2[${PYTHON_USEDEP}] + >=dev-python/pyserial-3.0[${PYTHON_USEDEP}] + virtual/openssh ssl? ( - >=dev-python/pyopenssl-16.0.0[${PYTHON_USEDEP}] - dev-python/service_identity[${PYTHON_USEDEP}] + >=dev-python/pyopenssl-21.0.0[${PYTHON_USEDEP}] + >=dev-python/service-identity-18.1.0[${PYTHON_USEDEP}] ) - ' python3_{8..10} pypy3) - $(python_gen_cond_dep ' - dev-python/gmpy[${PYTHON_USEDEP}] - ' python3_{8..10}) + ' "${PYTHON_TESTED[@]}") ) " -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() { # upstream test for making releases; not very useful and requires # sphinx (including on py2) rm src/twisted/python/test/test_release.py || die - # puts system in EMFILE state, then the exception handler may fail - # trying to open more files due to some gi magic - sed -e '/SKIP_EMFILE/s:False:True:' \ - -i src/twisted/internet/test/test_tcp.py || die - # multicast tests fail within network-sandbox sed -e 's:test_joinLeave:_&:' \ -e 's:test_loopback:_&:' \ @@ -101,14 +92,6 @@ python_prepare_all() { -e 's:test_multicast:_&:' \ -i src/twisted/test/test_udp.py || die - # These tests rely on warnings which seems work unreliably between python versions - sed -e 's:test_currentEUID:_&:' \ - -e 's:test_currentUID:_&:' -i src/twisted/python/test/test_util.py || die - - # broken by new expat - sed -e 's:test_namespaceWithWhitespace:_&:' \ - -i src/twisted/words/test/test_domish.py || die - distutils-r1_python_prepare_all } @@ -120,12 +103,13 @@ src_test() { } python_test() { - # please keep in sync with python_gen_cond_dep! - if ! has "${EPYTHON}" python3_{8..10} pypy3; then + if ! has "${EPYTHON}" "${PYTHON_TESTED[@]/_/.}"; then einfo "Skipping tests on ${EPYTHON} (xfail)" return fi + # breaks some tests by overriding empty environment + local -x SANDBOX_ON=0 "${EPYTHON}" -m twisted.trial twisted || die "Tests failed with ${EPYTHON}" } |