summaryrefslogtreecommitdiff
path: root/dev-python/twisted
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
commit4cbcc855382a06088e2f016f62cafdbcb7e40665 (patch)
tree356496503d52354aa6d9f2d36126302fed5f3a73 /dev-python/twisted
parentfcc5224904648a8e6eb528d7603154160a20022f (diff)
gentoo resync : 20.03.2022
Diffstat (limited to 'dev-python/twisted')
-rw-r--r--dev-python/twisted/Manifest9
-rw-r--r--dev-python/twisted/files/twisted-22.1.0-force-gtk3.patch (renamed from dev-python/twisted/files/twisted-21.7.0-force-gtk3.patch)22
-rw-r--r--dev-python/twisted/twisted-22.1.0-r1.ebuild160
-rw-r--r--dev-python/twisted/twisted-22.1.0.ebuild (renamed from dev-python/twisted/twisted-21.7.0.ebuild)18
-rw-r--r--dev-python/twisted/twisted-22.2.0.ebuild151
5 files changed, 336 insertions, 24 deletions
diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index 35c82f10aff7..f69d52712d42 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,7 +1,10 @@
AUX twistd.conf 277 BLAKE2B 78ca35b410a6597c9afe6a9c8d3dfb1de113411634901f936794e8a59c0644233d0673e710bd0870ecf4312d079c46f62f43928605700559134f1fb62490559a SHA512 76d44caebab8404f16937c2515ad9ae8236732a48c7127366f7fa22c6ed3d88ace2d33b832a6d95f775973d41b7caf75344805fe5b01e964c04eb710bf3c89fb
AUX twistd.init 563 BLAKE2B 24488118b025bf2068bbf07af900064ff6a7ee99106c3da30f15f2b3f85af7443212afebc6b52a12645488b85656f87b653df9263fc2be6bd09707917899f252 SHA512 7860601beba1efda2b0a045b2a044ec33caff9ee915d45225c05e281760a68da349b4c45080600177aab32aa806714327acf3cf5dda92be0874f781f129bb129
-AUX twisted-21.7.0-force-gtk3.patch 2759 BLAKE2B 65be4e948865a8de6cda3fbb9e90032d8c90b4db2e6b60d5861868273837c2ce846ab1452ca468f2e65be27882ca17ba842a9010607cc0e3969aeb70490e9ab1 SHA512 f4424f2b1f785c459263b4cdd3f906543e99ad6956130dcf3f6b589386a84637ca52d1346dc3465ef23fc82c701751e6053d145a0ca5225b846d6a7c20991f73
-DIST twisted-21.7.0.tar.gz 3895345 BLAKE2B 510165ad2933f07005e508df5a8bdf2863a7988c0f18fcc089e948d190c65aab32fc876d3120e311e91d6989f1ea2d8b3b5f5db4a9dfc63c38da56213f718728 SHA512 a946769a6bc6c72af26e7763b9e0675788f134b4d005ea89d935da1b1d5f60d92c84fdb2615e442e7da2b98291ee8a63d5236ec7ba72ef04ad3f847b092feecb
+AUX twisted-22.1.0-force-gtk3.patch 2634 BLAKE2B bf297589d56a59149e1a269aef416a9aef26dd2123cd9fc87358d19b279bd2924e84d3e9fffe5e6edb70f7268c19b4053cfdf6362b04dd6e91b3a2c997e0f92f SHA512 85b1678cf6c73e78004a015424f2e092b42bf4f5899ed607093b4c26ff1411fe22267df09c331f80086f9d46e5a6dadfad7fe62cbb04e3edeaaa05f40c96239a
+DIST twisted-22.1.0.tar.gz 3883519 BLAKE2B 0b438481af94fbfe08c7470a71421e176ca4994efaf7144b2bd3bc7e69c774295e04831d5356af104d087d970856c1c153b30331cb1598226f83e761b624a53c SHA512 1db52865d00e07044bc755b25bef2fa260cf269a8b51512bec97a015fa484d0b331b41154b52f97b5e8c477d3e5ad1d003f5ac15c7361988d073d097c6e7355d
+DIST twisted-22.2.0.tar.gz 3887750 BLAKE2B 43b50aa33f9a70f2123930ebfc0e9fec08a6faa791dc8fb73c1252fc1de3e00844e421f653d920e5f651aff89557750c6dc6c4557689e01bc9a0793c15de8eea SHA512 a2f66055f0ea6658a04888316b9eb90bd0f389c72db8315fe1722a70f16bb290805d98acc8cfd8a5d22b4817683603aaea50bb04a204927898bd74fc58a1db6d
DIST twisted-regen-cache.gz 911 BLAKE2B ffd3fcda6c67ffe6fd3ef581c8d507548396b66ed0708e9a5c790095e579c0d5f0f71596acf05712989da2ddef2b8d437eca973bc4d80ef8a9fa852915f38305 SHA512 95a9b931c73017d16d1b5e6b41345dddffe62b6af1a8e93b5e40d06d3d15be17b0dd0181c767ffeeb791534d463764ef9e066fa6c2ee2ac4b53c86d1da8fce03
-EBUILD twisted-21.7.0.ebuild 4738 BLAKE2B 20f3f3c92b55166b3346e141af1ed761630959c0ae51dd3759c25537f74b78eea7b3030234f46e61617ea2430ed1672eca9a92bde74ffe42d9d16625965a01ee SHA512 241adfffb5d0f4b448a1644184ed21cfbbd8989066bea783b7847c5516ded88816f570542779ae411e7b50a53168e3384556bdb22d110bb1e5adc2afdf85162b
+EBUILD twisted-22.1.0-r1.ebuild 4699 BLAKE2B 702416deee826241ebfe2a9be2caf0a40383b8ff070f35197cf29bfbc66cdb6c0b44519a7282f7f3576a2359ca19677a2f14692c8a8a29a0bdcb2a8308811151 SHA512 e0068302eeb8f2de38d6a86e2d9410e5668a383a56b0e17ad832ef8e4d341297854db76afd6f0efa477f18e9aa6b1b2238c6fc7d0876b54bea75f2f1a9e4a6c6
+EBUILD twisted-22.1.0.ebuild 4740 BLAKE2B 20fd3b47a7880c92c2d44ff6509147b3a7fe66a27bd960236b14b5d1b31c51cbf8ddd0b0ddacbd41cd18920a4da07c102deab13643bf2e82e62a49027e6887c7 SHA512 717b0f7fc47f8ff0a5b470b5a9a0bf21f4c76d75681aec55763d8b0bcd0996c75242950fe7498e07e46046fa383fccf6f572ad6f83db97fbfa11da0b3111d575
+EBUILD twisted-22.2.0.ebuild 4328 BLAKE2B d8106f754f5244bf13d1e3b9c1a3be76c1b36816a2e36e0fcfaceea9b193ecfc6da4e4b5fad53b8c13f5bf84d787cdcb90c51a5457134f6c18cc27ae2221c508 SHA512 a5049f1f33c2d765708ca836bb62f081931572ff57669a9aa13c04d4d117642276e257fc848a4b9699811492eec497250be3c4741eca67b8815aecde3ace6387
MISC metadata.xml 1352 BLAKE2B da3eecfbfd73709ff8fb48b985d64fa80d134c38a0c04d8c7b08e0ebd936cb2179f579deb6f91f38fd08b74e9454b693b4a89c9ab194296104c519e6f80ddc8a SHA512 f244db7eb7a13e35f8825e2b16cf3cb953c47e68be234efc9d922462cc7ee66e1748e09bf4735bee59cd1016eb38c64ca23f70a25da5bb7311f869cebbb45569
diff --git a/dev-python/twisted/files/twisted-21.7.0-force-gtk3.patch b/dev-python/twisted/files/twisted-22.1.0-force-gtk3.patch
index a2e40559ec59..7c9f2d558d65 100644
--- a/dev-python/twisted/files/twisted-21.7.0-force-gtk3.patch
+++ b/dev-python/twisted/files/twisted-22.1.0-force-gtk3.patch
@@ -1,4 +1,4 @@
-From eec6b60116e12e015387fe1fa3a729553d3848bf Mon Sep 17 00:00:00 2001
+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
@@ -14,18 +14,18 @@ that gireactor is currently incompatible with.
create mode 100644 src/twisted/newsfragments/10200.bugfix
diff --git a/src/twisted/internet/gireactor.py b/src/twisted/internet/gireactor.py
-index 92596db1d..a577825a8 100644
+index e2d24b599..838fa982e 100644
--- a/src/twisted/internet/gireactor.py
+++ b/src/twisted/internet/gireactor.py
-@@ -24,6 +24,7 @@ On Python 3, pygobject v3.4 or later is required.
- from twisted.internet.error import ReactorAlreadyRunning
- from twisted.internet import _glibbase
- from twisted.python import runtime
+@@ -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]
-@@ -68,6 +69,7 @@ class GIReactor(_glibbase.GlibReactorBase):
+@@ -69,6 +70,7 @@ class GIReactor(_glibbase.GlibReactorBase):
def __init__(self, useGtk=False):
_gtk = None
if useGtk is True:
@@ -33,7 +33,7 @@ index 92596db1d..a577825a8 100644
from gi.repository import Gtk as _gtk
_glibbase.GlibReactorBase.__init__(self, GLib, _gtk, useGtk=useGtk)
-@@ -112,6 +114,7 @@ class PortableGIReactor(_glibbase.PortableGlibReactorBase):
+@@ -113,6 +115,7 @@ class PortableGIReactor(_glibbase.PortableGlibReactorBase):
def __init__(self, useGtk=False):
_gtk = None
if useGtk is True:
@@ -42,10 +42,10 @@ index 92596db1d..a577825a8 100644
_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 d15a92622..af5092a36 100644
+index c25ada63f..3bb88a07f 100644
--- a/src/twisted/internet/test/test_gireactor.py
+++ b/src/twisted/internet/test/test_gireactor.py
-@@ -25,6 +25,9 @@ else:
+@@ -26,6 +26,9 @@ else:
gtk3reactor = None
else:
gtk3reactor = _gtk3reactor
@@ -63,5 +63,5 @@ index 000000000..7afb343be
@@ -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.32.0
+2.35.1
diff --git a/dev-python/twisted/twisted-22.1.0-r1.ebuild b/dev-python/twisted/twisted-22.1.0-r1.ebuild
new file mode 100644
index 000000000000..19ad414849ca
--- /dev/null
+++ b/dev-python/twisted/twisted-22.1.0-r1.ebuild
@@ -0,0 +1,160 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..10} pypy3 )
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1 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
+ 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 ~m68k ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="conch crypt http2 serial 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/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}]
+ conch? (
+ >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+ dev-python/bcrypt[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-1.5.0[${PYTHON_USEDEP}]
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ )
+ crypt? (
+ >=dev-python/pyopenssl-16.0.0[${PYTHON_USEDEP}]
+ dev-python/service_identity[${PYTHON_USEDEP}]
+ >=dev-python/idna-0.6[${PYTHON_USEDEP}]
+ )
+ serial? ( >=dev-python/pyserial-3.0[${PYTHON_USEDEP}] )
+ http2? (
+ >=dev-python/h2-3.0.0[${PYTHON_USEDEP}]
+ <dev-python/h2-4.0.0[${PYTHON_USEDEP}]
+ >=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
+ <dev-python/priority-2.0[${PYTHON_USEDEP}]
+ )
+"
+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/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}]
+ ) ) )
+ )
+"
+
+PATCHES=(
+ # https://twistedmatrix.com/trac/ticket/10200
+ "${FILESDIR}/${P}-force-gtk3.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:_&:' \
+ -e 's:test_multiListen:_&:' \
+ -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
+
+ distutils-r1_python_prepare_all
+}
+
+src_test() {
+ # the test suite handles missing file & failing ioctl()s gracefully
+ # but not permission errors from sandbox
+ addwrite /dev/net/tun
+ virtx distutils-r1_src_test
+}
+
+python_test() {
+ "${EPYTHON}" -m twisted.trial twisted ||
+ die "Tests failed with ${EPYTHON}"
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ # own the dropin.cache so we don't leave orphans
+ > "${D}$(python_get_sitedir)"/twisted/plugins/dropin.cache || die
+
+ python_doscript "${WORKDIR}"/twisted-regen-cache
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ newconfd "${FILESDIR}/twistd.conf" twistd
+ newinitd "${FILESDIR}/twistd.init" twistd
+}
+
+python_postinst() {
+ twisted-regen-cache || die
+}
+
+pkg_postinst() {
+ python_foreach_impl python_postinst
+
+ einfo "Install complete"
+ if use test ; then
+ einfo ""
+ einfo "Some tests have been disabled during testing due to"
+ einfo "known incompatibilities with the emerge sandboxes and/or"
+ einfo "not runnable as the root user."
+ einfo "For a complete test suite run on the code."
+ einfo "Run the tests as a normal user for each python it is installed to."
+ einfo " ie: $ python3.6 /usr/bin/trial twisted"
+ fi
+}
+
+python_postrm() {
+ rm -f "${ROOT}$(python_get_sitedir)/twisted/plugins/dropin.cache" || die
+}
+
+pkg_postrm() {
+ # if we're removing the last version, remove the cache file
+ if [[ ! ${REPLACING_VERSIONS} ]]; then
+ python_foreach_impl python_postrm
+ fi
+}
diff --git a/dev-python/twisted/twisted-21.7.0.ebuild b/dev-python/twisted/twisted-22.1.0.ebuild
index e095ce421151..ab2a590fca6d 100644
--- a/dev-python/twisted/twisted-21.7.0.ebuild
+++ b/dev-python/twisted/twisted-22.1.0.ebuild
@@ -1,7 +1,7 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
PYTHON_COMPAT=( python3_{8..10} )
PYTHON_REQ_USE="threads(+)"
@@ -56,11 +56,13 @@ BDEPEND="
dev-python/bcrypt[${PYTHON_USEDEP}]
>=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
dev-python/cython-test-exception-raiser[${PYTHON_USEDEP}]
- dev-python/gmpy[${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/gmpy[${PYTHON_USEDEP}]
+ ' 'python*')
!alpha? ( !hppa? ( !ia64? (
>=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
>=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
@@ -91,11 +93,6 @@ python_prepare_all() {
-e 's:test_multicast:_&:' \
-i src/twisted/test/test_udp.py || die
- # accesses /dev/net/tun
- sed -e '/class RealDeviceTestsMixin/a\
- skip = "Requires extra permissions"' \
- -i src/twisted/pair/test/test_tuntap.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
@@ -104,6 +101,9 @@ python_prepare_all() {
}
src_test() {
+ # the test suite handles missing file & failing ioctl()s gracefully
+ # but not permission errors from sandbox
+ addwrite /dev/net/tun
virtx distutils-r1_src_test
}
@@ -118,10 +118,8 @@ python_test() {
python_install() {
distutils-r1_python_install
- cd "${D}$(python_get_sitedir)" || die
-
# own the dropin.cache so we don't leave orphans
- touch twisted/plugins/dropin.cache || die
+ > "${D}$(python_get_sitedir)"/twisted/plugins/dropin.cache || die
python_doscript "${WORKDIR}"/twisted-regen-cache
}
diff --git a/dev-python/twisted/twisted-22.2.0.ebuild b/dev-python/twisted/twisted-22.2.0.ebuild
new file mode 100644
index 000000000000..6c2dcb735c72
--- /dev/null
+++ b/dev-python/twisted/twisted-22.2.0.ebuild
@@ -0,0 +1,151 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..10} pypy3 )
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1 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
+ 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 ~m68k ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="conch crypt http2 serial 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/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}]
+ conch? (
+ >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+ dev-python/bcrypt[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-1.5.0[${PYTHON_USEDEP}]
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ )
+ crypt? (
+ >=dev-python/pyopenssl-16.0.0[${PYTHON_USEDEP}]
+ dev-python/service_identity[${PYTHON_USEDEP}]
+ >=dev-python/idna-0.6[${PYTHON_USEDEP}]
+ )
+ serial? ( >=dev-python/pyserial-3.0[${PYTHON_USEDEP}] )
+ http2? (
+ >=dev-python/h2-3.0.0[${PYTHON_USEDEP}]
+ <dev-python/h2-4.0.0[${PYTHON_USEDEP}]
+ >=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
+ <dev-python/priority-2.0[${PYTHON_USEDEP}]
+ )
+"
+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/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}]
+ ) ) )
+ )
+"
+
+PATCHES=(
+ # https://twistedmatrix.com/trac/ticket/10200
+ "${FILESDIR}/${PN}-22.1.0-force-gtk3.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:_&:' \
+ -e 's:test_multiListen:_&:' \
+ -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
+
+ distutils-r1_python_prepare_all
+}
+
+src_test() {
+ # the test suite handles missing file & failing ioctl()s gracefully
+ # but not permission errors from sandbox
+ addwrite /dev/net/tun
+ virtx distutils-r1_src_test
+}
+
+python_test() {
+ "${EPYTHON}" -m twisted.trial twisted ||
+ die "Tests failed with ${EPYTHON}"
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ # own the dropin.cache so we don't leave orphans
+ > "${D}$(python_get_sitedir)"/twisted/plugins/dropin.cache || die
+
+ python_doscript "${WORKDIR}"/twisted-regen-cache
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ newconfd "${FILESDIR}/twistd.conf" twistd
+ newinitd "${FILESDIR}/twistd.init" twistd
+}
+
+python_postinst() {
+ twisted-regen-cache || die
+}
+
+pkg_postinst() {
+ if [[ -z ${ROOT} ]]; then
+ python_foreach_impl python_postinst
+ fi
+}
+
+python_postrm() {
+ rm -f "${ROOT}$(python_get_sitedir)/twisted/plugins/dropin.cache" || die
+}
+
+pkg_postrm() {
+ # if we're removing the last version, remove the cache file
+ if [[ ! ${REPLACING_VERSIONS} ]]; then
+ python_foreach_impl python_postrm
+ fi
+}