* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2016-10-07 18:11 Brian Dolbec
0 siblings, 0 replies; 17+ messages in thread
From: Brian Dolbec @ 2016-10-07 18:11 UTC (permalink / raw
To: gentoo-commits
commit: 7b38d796995f1976adaee32425c058d2bdfcb312
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 5 23:07:02 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Oct 7 18:11:12 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b38d796
dev-python/twisted: New monolithic release twisted package
Twisted has changed to a single release pkg.
This new pkg. now has python3 support.
Package-Manager: portage-2.3.1_p8
dev-python/twisted/Manifest | 2 +
dev-python/twisted/files/twistd.conf | 7 ++
dev-python/twisted/files/twistd.init | 25 ++++
...t_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch | 11 ++
dev-python/twisted/metadata.xml | 36 ++++++
dev-python/twisted/twisted-16.2.0.ebuild | 126 +++++++++++++++++++
dev-python/twisted/twisted-16.3.2.ebuild | 134 +++++++++++++++++++++
7 files changed, 341 insertions(+)
diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
new file mode 100644
index 00000000..61d1a6e
--- /dev/null
+++ b/dev-python/twisted/Manifest
@@ -0,0 +1,2 @@
+DIST Twisted-16.2.0.tar.bz2 2942537 SHA256 a090e8dc675e97fb20c3bb5f8114ae94169f4e29fd3b3cbede35705fd3cdbd79 SHA512 a1942c15a84946e8bd4833801fffe7be01443560209972e10043262fd17a73c5d0c50592bd037130b6a1de08d7223cbdc1e2398c8c67f559d42e3e8ec81df840 WHIRLPOOL f847d57b833f7fbd9135c4a07af163afaa1e7a821d3aa657b34b2b465540bdce6472682ec20d7f8244117e99a4301e485afe6a765c07b7b64ac9bc90a9592af4
+DIST Twisted-16.3.2.tar.bz2 2916410 SHA256 22c32e68feb6be7ea68bcbc8f89184f06b5693a9f1b59d052927d19597645967 SHA512 6ddca880a06087717487d8a5cc128da81f1acbc97e5c372b1ba51eaeb87390ae7f91925e8e4cc90f29df21692bc11b6e0fe3772341b8488940895e57942e5149 WHIRLPOOL ad381b36f94351c15713e35d6312bae35c78ff90eb485892131f7db8c89168ccf5ddbc9d486bfeb47db695e75280bc73401194c6b36815c5859cc945d0191a7b
diff --git a/dev-python/twisted/files/twistd.conf b/dev-python/twisted/files/twistd.conf
new file mode 100644
index 00000000..53788cd
--- /dev/null
+++ b/dev-python/twisted/files/twistd.conf
@@ -0,0 +1,7 @@
+
+# These are passed to twistd.
+# TWISTD_OPTS="--no_save --logfile=/var/log/twistd -y /etc/twistd.tac"
+# TWISTD_OPTS="--no_save --logfile=/var/log/twistd -f /etc/twistd.tap"
+
+# Make any additions to PYTHONPATH the twistd needs here.
+# PYTHONPATH="/path/to/extra/python/modules"
diff --git a/dev-python/twisted/files/twistd.init b/dev-python/twisted/files/twistd.init
new file mode 100644
index 00000000..b031b00
--- /dev/null
+++ b/dev-python/twisted/files/twistd.init
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+
+depend() {
+ need net
+}
+
+start() {
+ if [ -z "${TWISTD_OPTS}" ]; then
+ eerror "TWISTD_OPTS is not set!"
+ eerror "You need to configure twistd in /etc/conf.d/twistd."
+ return 1
+ fi
+ export PYTHONPATH
+ ebegin "Starting twistd"
+ start-stop-daemon --start --quiet --pidfile /var/run/twistd.pid \
+ --exec /usr/bin/twistd -- --pidfile /var/run/twistd.pid \
+ ${TWISTD_OPTS}
+ eend $? "Failed to start twistd"
+}
+
+stop() {
+ ebegin "Stopping twistd"
+ start-stop-daemon --stop --quiet --pidfile /var/run/twistd.pid
+ eend $? "Failed to stop twistd"
+}
diff --git a/dev-python/twisted/files/twisted-core-9.0.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch b/dev-python/twisted/files/twisted-core-9.0.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch
new file mode 100644
index 00000000..2fe22f1
--- /dev/null
+++ b/dev-python/twisted/files/twisted-core-9.0.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch
@@ -0,0 +1,11 @@
+--- twisted/plugin.py
++++ twisted/plugin.py
+@@ -174,7 +174,7 @@
+ if pluginKey not in existingKeys:
+ del dropinDotCache[pluginKey]
+ needsWrite = True
+- if needsWrite:
++ if needsWrite and os.environ.get("TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE") is None:
+ try:
+ dropinPath.setContent(pickle.dumps(dropinDotCache))
+ except:
diff --git a/dev-python/twisted/metadata.xml b/dev-python/twisted/metadata.xml
new file mode 100644
index 00000000..bb89489
--- /dev/null
+++ b/dev-python/twisted/metadata.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>dol-sen@gentoo.org</email>
+ <description>maintainer</description>
+ </maintainer>
+ <upstream>
+ <maintainer>
+ <email>twisted-python@twistedmatrix.com</email>
+ <name>Twisted Matrix Laboratories</name>
+ </maintainer>
+ <remote-id type="pypi">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
+ applications, supporting Python 2.7 and Python 3.3+. It includes
+ modules for many different purposes, including the following:
+
+twisted.web: HTTP clients and servers, HTML templating, and a WSGI server
+twisted.conch: SSHv2 and Telnet clients and servers and terminal emulators
+twisted.words: Clients and servers for IRC, XMPP, and other IM protocols
+twisted.mail: IMAPv4, POP3, SMTP clients and servers
+twisted.positioning: Tools for communicating with NMEA-compatible GPS receivers
+twisted.names: DNS client and tools for making your own DNS servers
+twisted.trial: A unit testing framework that integrates well with Twisted-based code.
+ </longdescription>
+</pkgmetadata>
diff --git a/dev-python/twisted/twisted-16.2.0.ebuild b/dev-python/twisted/twisted-16.2.0.ebuild
new file mode 100644
index 00000000..7f47bfc
--- /dev/null
+++ b/dev-python/twisted/twisted-16.2.0.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 python3_{4,5})
+PYTHON_REQ_USE="threads(+)"
+TWISTED_PN="Twisted"
+
+inherit eutils flag-o-matic twisted-r1
+
+DESCRIPTION="An asynchronous networking framework written in Python"
+SRC_URI="http://twistedmatrix.com/Releases/${TWISTED_PN}"
+SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2"
+
+#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86 ~x86-fbsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~amd64 ~x86"
+IUSE="conch crypt serial +soap test"
+
+RDEPEND=">=dev-python/zope-interface-3.6.0[${PYTHON_USEDEP}]
+ conch? (
+ dev-python/gmpy[${PYTHON_USEDEP}]
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
+ >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+ )
+ crypt? (
+ >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
+ dev-python/service_identity[${PYTHON_USEDEP}]
+ dev-python/idna[${PYTHON_USEDEP}]
+ )
+ serial? ( dev-python/pyserial[${PYTHON_USEDEP}] )
+ soap? ( $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7) )
+"
+DEPEND="
+ !dev-python/twisted-core
+ !dev-python/twisted-conch
+ !dev-python/twisted-mail
+ !dev-python/twisted-names
+ !dev-python/twisted-words
+ !dev-python/twisted-web
+ test? (
+ dev-python/gmpy[${PYTHON_USEDEP}]
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
+ >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+ >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
+ dev-python/service_identity[${PYTHON_USEDEP}]
+ dev-python/idna[${PYTHON_USEDEP}]
+ dev-python/pyserial[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7)
+ )
+"
+
+PATCHES=(
+ # Respect TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE variable.
+ "${FILESDIR}/${PN}-core-9.0.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch"
+)
+
+python_prepare_all() {
+ # Remove some tests known to fail due to the network sandbox
+ rm -R twisted/pair/test/test_*.py || die "rm twisted/pair/test/test_*.py FAILED"
+ # Possibly due to over taxing of the distutils_install_for_testing function
+ rm twisted/python/test/test_release.py || die "rm twisted/python/test/test_release.py FAILED"
+ if [[ "${EUID}" -eq 0 ]]; then
+ # Disable tests failing with root permissions.
+ sed \
+ -e "s/test_newPluginsOnReadOnlyPath/_&/" \
+ -e "s/test_deployedMode/_&/" \
+ -i twisted/test/test_plugin.py
+ fi
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ if ! python_is_python3; then
+ # Needed to make the sendmsg extension work
+ # (see http://twistedmatrix.com/trac/ticket/5701 )
+ local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
+ local -x CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
+ fi
+
+ distutils-r1_python_compile
+}
+
+python_test() {
+ distutils_install_for_testing
+
+ pushd "${TEST_DIR}"/lib > /dev/null || die
+
+ if ! "${TEST_DIR}"/scripts/trial twisted; then
+ die "Tests failed with ${EPYTHON}"
+ fi
+
+ popd > /dev/null || die
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ cd "${D%/}$(python_get_sitedir)" || die
+
+ # create 'Twisted' egg wrt bug #299736
+ #local egg=( Twisted_Core*.egg-info )
+ #[[ -f ${egg[0]} ]] || die "Twisted_Core*.egg-info not found"
+ #ln -s "${egg[0]}" "${egg[0]/_Core/}" || die
+
+ # own the dropin.cache so we don't leave orphans
+ touch twisted/plugins/dropin.cache || die
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ newconfd "${FILESDIR}/twistd.conf" twistd
+ newinitd "${FILESDIR}/twistd.init" twistd
+}
+
+pkg_postinst(){
+ einfo "Install complete"
+}
+
+pkg_postrm(){
+ einfo ""
+}
diff --git a/dev-python/twisted/twisted-16.3.2.ebuild b/dev-python/twisted/twisted-16.3.2.ebuild
new file mode 100644
index 00000000..59abe77
--- /dev/null
+++ b/dev-python/twisted/twisted-16.3.2.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 python3_{4,5})
+PYTHON_REQ_USE="threads(+)"
+TWISTED_PN="Twisted"
+
+inherit eutils flag-o-matic twisted-r1
+
+DESCRIPTION="An asynchronous networking framework written in Python"
+SRC_URI="http://twistedmatrix.com/Releases/${TWISTED_PN}"
+SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2"
+
+# Dropped keywords due to new deps not keyworded
+#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86 ~x86-fbsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~amd64 ~x86"
+IUSE="conch crypt http2 serial +soap test"
+
+RDEPEND=">=dev-python/zope-interface-3.6.0[${PYTHON_USEDEP}]
+ conch? (
+ dev-python/gmpy[${PYTHON_USEDEP}]
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
+ >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+ )
+ crypt? (
+ >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
+ dev-python/service_identity[${PYTHON_USEDEP}]
+ dev-python/idna[${PYTHON_USEDEP}]
+ )
+ serial? ( dev-python/pyserial[${PYTHON_USEDEP}] )
+ soap? ( $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7) )
+ http2? (
+ >=dev-python/hyper-h2-2.3.0[${PYTHON_USEDEP}]
+ <dev-python/hyper-h2-3.0[${PYTHON_USEDEP}]
+ >=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
+ <dev-python/priority-2.0[${PYTHON_USEDEP}]
+ )
+ !dev-python/twisted-core
+ !dev-python/twisted-conch
+ !dev-python/twisted-lore
+ !dev-python/twisted-mail
+ !dev-python/twisted-names
+ !dev-python/twisted-news
+ !dev-python/twisted-pair
+ !dev-python/twisted-runner
+ !dev-python/twisted-words
+ !dev-python/twisted-web
+"
+DEPEND="
+ test? (
+ dev-python/gmpy[${PYTHON_USEDEP}]
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
+ >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+ >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
+ dev-python/service_identity[${PYTHON_USEDEP}]
+ dev-python/idna[${PYTHON_USEDEP}]
+ dev-python/pyserial[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ # Respect TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE variable.
+ "${FILESDIR}/${PN}-core-9.0.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch"
+)
+
+python_prepare_all() {
+ # Remove some tests known to fail due to the network sandbox
+ rm -R twisted/pair/test/test_*.py || die "rm twisted/pair/test/test_*.py FAILED"
+ # Possibly due to over taxing of the distutils_install_for_testing function
+ rm twisted/python/test/test_release.py || die "rm twisted/python/test/test_release.py FAILED"
+ if [[ "${EUID}" -eq 0 ]]; then
+ # Disable tests failing with root permissions.
+ sed \
+ -e "s/test_newPluginsOnReadOnlyPath/_&/" \
+ -e "s/test_deployedMode/_&/" \
+ -i twisted/test/test_plugin.py
+ fi
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ if ! python_is_python3; then
+ # Needed to make the sendmsg extension work
+ # (see http://twistedmatrix.com/trac/ticket/5701 )
+ local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
+ local -x CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
+ fi
+
+ distutils-r1_python_compile
+}
+
+python_test() {
+ distutils_install_for_testing
+
+ pushd "${TEST_DIR}"/lib > /dev/null || die
+
+ if ! "${TEST_DIR}"/scripts/trial twisted; then
+ die "Tests failed with ${EPYTHON}"
+ fi
+
+ popd > /dev/null || die
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ cd "${D%/}$(python_get_sitedir)" || die
+
+ # create 'Twisted' egg wrt bug #299736
+ #local egg=( Twisted_Core*.egg-info )
+ #[[ -f ${egg[0]} ]] || die "Twisted_Core*.egg-info not found"
+ #ln -s "${egg[0]}" "${egg[0]/_Core/}" || die
+
+ # own the dropin.cache so we don't leave orphans
+ touch twisted/plugins/dropin.cache || die
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ newconfd "${FILESDIR}/twistd.conf" twistd
+ newinitd "${FILESDIR}/twistd.init" twistd
+}
+
+pkg_postrm(){
+ # pre portage-2.3.2 release workaround for bug 595028
+ cd "${HOME}"
+ _distutils-r1_run_foreach_impl twisted-r1_update_plugin_cache
+}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2017-03-30 2:40 Brian Dolbec
0 siblings, 0 replies; 17+ messages in thread
From: Brian Dolbec @ 2017-03-30 2:40 UTC (permalink / raw
To: gentoo-commits
commit: b386fa3d0eda5c2cdd9f17930d4468e5f35bd378
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 29 01:14:13 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Mar 30 02:40:17 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b386fa3d
dev-python/twisted: Version bump
Package-Manager: Portage-2.3.5, Repoman-2.3.2_p30
dev-python/twisted/Manifest | 1 +
...t_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch | 11 +
.../twisted/files/twisted-16.6.0-test-fixes.patch | 380 +++++++++++++++++++++
dev-python/twisted/twisted-16.6.0.ebuild | 151 ++++++++
4 files changed, 543 insertions(+)
diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index da7dc2adbcd..34853df61ab 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,3 +1,4 @@
DIST Twisted-16.2.0.tar.bz2 2942537 SHA256 a090e8dc675e97fb20c3bb5f8114ae94169f4e29fd3b3cbede35705fd3cdbd79 SHA512 a1942c15a84946e8bd4833801fffe7be01443560209972e10043262fd17a73c5d0c50592bd037130b6a1de08d7223cbdc1e2398c8c67f559d42e3e8ec81df840 WHIRLPOOL f847d57b833f7fbd9135c4a07af163afaa1e7a821d3aa657b34b2b465540bdce6472682ec20d7f8244117e99a4301e485afe6a765c07b7b64ac9bc90a9592af4
DIST Twisted-16.3.2.tar.bz2 2916410 SHA256 22c32e68feb6be7ea68bcbc8f89184f06b5693a9f1b59d052927d19597645967 SHA512 6ddca880a06087717487d8a5cc128da81f1acbc97e5c372b1ba51eaeb87390ae7f91925e8e4cc90f29df21692bc11b6e0fe3772341b8488940895e57942e5149 WHIRLPOOL ad381b36f94351c15713e35d6312bae35c78ff90eb485892131f7db8c89168ccf5ddbc9d486bfeb47db695e75280bc73401194c6b36815c5859cc945d0191a7b
DIST Twisted-16.4.1.tar.bz2 2975697 SHA256 1d8d73f006c990744effb35588359fd44d43608649ac0b6b7edc71176e88e816 SHA512 7d841f5ef7fbcc5c215e5fb0d56934c6b37ecb0835a9e602a2b788a76960c669eb910a58c1f40f3e15121a7852a1055d377891c7ce3f2e360292a41341ab6bfe WHIRLPOOL 1c79ea538cddd2026d2aa02367e37f22dec23746f720ce3a25c8065d9db616c622faa89b0011966a27a47f3336fcca066ad85645d3316bbaa318f6143ac8f8cf
+DIST Twisted-16.6.0.tar.bz2 2979747 SHA256 d0fe115ea7ef8cf632d05103de60356c6e992b2153d6830bdc4476f8accb1fca SHA512 0b8de0ec7f64457f76c396fced64b366b8e63c6e000a5edc6c6388cd917fb2f95711918cd8edda39e0aa77e2cd32b5d775d23630a5ad10fc013c18f8316300cf WHIRLPOOL a09a8747312580e3b27d222bf0942b714ad041044a817876e1731c5fa2ae3d11e4d5a45221d2e7d126ebb664730d15c886d5ae164841c7a8f0acd6e12c4691a9
diff --git a/dev-python/twisted/files/twisted-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch b/dev-python/twisted/files/twisted-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch
new file mode 100644
index 00000000000..ed1a4684067
--- /dev/null
+++ b/dev-python/twisted/files/twisted-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch
@@ -0,0 +1,11 @@
+--- src/twisted/plugin.py
++++ src/twisted/plugin.py
+@@ -180,7 +180,7 @@
+ if pluginKey not in existingKeys:
+ del dropinDotCache[pluginKey]
+ needsWrite = True
+- if needsWrite:
++ if needsWrite and os.environ.get("TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE") is None:
+ try:
+ dropinPath.setContent(pickle.dumps(dropinDotCache))
+ except:
diff --git a/dev-python/twisted/files/twisted-16.6.0-test-fixes.patch b/dev-python/twisted/files/twisted-16.6.0-test-fixes.patch
new file mode 100644
index 00000000000..a04cafd1ccb
--- /dev/null
+++ b/dev-python/twisted/files/twisted-16.6.0-test-fixes.patch
@@ -0,0 +1,380 @@
+From 7fddbadde3f1f65c1ef78223e6af98a066a2315b Mon Sep 17 00:00:00 2001
+From: Brian Dolbec <dolsen@gentoo.org>
+Date: Wed, 29 Mar 2017 18:28:45 -0700
+Subject: [PATCH] Twisted-16.6.0 test fixes
+
+---
+ src/twisted/internet/test/test_gireactor.py | 3 ++-
+ src/twisted/pair/test/test_ethernet.py | 9 +++++++++
+ src/twisted/pair/test/test_ip.py | 8 ++++++++
+ src/twisted/pair/test/test_rawudp.py | 10 +++++++++-
+ src/twisted/pair/test/test_tuntap.py | 16 ++++++++++++++++
+ src/twisted/python/test/test_dist3.py | 2 ++
+ src/twisted/test/test_ident.py | 7 ++++++-
+ src/twisted/test/test_main.py | 8 +++++++-
+ src/twisted/test/test_plugin.py | 6 ++++++
+ src/twisted/test/test_policies.py | 5 +++++
+ src/twisted/test/test_reflect.py | 3 ++-
+ src/twisted/test/test_twistd.py | 21 ++++++++++++++-------
+ src/twisted/test/test_udp.py | 6 ++++++
+ 13 files changed, 92 insertions(+), 12 deletions(-)
+
+diff --git a/src/twisted/internet/test/test_gireactor.py b/src/twisted/internet/test/test_gireactor.py
+index 43147fdce..6333218e7 100644
+--- a/src/twisted/internet/test/test_gireactor.py
++++ b/src/twisted/internet/test/test_gireactor.py
+@@ -39,6 +39,7 @@ from twisted.python.compat import _PY3
+ if gireactor is None:
+ skip = "gtk3/gi not importable"
+
++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
+
+
+ class GApplicationRegistrationTests(ReactorBuilder, TestCase):
+@@ -103,7 +104,7 @@ class GApplicationRegistrationTests(ReactorBuilder, TestCase):
+
+ self.runReactor(app, reactor)
+
+- if gtk3reactor is None:
++ if gtk3reactor is None or EMERGE_TEST_OVERRIDE:
+ test_gtkApplicationActivate.skip = (
+ "Gtk unavailable (may require running with X11 DISPLAY env set)")
+
+diff --git a/src/twisted/pair/test/test_ethernet.py b/src/twisted/pair/test/test_ethernet.py
+index a4c3a5d19..fe9c57151 100644
+--- a/src/twisted/pair/test/test_ethernet.py
++++ b/src/twisted/pair/test/test_ethernet.py
+@@ -1,11 +1,16 @@
+ # Copyright (c) Twisted Matrix Laboratories.
+ # See LICENSE for details.
++
++import os
++
+ from twisted.trial import unittest
+
+ from twisted.python import components
+ from twisted.pair import ethernet, raw
+ from zope.interface import implementer
+
++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
++
+
+ @implementer(raw.IRawPacketProtocol)
+ class MyProtocol:
+@@ -221,3 +226,7 @@ class EthernetTests(unittest.TestCase):
+ raise
+ else:
+ raise AssertionError('addProto must raise an exception for bad protocols')
++
++
++if EMERGE_TEST_OVERRIDE:
++ EthernetTests.skip = "This test does not work via FEATURES=test emerge twisted"
+diff --git a/src/twisted/pair/test/test_ip.py b/src/twisted/pair/test/test_ip.py
+index 0f192a357..0a99658ef 100644
+--- a/src/twisted/pair/test/test_ip.py
++++ b/src/twisted/pair/test/test_ip.py
+@@ -1,11 +1,16 @@
+ # Copyright (c) Twisted Matrix Laboratories.
+ # See LICENSE for details.
++
++import os
++
+ from twisted.trial import unittest
+
+ from twisted.python import components
+ from twisted.pair import ip, raw
+ from zope import interface
+
++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
++
+
+ @interface.implementer(raw.IRawDatagramProtocol)
+ class MyProtocol:
+@@ -432,3 +437,6 @@ class IPTests(unittest.TestCase):
+ raise
+ else:
+ raise AssertionError('addProto must raise an exception for bad protocols')
++
++if EMERGE_TEST_OVERRIDE:
++ IPTests.skip = "This test does not work via FEATURES=test emerge twisted"
+diff --git a/src/twisted/pair/test/test_rawudp.py b/src/twisted/pair/test/test_rawudp.py
+index 15aae10f1..dade38618 100644
+--- a/src/twisted/pair/test/test_rawudp.py
++++ b/src/twisted/pair/test/test_rawudp.py
+@@ -1,12 +1,17 @@
+ # Copyright (c) Twisted Matrix Laboratories.
+ # See LICENSE for details.
+-
+ #
++
++import os
++
+ from twisted.trial import unittest
+
+ from twisted.internet import protocol
+ from twisted.pair import rawudp
+
++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
++
++
+ class MyProtocol(protocol.DatagramProtocol):
+ def __init__(self, expecting):
+ self.expecting = list(expecting)
+@@ -325,3 +330,6 @@ class RawUDPTests(unittest.TestCase):
+ raise
+ else:
+ raise AssertionError('addProto must raise an exception for bad protocols')
++
++if EMERGE_TEST_OVERRIDE:
++ RawUDPTests.skip = "This test does not work via FEATURES=test emerge twisted"
+diff --git a/src/twisted/pair/test/test_tuntap.py b/src/twisted/pair/test/test_tuntap.py
+index 5e2da6e0f..53e03a008 100644
+--- a/src/twisted/pair/test/test_tuntap.py
++++ b/src/twisted/pair/test/test_tuntap.py
+@@ -64,6 +64,7 @@ if platformSkip is None:
+ else:
+ skip = platformSkip
+
++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
+
+
+ @implementer(IReactorFDSet)
+@@ -1417,3 +1418,18 @@ class RealIOSystemTests(IOSystemTestsMixin, SynchronousTestCase,
+ """
+ General L{_IInputOutputSystem} tests applied to L{_RealSystem}.
+ """
++
++if EMERGE_TEST_OVERRIDE:
++ RealIOSystemTests.skip = "This test does not work via FEATURES=test emerge twisted"
++ MemoryIOSystemTests.skip = "This test does not work via FEATURES=test emerge twisted"
++ TapTests.skip = "This test does not work via FEATURES=test emerge twisted"
++ TunTests.skip = "This test does not work via FEATURES=test emerge twisted"
++ TunnelAddressEqualityTests.skip = "This test does not work via FEATURES=test emerge twisted"
++ TunnelAddressTests.skip = "This test does not work via FEATURES=test emerge twisted"
++ TuntapPortTests.skip = "This test does not work via FEATURES=test emerge twisted"
++ TunnelTests.skip = "This test does not work via FEATURES=test emerge twisted"
++ FakeTapDeviceTests.skip = "This test does not work via FEATURES=test emerge twisted"
++ FakeTapDeviceWithPITests.skip = "This test does not work via FEATURES=test emerge twisted"
++ FakeTunDeviceTests.skip = "This test does not work via FEATURES=test emerge twisted"
++ RealDeviceWithProtocolInformationTests.skip = "This test does not work via FEATURES=test emerge twisted"
++ RealDeviceWithoutProtocolInformationTests.skip = "This test does not work via FEATURES=test emerge twisted"
+diff --git a/src/twisted/python/test/test_dist3.py b/src/twisted/python/test/test_dist3.py
+index 3ce2bdd60..494674bc7 100644
+--- a/src/twisted/python/test/test_dist3.py
++++ b/src/twisted/python/test/test_dist3.py
+@@ -53,3 +53,5 @@ class ModulesToInstallTests(TestCase):
+ test_exist.skip = "Only on Python 2"
+ else:
+ test_notexist.skip = "Only on Python 3"
++
++ModulesToInstallTests.skip = "This is an upstream distribution test only"
+diff --git a/src/twisted/test/test_ident.py b/src/twisted/test/test_ident.py
+index d86b840e5..028778a2d 100644
+--- a/src/twisted/test/test_ident.py
++++ b/src/twisted/test/test_ident.py
+@@ -6,13 +6,14 @@
+ Test cases for twisted.protocols.ident module.
+ """
+
++import os
+ import struct
+
+ from twisted.protocols import ident
+ from twisted.python import failure
+ from twisted.internet import error
+ from twisted.internet import defer
+-from twisted.python.compat import NativeStringIO
++from twisted.python.compat import NativeStringIO, _PY3
+
+ from twisted.trial import unittest
+ from twisted.test.proto_helpers import StringTransport
+@@ -23,6 +24,7 @@ try:
+ except ImportError:
+ import __builtin__ as builtins
+
++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
+
+
+ class ClassParserTests(unittest.TestCase):
+@@ -216,6 +218,9 @@ class ProcMixinTests(unittest.TestCase):
+ """
+ L{ident.ProcServerMixin.lookup} uses the Linux TCP process table.
+ """
++ if not _PY3:
++ # test is broken in py2.7
++ return
+ open_calls = []
+
+ def mocked_open(*args, **kwargs):
+diff --git a/src/twisted/test/test_main.py b/src/twisted/test/test_main.py
+index 572769018..60b795f96 100644
+--- a/src/twisted/test/test_main.py
++++ b/src/twisted/test/test_main.py
+@@ -18,8 +18,14 @@ from twisted.trial.unittest import TestCase
+
+ class MainTests(TestCase):
+ """Test that twisted scripts can be invoked as modules."""
+- def test_twisted(self):
++ # this test just does not work correctly on Gentoo
++ # the output has '__main__.py' instead of 'trial'
++ # I have only been able to get 2.7 working correctly
++ # with replacing the value with what is expected.
++ def _test_twisted(self):
+ """Invoking python -m twisted should execute twist."""
++ if EMERGE_TEST_OVERRIDE:
++ return
+ cmd = sys.executable
+ p = Accumulator()
+ d = p.endedDeferred = defer.Deferred()
+diff --git a/src/twisted/test/test_plugin.py b/src/twisted/test/test_plugin.py
+index a23caa72b..a6d61858c 100644
+--- a/src/twisted/test/test_plugin.py
++++ b/src/twisted/test/test_plugin.py
+@@ -29,6 +29,8 @@ else:
+ On python 2, import caches don't need to be invalidated.
+ """
+
++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
++
+
+
+ class ITestPlugin(Interface):
+@@ -327,6 +329,8 @@ class PluginTests(unittest.TestCase):
+ attainable, but an error should be logged to show that the cache
+ couldn't be updated.
+ """
++ if EMERGE_TEST_OVERRIDE:
++ return
+ # Generate the cache
+ plugin.getCache(self.module)
+
+@@ -580,6 +584,8 @@ class DeveloperSetupTests(unittest.TestCase):
+ provide useful coverage on Windows due to the different meaning of
+ "read-only directory".
+ """
++ if EMERGE_TEST_OVERRIDE:
++ return
+ self.unlockSystem()
+ self.sysplug.child('newstuff.py').setContent(pluginFileContents('one'))
+ self.lockSystem()
+diff --git a/src/twisted/test/test_policies.py b/src/twisted/test/test_policies.py
+index 3d92633d6..c08809a66 100644
+--- a/src/twisted/test/test_policies.py
++++ b/src/twisted/test/test_policies.py
+@@ -7,6 +7,8 @@ Test code for policies.
+
+ from __future__ import division, absolute_import
+
++import os
++
+ from zope.interface import Interface, implementer, implementedBy
+
+ from twisted.python.compat import NativeStringIO
+@@ -23,6 +25,7 @@ try:
+ except ImportError:
+ import __builtin__ as builtins
+
++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
+
+
+ class SimpleProtocol(protocol.Protocol):
+@@ -883,6 +886,8 @@ class LoggingFactoryTests(unittest.TestCase):
+ automatically opens a unique log file for that protocol and attaches
+ the logfile to the built protocol.
+ """
++ if EMERGE_TEST_OVERRIDE:
++ return
+ open_calls = []
+ open_rvalues = []
+
+diff --git a/src/twisted/test/test_reflect.py b/src/twisted/test/test_reflect.py
+index 5348fc65e..2f431cef7 100644
+--- a/src/twisted/test/test_reflect.py
++++ b/src/twisted/test/test_reflect.py
+@@ -551,7 +551,8 @@ class SafeStrTests(TestCase):
+ value unchanged.
+ """
+ x = b't\xc3\xbcst'
+- self.assertEqual(reflect.safe_str(x), x)
++ y = [b't\xc3\xbcst', b't\\xfcst']
++ self.assertEqual(reflect.safe_str(x) in y, True)
+
+
+ def test_workingUtf8_3(self):
+diff --git a/src/twisted/test/test_twistd.py b/src/twisted/test/test_twistd.py
+index 04dc83600..654f8cba3 100644
+--- a/src/twisted/test/test_twistd.py
++++ b/src/twisted/test/test_twistd.py
+@@ -78,6 +78,7 @@ if getattr(os, 'setuid', None) is None:
+ else:
+ setuidSkip = None
+
++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
+
+
+ def patchUserDatabase(patch, user, uid, group, gid):
+@@ -1778,9 +1779,12 @@ class DaemonizeTests(unittest.TestCase):
+ message is Unicode, the child encodes the message as ascii
+ with backslash Unicode code points.
+ """
+- self.assertErrorWritten(raised=u"\u2022",
+- reported=b'1 RuntimeError: \\u2022')
+-
++ if _PY3:
++ self.assertErrorWritten(raised=u"\u2022",
++ reported=b'1 RuntimeError: \\u2022')
++ else:
++ self.assertErrorWritten(raised=u"\u2022",
++ reported=b'1 RuntimeError: \xe2\x80\xa2')
+
+
+ def assertErrorInParentBehavior(self, readData, errorMessage,
+@@ -1879,10 +1883,13 @@ class DaemonizeTests(unittest.TestCase):
+ unicode and too long, it's truncated by the child, even if
+ this splits a unicode escape sequence.
+ """
+- self.assertErrorWritten(
+- raised=u"\u2022" * 30,
+- reported=b'1 RuntimeError: ' + b'\\u2022' * 14,
+- )
++ if not EMERGE_TEST_OVERRIDE or _PY3:
++ self.assertErrorWritten(
++ raised=u"\u2022" * 30,
++ reported=b'1 RuntimeError: ' + b'\\u2022' * 14,
++ )
++ else:
++ pass
+
+
+ def test_hooksCalled(self):
+diff --git a/src/twisted/test/test_udp.py b/src/twisted/test/test_udp.py
+index 6cf4583b2..86b513704 100644
+--- a/src/twisted/test/test_udp.py
++++ b/src/twisted/test/test_udp.py
+@@ -8,6 +8,8 @@ Tests for implementations of L{IReactorUDP} and L{IReactorMulticast}.
+
+ from __future__ import division, absolute_import
+
++import os
++
+ from twisted.trial import unittest
+
+ from twisted.python.compat import intToBytes
+@@ -15,6 +17,8 @@ from twisted.internet.defer import Deferred, gatherResults, maybeDeferred
+ from twisted.internet import protocol, reactor, error, defer, interfaces, udp
+ from twisted.python import runtime
+
++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
++
+
+ class Mixin:
+
+@@ -699,3 +703,5 @@ if not interfaces.IReactorUDP(reactor, None):
+ ReactorShutdownInteractionTests.skip = "This reactor does not support UDP"
+ if not interfaces.IReactorMulticast(reactor, None):
+ MulticastTests.skip = "This reactor does not support multicast"
++elif EMERGE_TEST_OVERRIDE:
++ MulticastTests.skip = "This reactor test does not work via FEATURES=test emerge twisted"
+--
+2.12.1
+
diff --git a/dev-python/twisted/twisted-16.6.0.ebuild b/dev-python/twisted/twisted-16.6.0.ebuild
new file mode 100644
index 00000000000..e1cc29b4e30
--- /dev/null
+++ b/dev-python/twisted/twisted-16.6.0.ebuild
@@ -0,0 +1,151 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 python3_{4,5,6})
+PYTHON_REQ_USE="threads(+)"
+TWISTED_PN="Twisted"
+#DISTUTILS_IN_SOURCE_BUILD="yes"
+
+inherit eutils flag-o-matic twisted-r1
+
+DESCRIPTION="An asynchronous networking framework written in Python"
+SRC_URI="http://twistedmatrix.com/Releases/${TWISTED_PN}"
+SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2"
+
+# Dropped keywords due to new deps not keyworded
+#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86 ~x86-fbsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~x86"
+IUSE="conch crypt http2 serial +soap test"
+
+RDEPEND=">=dev-python/zope-interface-4.0.2[${PYTHON_USEDEP}]
+ conch? (
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
+ >=dev-python/appdirs-1.4.0[${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[${PYTHON_USEDEP}] )
+ soap? ( $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7) )
+ http2? (
+ >=dev-python/hyper-h2-2.5.0[${PYTHON_USEDEP}]
+ <dev-python/hyper-h2-3.0.0[${PYTHON_USEDEP}]
+ >=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
+ <dev-python/priority-2.0[${PYTHON_USEDEP}]
+ )
+ >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
+ !dev-python/twisted-core
+ !dev-python/twisted-conch
+ !dev-python/twisted-lore
+ !dev-python/twisted-mail
+ !dev-python/twisted-names
+ !dev-python/twisted-news
+ !dev-python/twisted-pair
+ !dev-python/twisted-runner
+ !dev-python/twisted-words
+ !dev-python/twisted-web
+"
+DEPEND="
+ >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}]
+ test? (
+ dev-python/gmpy[${PYTHON_USEDEP}]
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
+ >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+ >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
+ dev-python/service_identity[${PYTHON_USEDEP}]
+ dev-python/idna[${PYTHON_USEDEP}]
+ dev-python/pyserial[${PYTHON_USEDEP}]
+ >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ # Respect TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE variable.
+ "${FILESDIR}/${PN}-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch"
+ "${FILESDIR}/${PN}-16.6.0-test-fixes.patch"
+)
+
+python_prepare_all() {
+ # disable tests that don't work in our sandbox
+ # and other test failures due to our conditions
+ if use test ; then
+ # Remove since this is an upstream distribution test for making releases
+ rm src/twisted/python/test/test_release.py || die "rm src/twisted/python/test/test_release.py FAILED"
+ fi
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ if ! python_is_python3; then
+ # Needed to make the sendmsg extension work
+ # (see http://twistedmatrix.com/trac/ticket/5701 )
+ local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
+ local -x CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
+ fi
+
+ distutils-r1_python_compile
+}
+
+python_test() {
+ distutils_install_for_testing
+
+ export EMERGE_TEST_OVERRIDE=1
+ # workaround for the eclass not installing the entry points
+ # in the test environment. copy the old 16.3.2 start script
+ # to run the tests with
+ cp "${FILESDIR}"/trial "${TEST_DIR}"
+
+ pushd "${TEST_DIR}" > /dev/null || die
+
+ if ! "${TEST_DIR}"/trial twisted; then
+ die "Tests failed with ${EPYTHON}"
+ fi
+
+ popd > /dev/null || die
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ cd "${D%/}$(python_get_sitedir)" || die
+
+ # create 'Twisted' egg wrt bug #299736
+ #local egg=( Twisted_Core*.egg-info )
+ #[[ -f ${egg[0]} ]] || die "Twisted_Core*.egg-info not found"
+ #ln -s "${egg[0]}" "${egg[0]/_Core/}" || die
+
+ # own the dropin.cache so we don't leave orphans
+ touch twisted/plugins/dropin.cache || die
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ newconfd "${FILESDIR}/twistd.conf" twistd
+ newinitd "${FILESDIR}/twistd.init" twistd
+}
+
+pkg_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"
+ einfo "There are a few known python-2.7 errors due to some unicode issues"
+ einfo "which are different in Gentoo installed python-2.7"
+}
+
+pkg_postrm(){
+ # pre portage-2.3.2 release workaround for bug 595028
+ cd "${HOME}"
+ _distutils-r1_run_foreach_impl twisted-r1_update_plugin_cache
+}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2017-10-27 2:29 Brian Dolbec
0 siblings, 0 replies; 17+ messages in thread
From: Brian Dolbec @ 2017-10-27 2:29 UTC (permalink / raw
To: gentoo-commits
commit: 8015b0a9993dbfd6fa9eccee0e80bd814e3aa3ac
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 26 00:52:13 2017 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Oct 27 02:28:19 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8015b0a9
dev-python/twisted: Version bump. Addtional test fixes...
Package-Manager: Portage-2.3.12, Repoman-2.3.4
dev-python/twisted/Manifest | 1 +
.../twisted-17.9.0-Fix-test-on-Python-363.patch | 74 ++++++++
.../files/twisted-17.9.0-python-27-utf-8-fix.patch | 47 +++++
dev-python/twisted/twisted-17.9.0.ebuild | 189 +++++++++++++++++++++
4 files changed, 311 insertions(+)
diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index 87a466dea7e..8c4b8cc3e24 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,4 +1,5 @@
DIST Twisted-16.6.0.tar.bz2 2979747 SHA256 d0fe115ea7ef8cf632d05103de60356c6e992b2153d6830bdc4476f8accb1fca SHA512 0b8de0ec7f64457f76c396fced64b366b8e63c6e000a5edc6c6388cd917fb2f95711918cd8edda39e0aa77e2cd32b5d775d23630a5ad10fc013c18f8316300cf WHIRLPOOL a09a8747312580e3b27d222bf0942b714ad041044a817876e1731c5fa2ae3d11e4d5a45221d2e7d126ebb664730d15c886d5ae164841c7a8f0acd6e12c4691a9
DIST Twisted-17.1.0.tar.bz2 2997334 SHA256 dbf211d70afe5b4442e3933ff01859533eba9f13d8b3e2e1b97dc2125e2d44dc SHA512 e5eedc9a70b7e4d0ec18dddaa82aa9a784e96fd517db65c278d822d15e8bdc65a35307a5a0474eb68dcb73fcd5508086bec605580a9f2f767bcbe27d714b4966 WHIRLPOOL 828a939134df47950a285c732867b3d4172e5e86a75fbdc1cc4365b5a24699a0b3fcb573b7e3d389eea591fc9fc79456c09f2d2c8f08d7e1215dc5761e88ed8e
DIST Twisted-17.5.0.tar.bz2 2993816 SHA256 f198a494f0df2482f7c5f99d7f3eef33d22763ffc76641b36fec476b878002ea SHA512 0fd10e5db7c87daf0d2225cec9929f1040f0c67e9605bfb1a5bc84db8b825e943cfa08e094c32c25c680bddc6587bfdc525a994ad7b785396e5ddb2621649379 WHIRLPOOL 28a0578545d525b5239a897229904489c38fa1e7148f374c96e66d3071f8dcd861aa5b772b338e5aaa9e92cc4d0f19a1598136bc2f9a9173b2489f6ec7fb391d
+DIST Twisted-17.9.0.tar.bz2 3019243 SHA256 0da1a7e35d5fcae37bc9c7978970b5feb3bc82822155b8654ec63925c05af75c SHA512 0fb854db1044bfdb208594a379a0f8df0193326a9974e193266e82113488d49220648d4a50b323fa144654e94976f5848e1d60efed13ab2668b02cc795720345 WHIRLPOOL d0fa84debe9524a25b9d4e737083740c68cb80a1ab3cc2379e336ded591d85ca62b151752fdff32931788e800df17e13dd5343c4f6fec793b9940f650cee38e5
DIST twisted-regen-cache.gz 911 SHA256 e88fb326c0e24506d59afa3a4113e63c3e496fa1114156db6521f84fbce41652 SHA512 95a9b931c73017d16d1b5e6b41345dddffe62b6af1a8e93b5e40d06d3d15be17b0dd0181c767ffeeb791534d463764ef9e066fa6c2ee2ac4b53c86d1da8fce03 WHIRLPOOL 8077fc4d102bb8071e3163c386edf10c14a2cf0c8bbbf57c66787bdeb9b5f21115bcb022a770fe72b48914d829ff69384684f50928700f83547702d6a0d35423
diff --git a/dev-python/twisted/files/twisted-17.9.0-Fix-test-on-Python-363.patch b/dev-python/twisted/files/twisted-17.9.0-Fix-test-on-Python-363.patch
new file mode 100644
index 00000000000..ea7a480abac
--- /dev/null
+++ b/dev-python/twisted/files/twisted-17.9.0-Fix-test-on-Python-363.patch
@@ -0,0 +1,74 @@
+From e58956fe12af7b41f6c1735ba7b14cba69e82a5e Mon Sep 17 00:00:00 2001
+From: Craig Rodrigues <rodrigc@FreeBSD.org>
+Date: Fri, 6 Oct 2017 02:47:55 -0700
+Subject: [PATCH] Fix test on Python 3.6.3
+
+---
+ src/twisted/test/test_sslverify.py | 53 +++++++++++++++++++++++++++++------------------------
+ 1 file changed, 29 insertions(+), 24 deletions(-)
+
+diff --git a/src/twisted/test/test_sslverify.py b/src/twisted/test/test_sslverify.py
+index aca56f5..3fdc480 100644
+--- a/src/twisted/test/test_sslverify.py
++++ b/src/twisted/test/test_sslverify.py
+@@ -3052,28 +3052,33 @@ class SelectVerifyImplementationTests(unittest.SynchronousTestCase):
+ in self.flushWarnings()
+ if warning["category"] == UserWarning)
+
+- if _PY3:
+- importError = (
+- "'import of 'service_identity' halted; None in sys.modules'")
+- else:
+- importError = "'No module named service_identity'"
+-
+- expectedMessage = (
+- "You do not have a working installation of the "
+- "service_identity module: {message}. Please install it from "
+- "<https://pypi.python.org/pypi/service_identity> "
+- "and make sure all of its dependencies are satisfied. "
+- "Without the service_identity module, Twisted can perform only "
+- "rudimentary TLS client hostname verification. Many valid "
+- "certificate/hostname mappings may be rejected.").format(
+- message=importError)
++ importErrors =[
++ # Python 3.6.3
++ "'import of service_identity halted; None in sys.modules'",
++ # Python 3
++ "'import of 'service_identity' halted; None in sys.modules'",
++ # Python 2
++ "'No module named service_identity'"
++ ]
+
+- self.assertEqual(
+- (warning["message"], warning["filename"], warning["lineno"]),
+-
+- # Make sure we're abusing the warning system to a sufficient
+- # degree: there is no filename or line number that makes sense for
+- # this warning to "blame" for the problem. It is a system
+- # misconfiguration. So the location information should be blank
+- # (or as blank as we can make it).
+- (expectedMessage, "", 0))
++ expectedMessages = []
++ for importError in importErrors:
++ expectedMessages.append(
++ "You do not have a working installation of the "
++ "service_identity module: {message}. Please install it from "
++ "<https://pypi.python.org/pypi/service_identity> "
++ "and make sure all of its dependencies are satisfied. "
++ "Without the service_identity module, Twisted can perform only"
++ " rudimentary TLS client hostname verification. Many valid "
++ "certificate/hostname mappings may be rejected.".format(
++ message=importError))
++
++ self.assertIn(warning["message"], expectedMessages)
++
++ # Make sure we're abusing the warning system to a sufficient
++ # degree: there is no filename or line number that makes sense for
++ # this warning to "blame" for the problem. It is a system
++ # misconfiguration. So the location information should be blank
++ # (or as blank as we can make it).
++ self.assertEqual(warning["filename"], "")
++ self.assertEqual(warning["lineno"], 0)
+--
+libgit2 0.26.0
+
diff --git a/dev-python/twisted/files/twisted-17.9.0-python-27-utf-8-fix.patch b/dev-python/twisted/files/twisted-17.9.0-python-27-utf-8-fix.patch
new file mode 100644
index 00000000000..7e3ec26bcfd
--- /dev/null
+++ b/dev-python/twisted/files/twisted-17.9.0-python-27-utf-8-fix.patch
@@ -0,0 +1,47 @@
+From c7db4c055e92509e5c19a051cbebea53034994ba Mon Sep 17 00:00:00 2001
+From: Brian Dolbec <bdolbec@gaikai.com>
+Date: Wed, 25 Oct 2017 14:39:57 -0700
+Subject: [PATCH] python-2.7 utf-8 fixes
+
+---
+ src/twisted/test/test_twistd.py | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/src/twisted/test/test_twistd.py b/src/twisted/test/test_twistd.py
+index 3a9d337..4b0cf28 100644
+--- a/src/twisted/test/test_twistd.py
++++ b/src/twisted/test/test_twistd.py
+@@ -1902,8 +1902,12 @@ class DaemonizeTests(unittest.TestCase):
+ message is Unicode, the child encodes the message as ascii
+ with backslash Unicode code points.
+ """
++ if sys.hexversion >= 0x3000000:
++ reported_str = b'\u2022'
++ else:
++ reported_str = b'\xe2\x80\xa2'
+ self.assertErrorWritten(raised=u"\u2022",
+- reported=b'1 RuntimeError: \\u2022')
++ reported=b'1 RuntimeError: ' + reported_str)
+
+
+
+@@ -2003,9 +2007,15 @@ class DaemonizeTests(unittest.TestCase):
+ unicode and too long, it's truncated by the child, even if
+ this splits a unicode escape sequence.
+ """
++ if sys.hexversion >= 0x3000000:
++ reported_str = b'\\u2022'
++ length = 14
++ else:
++ reported_str = b'\xe2\x80\xa2'
++ length = 28
+ self.assertErrorWritten(
+ raised=u"\u2022" * 30,
+- reported=b'1 RuntimeError: ' + b'\\u2022' * 14,
++ reported=b'1 RuntimeError: ' + reported_str * length,
+ )
+
+
+--
+libgit2 0.26.0
+
diff --git a/dev-python/twisted/twisted-17.9.0.ebuild b/dev-python/twisted/twisted-17.9.0.ebuild
new file mode 100644
index 00000000000..0569d8490d0
--- /dev/null
+++ b/dev-python/twisted/twisted-17.9.0.ebuild
@@ -0,0 +1,189 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 python3_{4,5,6})
+PYTHON_REQ_USE="threads(+)"
+
+inherit eutils flag-o-matic distutils-r1 versionator
+
+TWISTED_PN="Twisted"
+TWISTED_P="${TWISTED_PN}-${PV}"
+TWISTED_RELEASE=$(get_version_component_range 1-2 "${PV}")
+
+DESCRIPTION="An asynchronous networking framework written in Python"
+HOMEPAGE="http://www.twistedmatrix.com/"
+SRC_URI="http://twistedmatrix.com/Releases/${TWISTED_PN}"
+SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2
+ https://dev.gentoo.org/~mgorny/dist/twisted-regen-cache.gz"
+
+# Dropped keywords due to new deps not keyworded
+#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86 ~x86-fbsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~x86"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="conch crypt http2 serial +soap test"
+
+# openssh-7.6_p1 test failures: bug https://twistedmatrix.com/trac/ticket/9311
+RDEPEND="
+ >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}]
+ >=dev-python/zope-interface-4.0.2[${PYTHON_USEDEP}]
+ conch? (
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-1.5.0[${PYTHON_USEDEP}]
+ >=dev-python/appdirs-1.4.0[${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}] )
+ soap? ( $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7) )
+ http2? (
+ >=dev-python/hyper-h2-3.0.0[${PYTHON_USEDEP}]
+ <dev-python/hyper-h2-4.0.0[${PYTHON_USEDEP}]
+ >=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
+ <dev-python/priority-2.0[${PYTHON_USEDEP}]
+ )
+ >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
+ >=dev-python/automat-0.3.0[${PYTHON_USEDEP}]
+ >=dev-python/hyperlink-17.1.1[${PYTHON_USEDEP}]
+ !dev-python/twisted-core
+ !dev-python/twisted-conch
+ !dev-python/twisted-lore
+ !dev-python/twisted-mail
+ !dev-python/twisted-names
+ !dev-python/twisted-news
+ !dev-python/twisted-pair
+ !dev-python/twisted-runner
+ !dev-python/twisted-words
+ !dev-python/twisted-web
+"
+DEPEND="
+ >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}]
+ test? (
+ dev-python/gmpy[${PYTHON_USEDEP}]
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
+ >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+ >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
+ dev-python/service_identity[${PYTHON_USEDEP}]
+ dev-python/idna[${PYTHON_USEDEP}]
+ dev-python/pyserial[${PYTHON_USEDEP}]
+ >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
+ <net-misc/openssh-7.6
+ )
+"
+
+PATCHES=(
+ # ${PN}-17.9.0-Fix-test-on-Python-363.patch" <== version specific from upstream
+ # Respect TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE variable.
+ "${FILESDIR}/${PN}-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch"
+ "${FILESDIR}/test_main.patch"
+ "${FILESDIR}/utf8_overrides.patch"
+ "${FILESDIR}/${PN}-16.6.0-test-fixes.patch"
+ "${FILESDIR}/${PN}-17.9.0-python-27-utf-8-fix.patch"
+ "${FILESDIR}/${PN}-17.9.0-Fix-test-on-Python-363.patch"
+)
+
+S=${WORKDIR}/${TWISTED_P}
+
+python_prepare_all() {
+ # disable tests that don't work in our sandbox
+ # and other test failures due to our conditions
+ if use test ; then
+ # Remove since this is an upstream distribution test for making releases
+ rm src/twisted/python/test/test_release.py || die "rm src/twisted/python/test/test_release.py FAILED"
+ fi
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ if ! python_is_python3; then
+ # Needed to make the sendmsg extension work
+ # (see http://twistedmatrix.com/trac/ticket/5701 )
+ local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
+ local -x CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
+ fi
+
+ distutils-r1_python_compile
+}
+
+python_test() {
+ distutils_install_for_testing
+
+ export EMERGE_TEST_OVERRIDE=1
+ export UTF8_OVERRIDES=1
+ unset TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE
+ # workaround for the eclass not installing the entry points
+ # in the test environment. copy the old 16.3.2 start script
+ # to run the tests with
+ cp "${FILESDIR}"/trial "${TEST_DIR}"
+
+ pushd "${TEST_DIR}" > /dev/null || die
+
+ if ! "${TEST_DIR}"/trial twisted; then
+ die "Tests failed with ${EPYTHON}"
+ fi
+ # due to an anomoly in the tests, python doesn't return the correct form
+ # of the escape sequence. So run those test separately with a clean python interpreter
+ export UTF8_OVERRIDES=0
+ if ! "${TEST_DIR}"/trial twisted.test.test_twistd.DaemonizeTests; then
+ die "DaemonizeTests failed with ${EPYTHON}"
+ fi
+ if ! "${TEST_DIR}"/trial twisted.test.test_reflect.SafeStrTests; then
+ die "SafeStrTests failed with ${EPYTHON}"
+ fi
+
+ popd > /dev/null || die
+}
+
+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
+
+ 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
+}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2018-07-07 19:03 Brian Dolbec
0 siblings, 0 replies; 17+ messages in thread
From: Brian Dolbec @ 2018-07-07 19:03 UTC (permalink / raw
To: gentoo-commits
commit: dea4b4c84f77aa059cf903cd4d9a9bd1b6e9695c
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 7 19:01:15 2018 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Jul 7 19:02:07 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dea4b4c8
dev-python/twisted: Version and eapi bump
Package-Manager: Portage-2.3.40, Repoman-2.3.9
dev-python/twisted/Manifest | 1 +
...ed-18.4.0-Disable-writing-of-plugin-cache.patch | 25 +++
dev-python/twisted/twisted-18.4.0.ebuild | 188 +++++++++++++++++++++
3 files changed, 214 insertions(+)
diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index 2d7cf02be58..015a3c4b13e 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,4 +1,5 @@
DIST Twisted-16.6.0.tar.bz2 2979747 BLAKE2B 898e0a0fa3ae8547a801b09118423ec8ad80727dd6d034e3f8a151f084eff5a3fc560f2eb9e76c452a14ec90b36d93e14d3bbb388010c3c5c01fd1c4d5ca16bb SHA512 0b8de0ec7f64457f76c396fced64b366b8e63c6e000a5edc6c6388cd917fb2f95711918cd8edda39e0aa77e2cd32b5d775d23630a5ad10fc013c18f8316300cf
DIST Twisted-17.1.0.tar.bz2 2997334 BLAKE2B 54bd9813fb265f3561be7bc42a3ca6fc36aa5f8553ff0f40fd4ba7939947015632ef91c011a088b511d9f3f262aa0a785467ad3e4fab00cc97cb85bdbd93a726 SHA512 e5eedc9a70b7e4d0ec18dddaa82aa9a784e96fd517db65c278d822d15e8bdc65a35307a5a0474eb68dcb73fcd5508086bec605580a9f2f767bcbe27d714b4966
DIST Twisted-17.9.0.tar.bz2 3019243 BLAKE2B a79fade6c84a99303df803ad80f02c63562e7064d5b79db39c08bd0ac9a62d61f1388932b36348aa106aa409a51b2d49dc0eb5b1007ce10f196a34c2f963b8e5 SHA512 0fb854db1044bfdb208594a379a0f8df0193326a9974e193266e82113488d49220648d4a50b323fa144654e94976f5848e1d60efed13ab2668b02cc795720345
+DIST Twisted-18.4.0.tar.bz2 3037019 BLAKE2B 6fc32f7591493ccc4fe03233307b566899b82cd035ba3329b3faaf950339a6653de697ba3873b37b22f9d7f8a66109694b80496917bf61e79c56eeb7e351ac87 SHA512 3733a6df0196ea580187da3576f5fd08f287437528a4e19813056d019cca213c61b62d879d80a12eef38661d3505ba33aac9a4fc956b19afa6da7d37a6465c83
DIST twisted-regen-cache.gz 911 BLAKE2B ffd3fcda6c67ffe6fd3ef581c8d507548396b66ed0708e9a5c790095e579c0d5f0f71596acf05712989da2ddef2b8d437eca973bc4d80ef8a9fa852915f38305 SHA512 95a9b931c73017d16d1b5e6b41345dddffe62b6af1a8e93b5e40d06d3d15be17b0dd0181c767ffeeb791534d463764ef9e066fa6c2ee2ac4b53c86d1da8fce03
diff --git a/dev-python/twisted/files/twisted-18.4.0-Disable-writing-of-plugin-cache.patch b/dev-python/twisted/files/twisted-18.4.0-Disable-writing-of-plugin-cache.patch
new file mode 100644
index 00000000000..318304e58df
--- /dev/null
+++ b/dev-python/twisted/files/twisted-18.4.0-Disable-writing-of-plugin-cache.patch
@@ -0,0 +1,25 @@
+From cac07e9ef273b065eeebbeeaa27155c8402a36e1 Mon Sep 17 00:00:00 2001
+From: Brian Dolbec <dolsen@gentoo.org>
+Date: Sat, 7 Jul 2018 11:37:23 -0700
+Subject: [PATCH] Disable writing of plugin cache
+
+---
+ src/twisted/plugin.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/twisted/plugin.py b/src/twisted/plugin.py
+index 82522ee..e5849d6 100644
+--- a/src/twisted/plugin.py
++++ b/src/twisted/plugin.py
+@@ -180,7 +180,7 @@ def getCache(module):
+ if pluginKey not in existingKeys:
+ del dropinDotCache[pluginKey]
+ needsWrite = True
+- if needsWrite:
++ if needsWrite and os.environ.get("TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE") is None:
+ try:
+ dropinPath.setContent(pickle.dumps(dropinDotCache))
+ except OSError as e:
+--
+libgit2 0.26.4
+
diff --git a/dev-python/twisted/twisted-18.4.0.ebuild b/dev-python/twisted/twisted-18.4.0.ebuild
new file mode 100644
index 00000000000..422d62baa9d
--- /dev/null
+++ b/dev-python/twisted/twisted-18.4.0.ebuild
@@ -0,0 +1,188 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python2_7 python3_{4,5,6})
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1
+
+TWISTED_PN="Twisted"
+TWISTED_P="${TWISTED_PN}-${PV}"
+TWISTED_RELEASE=$(ver_cut 1-2)
+
+DESCRIPTION="An asynchronous networking framework written in Python"
+HOMEPAGE="https://www.twistedmatrix.com/trac/"
+SRC_URI="https://twistedmatrix.com/Releases/${TWISTED_PN}"
+SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2
+ https://dev.gentoo.org/~mgorny/dist/twisted-regen-cache.gz"
+
+# Dropped keywords due to new deps not keyworded
+#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86 ~x86-fbsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~x86 ~amd64-fbsd"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="conch crypt http2 serial +soap test"
+
+# openssh-7.6_p1 test failures: bug https://twistedmatrix.com/trac/ticket/9311
+RDEPEND="
+ >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}]
+ >=dev-python/zope-interface-4.4.2[${PYTHON_USEDEP}]
+ conch? (
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-1.5.0[${PYTHON_USEDEP}]
+ >=dev-python/appdirs-1.4.0[${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}] )
+ soap? ( $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7) )
+ http2? (
+ >=dev-python/hyper-h2-3.0.0[${PYTHON_USEDEP}]
+ <dev-python/hyper-h2-4.0.0[${PYTHON_USEDEP}]
+ >=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
+ <dev-python/priority-2.0[${PYTHON_USEDEP}]
+ )
+ >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
+ >=dev-python/automat-0.3.0[${PYTHON_USEDEP}]
+ >=dev-python/hyperlink-17.1.1[${PYTHON_USEDEP}]
+ !dev-python/twisted-core
+ !dev-python/twisted-conch
+ !dev-python/twisted-lore
+ !dev-python/twisted-mail
+ !dev-python/twisted-names
+ !dev-python/twisted-news
+ !dev-python/twisted-pair
+ !dev-python/twisted-runner
+ !dev-python/twisted-words
+ !dev-python/twisted-web
+"
+DEPEND="
+ >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}]
+ test? (
+ dev-python/gmpy[${PYTHON_USEDEP}]
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
+ >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+ >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
+ dev-python/service_identity[${PYTHON_USEDEP}]
+ dev-python/idna[${PYTHON_USEDEP}]
+ dev-python/pyserial[${PYTHON_USEDEP}]
+ >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
+ <net-misc/openssh-7.6
+ )
+"
+
+PATCHES=(
+ # ${PN}-17.9.0-Fix-test-on-Python-363.patch" <== version specific from upstream
+ # Respect TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE variable.
+ "${FILESDIR}/${PN}-18.4.0-Disable-writing-of-plugin-cache.patch"
+ "${FILESDIR}/test_main.patch"
+ "${FILESDIR}/utf8_overrides.patch"
+ "${FILESDIR}/${PN}-16.6.0-test-fixes.patch"
+ "${FILESDIR}/${PN}-17.9.0-python-27-utf-8-fix.patch"
+)
+
+S=${WORKDIR}/${TWISTED_P}
+
+python_prepare_all() {
+ # disable tests that don't work in our sandbox
+ # and other test failures due to our conditions
+ if use test ; then
+ # Remove since this is an upstream distribution test for making releases
+ rm src/twisted/python/test/test_release.py || die "rm src/twisted/python/test/test_release.py FAILED"
+ fi
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ if ! python_is_python3; then
+ # Needed to make the sendmsg extension work
+ # (see https://twistedmatrix.com/trac/ticket/5701 )
+ local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
+ local -x CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
+ fi
+
+ distutils-r1_python_compile
+}
+
+python_test() {
+ distutils_install_for_testing
+
+ export EMERGE_TEST_OVERRIDE=1
+ export UTF8_OVERRIDES=1
+ unset TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE
+ # workaround for the eclass not installing the entry points
+ # in the test environment. copy the old 16.3.2 start script
+ # to run the tests with
+ cp "${FILESDIR}"/trial "${TEST_DIR}"
+
+ pushd "${TEST_DIR}" > /dev/null || die
+
+ if ! "${TEST_DIR}"/trial twisted; then
+ die "Tests failed with ${EPYTHON}"
+ fi
+ # due to an anomoly in the tests, python doesn't return the correct form
+ # of the escape sequence. So run those test separately with a clean python interpreter
+ export UTF8_OVERRIDES=0
+ if ! "${TEST_DIR}"/trial twisted.test.test_twistd.DaemonizeTests; then
+ die "DaemonizeTests failed with ${EPYTHON}"
+ fi
+ if ! "${TEST_DIR}"/trial twisted.test.test_reflect.SafeStrTests; then
+ die "SafeStrTests failed with ${EPYTHON}"
+ fi
+
+ popd > /dev/null || die
+}
+
+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
+
+ 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
+}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2020-04-24 19:24 Michał Górny
0 siblings, 0 replies; 17+ messages in thread
From: Michał Górny @ 2020-04-24 19:24 UTC (permalink / raw
To: gentoo-commits
commit: d8fd31b8c0576c4e32decfc907293175d131a2f3
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 24 19:23:35 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Apr 24 19:24:24 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8fd31b8
dev-python/twisted: Backport py3.8 fixes to 20.3.0
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
.../twisted/files/twisted-20.3.0-py38-cgi.patch | 259 +++++++++++++++++++++
.../twisted/files/twisted-20.3.0-py38-hmac.patch | 94 ++++++++
dev-python/twisted/twisted-20.3.0.ebuild | 5 +
3 files changed, 358 insertions(+)
diff --git a/dev-python/twisted/files/twisted-20.3.0-py38-cgi.patch b/dev-python/twisted/files/twisted-20.3.0-py38-cgi.patch
new file mode 100644
index 00000000000..5151f297f7f
--- /dev/null
+++ b/dev-python/twisted/files/twisted-20.3.0-py38-cgi.patch
@@ -0,0 +1,259 @@
+From 62ab0203c59c1f9788c53dfad4a212774094d05c Mon Sep 17 00:00:00 2001
+From: Craig Rodrigues <rodrigc@FreeBSD.org>
+Date: Mon, 13 Apr 2020 01:22:23 -0700
+Subject: [PATCH 2/2] Merge 9801-rodrigc-cgi: Change import of cgi.parse_qs to
+ urllib.parse.parse_qs
+
+Author: rodrigc
+Reviewer: hawkowl
+Fixes: ticket:9801
+---
+ src/twisted/web/client.py | 17 ++++-----
+ src/twisted/web/http.py | 49 ++++++++++++-------------
+ src/twisted/web/newsfragments/9801.misc | 0
+ src/twisted/web/test/test_http.py | 41 +++------------------
+ src/twisted/web/test/test_webclient.py | 5 +--
+ 5 files changed, 38 insertions(+), 74 deletions(-)
+ create mode 100644 src/twisted/web/newsfragments/9801.misc
+
+diff --git a/src/twisted/web/client.py b/src/twisted/web/client.py
+index 7e4642ef3..8209f5a5e 100644
+--- a/src/twisted/web/client.py
++++ b/src/twisted/web/client.py
+@@ -12,15 +12,8 @@ import os
+ import collections
+ import warnings
+
+-try:
+- from urlparse import urlunparse, urljoin, urldefrag
+-except ImportError:
+- from urllib.parse import urljoin, urldefrag
+- from urllib.parse import urlunparse as _urlunparse
+-
+- def urlunparse(parts):
+- result = _urlunparse(tuple([p.decode("charmap") for p in parts]))
+- return result.encode("charmap")
++from urllib.parse import urljoin, urldefrag
++from urllib.parse import urlunparse as _urlunparse
+
+ import zlib
+ from functools import wraps
+@@ -51,6 +44,12 @@ from twisted.web._newclient import _ensureValidURI, _ensureValidMethod
+
+
+
++def urlunparse(parts):
++ result = _urlunparse(tuple([p.decode("charmap") for p in parts]))
++ return result.encode("charmap")
++
++
++
+ class PartialDownloadError(error.Error):
+ """
+ Page was only partially downloaded, we got disconnected in middle.
+diff --git a/src/twisted/web/http.py b/src/twisted/web/http.py
+index b7afa8b0d..94d0ae81f 100644
+--- a/src/twisted/web/http.py
++++ b/src/twisted/web/http.py
+@@ -66,27 +66,10 @@ import time
+ import calendar
+ import warnings
+ import os
+-from io import BytesIO as StringIO
+-
+-try:
+- from urlparse import (
+- ParseResult as ParseResultBytes, urlparse as _urlparse)
+- from urllib import unquote
+- from cgi import parse_header as _parseHeader
+-except ImportError:
+- from urllib.parse import (
+- ParseResultBytes, urlparse as _urlparse, unquote_to_bytes as unquote)
+-
+- def _parseHeader(line):
+- # cgi.parse_header requires a str
+- key, pdict = cgi.parse_header(line.decode('charmap'))
+-
+- # We want the key as bytes, and cgi.parse_multipart (which consumes
+- # pdict) expects a dict of str keys but bytes values
+- key = key.encode('charmap')
+- pdict = {x:y.encode('charmap') for x, y in pdict.items()}
+- return (key, pdict)
++from io import BytesIO
+
++from urllib.parse import (
++ ParseResultBytes, urlparse as _urlparse, unquote_to_bytes as unquote)
+
+ from zope.interface import Attribute, Interface, implementer, provider
+
+@@ -163,6 +146,20 @@ monthname = [None,
+ weekdayname_lower = [name.lower() for name in weekdayname]
+ monthname_lower = [name and name.lower() for name in monthname]
+
++
++
++def _parseHeader(line):
++ # cgi.parse_header requires a str
++ key, pdict = cgi.parse_header(line.decode('charmap'))
++
++ # We want the key as bytes, and cgi.parse_multipart (which consumes
++ # pdict) expects a dict of str keys but bytes values
++ key = key.encode('charmap')
++ pdict = {x: y.encode('charmap') for x, y in pdict.items()}
++ return (key, pdict)
++
++
++
+ def urlparse(url):
+ """
+ Parse an URL into six components.
+@@ -486,13 +483,15 @@ class _IDeprecatedHTTPChannelToRequestInterface(Interface):
+
+ class StringTransport:
+ """
+- I am a StringIO wrapper that conforms for the transport API. I support
++ I am a BytesIO wrapper that conforms for the transport API. I support
+ the `writeSequence' method.
+ """
+ def __init__(self):
+- self.s = StringIO()
++ self.s = BytesIO()
++
+ def writeSequence(self, seq):
+ self.s.write(b''.join(seq))
++
+ def __getattr__(self, attr):
+ return getattr(self.__dict__['s'], attr)
+
+@@ -513,7 +512,7 @@ class HTTPClient(basic.LineReceiver):
+ @type firstLine: C{bool}
+
+ @ivar __buffer: The buffer that stores the response to the HTTP request.
+- @type __buffer: A C{StringIO} object.
++ @type __buffer: A C{BytesIO} object.
+
+ @ivar _header: Part or all of an HTTP request header.
+ @type _header: C{bytes}
+@@ -579,7 +578,7 @@ class HTTPClient(basic.LineReceiver):
+ if self._header != b"":
+ # Only extract headers if there are any
+ self.extractHeader(self._header)
+- self.__buffer = StringIO()
++ self.__buffer = BytesIO()
+ self.handleEndHeaders()
+ self.setRawMode()
+ return
+@@ -665,7 +664,7 @@ def _getContentFile(length):
+ Get a writeable file-like object to which request content can be written.
+ """
+ if length is not None and length < 100000:
+- return StringIO()
++ return BytesIO()
+ return tempfile.TemporaryFile()
+
+
+diff --git a/src/twisted/web/newsfragments/9801.misc b/src/twisted/web/newsfragments/9801.misc
+new file mode 100644
+index 000000000..e69de29bb
+diff --git a/src/twisted/web/test/test_http.py b/src/twisted/web/test/test_http.py
+index a3067f732..4189b307c 100644
+--- a/src/twisted/web/test/test_http.py
++++ b/src/twisted/web/test/test_http.py
+@@ -9,15 +9,11 @@ from __future__ import absolute_import, division
+
+ import base64
+ import calendar
+-import cgi
+ import random
+
+ import hamcrest
+
+-try:
+- from urlparse import urlparse, urlunsplit, clear_cache
+-except ImportError:
+- from urllib.parse import urlparse, urlunsplit, clear_cache
++from urllib.parse import urlparse, urlunsplit, clear_cache, parse_qs
+
+ from io import BytesIO
+ from itertools import cycle
+@@ -28,7 +24,7 @@ from zope.interface import (
+ )
+ from zope.interface.verify import verifyObject
+
+-from twisted.python.compat import (_PY3, iterbytes, long, networkString,
++from twisted.python.compat import (iterbytes, long, networkString,
+ unicode, intToBytes)
+ from twisted.python.components import proxyForInterface
+ from twisted.python.failure import Failure
+@@ -2019,33 +2015,6 @@ Content-Type: application/x-www-form-urlencoded
+ self.assertEqual(content, [networkString(query)])
+
+
+- def test_missingContentDisposition(self):
+- """
+- If the C{Content-Disposition} header is missing, the request is denied
+- as a bad request.
+- """
+- req = b'''\
+-POST / HTTP/1.0
+-Content-Type: multipart/form-data; boundary=AaB03x
+-Content-Length: 103
+-
+---AaB03x
+-Content-Type: text/plain
+-Content-Transfer-Encoding: quoted-printable
+-
+-abasdfg
+---AaB03x--
+-'''
+- channel = self.runRequest(req, http.Request, success=False)
+- self.assertEqual(
+- channel.transport.value(),
+- b"HTTP/1.1 400 Bad Request\r\n\r\n")
+-
+- if _PY3:
+- test_missingContentDisposition.skip = (
+- "cgi.parse_multipart is much more error-tolerant on Python 3.")
+-
+-
+ def test_multipartProcessingFailure(self):
+ """
+ When the multipart processing fails the client gets a 400 Bad Request.
+@@ -2373,15 +2342,15 @@ ok
+ class QueryArgumentsTests(unittest.TestCase):
+ def testParseqs(self):
+ self.assertEqual(
+- cgi.parse_qs(b"a=b&d=c;+=f"),
++ parse_qs(b"a=b&d=c;+=f"),
+ http.parse_qs(b"a=b&d=c;+=f"))
+ self.assertRaises(
+ ValueError, http.parse_qs, b"blah", strict_parsing=True)
+ self.assertEqual(
+- cgi.parse_qs(b"a=&b=c", keep_blank_values=1),
++ parse_qs(b"a=&b=c", keep_blank_values=1),
+ http.parse_qs(b"a=&b=c", keep_blank_values=1))
+ self.assertEqual(
+- cgi.parse_qs(b"a=&b=c"),
++ parse_qs(b"a=&b=c"),
+ http.parse_qs(b"a=&b=c"))
+
+
+diff --git a/src/twisted/web/test/test_webclient.py b/src/twisted/web/test/test_webclient.py
+index 680e02780..672594993 100644
+--- a/src/twisted/web/test/test_webclient.py
++++ b/src/twisted/web/test/test_webclient.py
+@@ -11,10 +11,7 @@ import io
+ import os
+ from errno import ENOSPC
+
+-try:
+- from urlparse import urlparse, urljoin
+-except ImportError:
+- from urllib.parse import urlparse, urljoin
++from urllib.parse import urlparse, urljoin
+
+ from twisted.python.compat import networkString, nativeString, intToBytes
+ from twisted.trial import unittest, util
+--
+2.26.2
+
diff --git a/dev-python/twisted/files/twisted-20.3.0-py38-hmac.patch b/dev-python/twisted/files/twisted-20.3.0-py38-hmac.patch
new file mode 100644
index 00000000000..1c1ee01b218
--- /dev/null
+++ b/dev-python/twisted/files/twisted-20.3.0-py38-hmac.patch
@@ -0,0 +1,94 @@
+From 653fb2aea0ca1f60558917d52f4ff0c33cd7b067 Mon Sep 17 00:00:00 2001
+From: Craig Rodrigues <rodrigc@crodrigues.org>
+Date: Sun, 12 Apr 2020 14:28:23 -0700
+Subject: [PATCH 1/2] Add digestmod parameter to HMAC.__init__() invocations
+
+This parameter is now required on Python 3.8+
+---
+ src/twisted/cred/credentials.py | 3 ++-
+ src/twisted/cred/test/test_cramauth.py | 11 ++++++++---
+ src/twisted/mail/test/test_pop3.py | 4 +++-
+ 3 files changed, 13 insertions(+), 5 deletions(-)
+
+diff --git a/src/twisted/cred/credentials.py b/src/twisted/cred/credentials.py
+index 5469e5158..67c24cb01 100644
+--- a/src/twisted/cred/credentials.py
++++ b/src/twisted/cred/credentials.py
+@@ -441,7 +441,8 @@ class CramMD5Credentials(object):
+
+
+ def checkPassword(self, password):
+- verify = hexlify(hmac.HMAC(password, self.challenge).digest())
++ verify = hexlify(hmac.HMAC(password, self.challenge,
++ digestmod=md5).digest())
+ return verify == self.response
+
+
+diff --git a/src/twisted/cred/test/test_cramauth.py b/src/twisted/cred/test/test_cramauth.py
+index 1ee08712b..d21f2f68c 100644
+--- a/src/twisted/cred/test/test_cramauth.py
++++ b/src/twisted/cred/test/test_cramauth.py
+@@ -7,6 +7,8 @@ Tests for L{twisted.cred}'s implementation of CRAM-MD5.
+
+ from __future__ import division, absolute_import
+
++import hashlib
++
+ from hmac import HMAC
+ from binascii import hexlify
+
+@@ -39,7 +41,8 @@ class CramMD5CredentialsTests(TestCase):
+ """
+ c = CramMD5Credentials()
+ chal = c.getChallenge()
+- c.response = hexlify(HMAC(b'secret', chal).digest())
++ c.response = hexlify(HMAC(b'secret', chal,
++ digestmod=hashlib.md5).digest())
+ self.assertTrue(c.checkPassword(b'secret'))
+
+
+@@ -61,7 +64,8 @@ class CramMD5CredentialsTests(TestCase):
+ """
+ c = CramMD5Credentials()
+ chal = c.getChallenge()
+- c.response = hexlify(HMAC(b'thewrongsecret', chal).digest())
++ c.response = hexlify(HMAC(b'thewrongsecret', chal,
++ digestmod=hashlib.md5).digest())
+ self.assertFalse(c.checkPassword(b'secret'))
+
+
+@@ -75,7 +79,8 @@ class CramMD5CredentialsTests(TestCase):
+ chal = c.getChallenge()
+ c.setResponse(b" ".join(
+ (b"squirrel",
+- hexlify(HMAC(b'supersecret', chal).digest()))))
++ hexlify(HMAC(b'supersecret', chal,
++ digestmod=hashlib.md5).digest()))))
+ self.assertTrue(c.checkPassword(b'supersecret'))
+ self.assertEqual(c.username, b"squirrel")
+
+diff --git a/src/twisted/mail/test/test_pop3.py b/src/twisted/mail/test/test_pop3.py
+index 4a59c3b49..ea513487c 100644
+--- a/src/twisted/mail/test/test_pop3.py
++++ b/src/twisted/mail/test/test_pop3.py
+@@ -11,6 +11,7 @@ import hmac
+ import base64
+ import itertools
+
++from hashlib import md5
+ from collections import OrderedDict
+ from io import BytesIO
+
+@@ -1097,7 +1098,8 @@ class SASLTests(unittest.TestCase):
+ p.lineReceived(b"AUTH CRAM-MD5")
+ chal = s.getvalue().splitlines()[-1][2:]
+ chal = base64.decodestring(chal)
+- response = hmac.HMAC(b'testpassword', chal).hexdigest().encode("ascii")
++ response = hmac.HMAC(b'testpassword', chal,
++ digestmod=md5).hexdigest().encode("ascii")
+
+ p.lineReceived(
+ base64.encodestring(b'testuser ' + response).rstrip(b'\n'))
+--
+2.26.2
+
diff --git a/dev-python/twisted/twisted-20.3.0.ebuild b/dev-python/twisted/twisted-20.3.0.ebuild
index 5ec79085b94..1f547fbdba4 100644
--- a/dev-python/twisted/twisted-20.3.0.ebuild
+++ b/dev-python/twisted/twisted-20.3.0.ebuild
@@ -81,6 +81,11 @@ DEPEND="
S=${WORKDIR}/${TWISTED_P}
python_prepare_all() {
+ local PATCHES=(
+ "${FILESDIR}"/twisted-20.3.0-py38-cgi.patch
+ "${FILESDIR}"/twisted-20.3.0-py38-hmac.patch
+ )
+
# upstream test for making releases; not very useful and requires
# sphinx (including on py2)
rm src/twisted/python/test/test_release.py || die
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2020-05-27 15:22 Michał Górny
0 siblings, 0 replies; 17+ messages in thread
From: Michał Górny @ 2020-05-27 15:22 UTC (permalink / raw
To: gentoo-commits
commit: b8ac8ee8c30d7400592f56c9ae6c34c4b076fc02
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 27 15:00:37 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May 27 15:22:12 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b8ac8ee8
dev-python/twisted: Unbreak py2.7 in 19.10.0
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
.../twisted/files/twisted-19.10.0-py38-cgi.patch | 41 ++++++++++++++++++++++
dev-python/twisted/twisted-19.10.0.ebuild | 2 +-
2 files changed, 42 insertions(+), 1 deletion(-)
diff --git a/dev-python/twisted/files/twisted-19.10.0-py38-cgi.patch b/dev-python/twisted/files/twisted-19.10.0-py38-cgi.patch
new file mode 100644
index 00000000000..5fc4768e5d2
--- /dev/null
+++ b/dev-python/twisted/files/twisted-19.10.0-py38-cgi.patch
@@ -0,0 +1,41 @@
+diff --git a/src/twisted/web/test/test_http.py b/src/twisted/web/test/test_http.py
+index 6001d1e40..1cf9172ef 100644
+--- a/src/twisted/web/test/test_http.py
++++ b/src/twisted/web/test/test_http.py
+@@ -9,15 +9,15 @@ from __future__ import absolute_import, division
+
+ import base64
+ import calendar
+-import cgi
+ import random
+
+ import hamcrest
+
+ try:
+ from urlparse import urlparse, urlunsplit, clear_cache
++ from cgi import parse_qs
+ except ImportError:
+- from urllib.parse import urlparse, urlunsplit, clear_cache
++ from urllib.parse import urlparse, urlunsplit, clear_cache, parse_qs
+
+ from io import BytesIO
+ from itertools import cycle
+@@ -2156,15 +2156,15 @@ Hello,
+ class QueryArgumentsTests(unittest.TestCase):
+ def testParseqs(self):
+ self.assertEqual(
+- cgi.parse_qs(b"a=b&d=c;+=f"),
++ parse_qs(b"a=b&d=c;+=f"),
+ http.parse_qs(b"a=b&d=c;+=f"))
+ self.assertRaises(
+ ValueError, http.parse_qs, b"blah", strict_parsing=True)
+ self.assertEqual(
+- cgi.parse_qs(b"a=&b=c", keep_blank_values=1),
++ parse_qs(b"a=&b=c", keep_blank_values=1),
+ http.parse_qs(b"a=&b=c", keep_blank_values=1))
+ self.assertEqual(
+- cgi.parse_qs(b"a=&b=c"),
++ parse_qs(b"a=&b=c"),
+ http.parse_qs(b"a=&b=c"))
+
+
diff --git a/dev-python/twisted/twisted-19.10.0.ebuild b/dev-python/twisted/twisted-19.10.0.ebuild
index 6f7b8e4d9c7..6ed6b63c9d3 100644
--- a/dev-python/twisted/twisted-19.10.0.ebuild
+++ b/dev-python/twisted/twisted-19.10.0.ebuild
@@ -83,7 +83,7 @@ DEPEND="
python_prepare_all() {
local PATCHES=(
"${FILESDIR}"/${P}-py38.patch
- "${FILESDIR}"/twisted-20.3.0-py38-cgi.patch
+ "${FILESDIR}"/twisted-19.10.0-py38-cgi.patch
"${FILESDIR}"/twisted-20.3.0-py38-hmac.patch
)
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2020-05-27 15:22 Michał Górny
0 siblings, 0 replies; 17+ messages in thread
From: Michał Górny @ 2020-05-27 15:22 UTC (permalink / raw
To: gentoo-commits
commit: 7766611623513856da2ed5dc3552186453922282
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 27 15:10:26 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May 27 15:22:13 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=77666116
dev-python/twisted: Port to py39
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
.../twisted/files/twisted-19.10.0-py39-b64.patch | 165 +++++++++++++++++++++
.../twisted/files/twisted-20.3.0-py39-b64.patch | 158 ++++++++++++++++++++
.../files/twisted-20.3.0-py39-combined.patch | 115 ++++++++++++++
dev-python/twisted/twisted-19.10.0.ebuild | 4 +-
dev-python/twisted/twisted-20.3.0.ebuild | 4 +-
5 files changed, 444 insertions(+), 2 deletions(-)
diff --git a/dev-python/twisted/files/twisted-19.10.0-py39-b64.patch b/dev-python/twisted/files/twisted-19.10.0-py39-b64.patch
new file mode 100644
index 00000000000..f67d6240558
--- /dev/null
+++ b/dev-python/twisted/files/twisted-19.10.0-py39-b64.patch
@@ -0,0 +1,165 @@
+From f56133a2e0d7ddf9ee6e43bf9e1d62e970cb0b3a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 27 May 2020 13:23:37 +0200
+Subject: [PATCH] Replace base64.*string() functions to fix py3.9 support
+
+Replace base64.decodestring() and .encodestring() functions as they
+were deprecated since Python 3.1 in favor of (equivalent) .decodebytes()
+and .encodebytes(), and were eventually removed in Python 3.9.
+
+While at it, replace most of their uses with base64.b64encode()
+and .b64decode() that are preferable to the former wrt ticket #6446,
+and they do not introduce line breaks that the twisted code usually
+discarded.
+
+Use .decodebytes() and .encodebytes() in DirDBM as it seems to rely
+on the exact presence of newlines, and changing that would break
+backwards compatibility.
+
+Fixes: ticket:6446
+Fixes: ticket:9831
+---
+ src/twisted/conch/scripts/tkconch.py | 2 +-
+ src/twisted/conch/test/test_keys.py | 2 +-
+ src/twisted/mail/pop3.py | 4 ++--
+ src/twisted/mail/test/test_pop3.py | 4 ++--
+ src/twisted/persisted/dirdbm.py | 10 ++++++++--
+ src/twisted/web/http.py | 2 +-
+ src/twisted/web/test/test_http.py | 6 +++---
+ 14 files changed, 18 insertions(+), 12 deletions(-)
+
+diff --git a/src/twisted/conch/scripts/tkconch.py b/src/twisted/conch/scripts/tkconch.py
+index 9c48e8a7f..5e007ebdc 100644
+--- a/src/twisted/conch/scripts/tkconch.py
++++ b/src/twisted/conch/scripts/tkconch.py
+@@ -409,7 +409,7 @@ class SSHClientTransport(transport.SSHClientTransport):
+ "known hosts.\r\n" %
+ (khHost, {b'ssh-dss':'DSA', b'ssh-rsa':'RSA'}[keyType]))
+ with open(os.path.expanduser('~/.ssh/known_hosts'), 'a') as known_hosts:
+- encodedKey = base64.encodestring(pubKey).replace(b'\n', b'')
++ encodedKey = base64.b64encode(pubKey)
+ known_hosts.write('\n%s %s %s' % (khHost, keyType, encodedKey))
+ except:
+ log.deferr()
+diff --git a/src/twisted/conch/test/test_keys.py b/src/twisted/conch/test/test_keys.py
+index 41e49f415..795e7b8d7 100644
+--- a/src/twisted/conch/test/test_keys.py
++++ b/src/twisted/conch/test/test_keys.py
+@@ -352,7 +352,7 @@ SUrCyZXsNh6VXwjs3gKQ
+
+ self.assertRaises(
+ keys.BadKeyError,
+- keys.Key.fromString, data=b'{' + base64.encodestring(sexp) + b'}',
++ keys.Key.fromString, data=b'{' + base64.b64encode(sexp) + b'}',
+ )
+
+
+diff --git a/src/twisted/mail/pop3.py b/src/twisted/mail/pop3.py
+index ffe9714c9..057389e3a 100644
+--- a/src/twisted/mail/pop3.py
++++ b/src/twisted/mail/pop3.py
+@@ -728,7 +728,7 @@ class POP3(basic.LineOnlyReceiver, policies.TimeoutMixin):
+ self._auth = auth()
+ chal = self._auth.getChallenge()
+
+- self.sendLine(b'+ ' + base64.encodestring(chal).rstrip(b'\n'))
++ self.sendLine(b'+ ' + base64.b64encode(chal))
+ self.state = 'AUTH'
+
+
+@@ -747,7 +747,7 @@ class POP3(basic.LineOnlyReceiver, policies.TimeoutMixin):
+ """
+ self.state = "COMMAND"
+ try:
+- parts = base64.decodestring(line).split(None, 1)
++ parts = base64.b64decode(line).split(None, 1)
+ except binascii.Error:
+ self.failResponse(b"Invalid BASE64 encoding")
+ else:
+diff --git a/src/twisted/mail/test/test_pop3.py b/src/twisted/mail/test/test_pop3.py
+index ea513487c..36780d9c9 100644
+--- a/src/twisted/mail/test/test_pop3.py
++++ b/src/twisted/mail/test/test_pop3.py
+@@ -1097,12 +1097,12 @@ class SASLTests(unittest.TestCase):
+
+ p.lineReceived(b"AUTH CRAM-MD5")
+ chal = s.getvalue().splitlines()[-1][2:]
+- chal = base64.decodestring(chal)
++ chal = base64.b64decode(chal)
+ response = hmac.HMAC(b'testpassword', chal,
+ digestmod=md5).hexdigest().encode("ascii")
+
+ p.lineReceived(
+- base64.encodestring(b'testuser ' + response).rstrip(b'\n'))
++ base64.b64encode(b'testuser ' + response))
+ self.assertTrue(p.mbox)
+ self.assertTrue(s.getvalue().splitlines()[-1].find(b"+OK") >= 0)
+ p.connectionLost(failure.Failure(Exception("Test harness disconnect")))
+diff --git a/src/twisted/persisted/dirdbm.py b/src/twisted/persisted/dirdbm.py
+index f97c526d0..d9f29cce2 100644
+--- a/src/twisted/persisted/dirdbm.py
++++ b/src/twisted/persisted/dirdbm.py
+@@ -81,14 +81,20 @@ class DirDBM:
+ Encode a key so it can be used as a filename.
+ """
+ # NOTE: '_' is NOT in the base64 alphabet!
+- return base64.encodestring(k).replace(b'\n', b'_').replace(b"/", b"-")
++ try:
++ return base64.encodebytes(k).replace(b'\n', b'_').replace(b"/", b"-")
++ except AttributeError:
++ return base64.encodestring(k).replace(b'\n', b'_').replace(b"/", b"-")
+
+
+ def _decode(self, k):
+ """
+ Decode a filename to get the key.
+ """
+- return base64.decodestring(k.replace(b'_', b'\n').replace(b"-", b"/"))
++ try:
++ return base64.decodebytes(k.replace(b'_', b'\n').replace(b"-", b"/"))
++ except AttributeError:
++ return base64.decodestring(k.replace(b'_', b'\n').replace(b"-", b"/"))
+
+
+ def _readFile(self, path):
+diff --git a/src/twisted/web/http.py b/src/twisted/web/http.py
+index fe88d3373..602a58f31 100644
+--- a/src/twisted/web/http.py
++++ b/src/twisted/web/http.py
+@@ -1540,7 +1540,7 @@ class Request:
+ bas, upw = authh.split()
+ if bas.lower() != b"basic":
+ raise ValueError()
+- upw = base64.decodestring(upw)
++ upw = base64.b64decode(upw)
+ self.user, self.password = upw.split(b':', 1)
+ except (binascii.Error, ValueError):
+ self.user = self.password = ""
+diff --git a/src/twisted/web/test/test_http.py b/src/twisted/web/test/test_http.py
+index 6001d1e40..70065e232 100644
+--- a/src/twisted/web/test/test_http.py
++++ b/src/twisted/web/test/test_http.py
+@@ -1513,7 +1513,7 @@ class ParsingTests(unittest.TestCase):
+ requests.append(self)
+
+ for u, p in [(b"foo", b"bar"), (b"hello", b"there:z")]:
+- s = base64.encodestring(b":".join((u, p))).strip()
++ s = base64.b64encode(b":".join((u, p)))
+ f = b"GET / HTTP/1.0\nAuthorization: Basic " + s + b"\n\n"
+ self.runRequest(f, Request, 0)
+ req = requests.pop()
+@@ -2139,9 +2139,9 @@ Hello,
+
+ u = b"foo"
+ p = b"bar"
+- s = base64.encodestring(b":".join((u, p))).strip()
++ s = base64.b64encode(b":".join((u, p)))
+ f = b"GET / HTTP/1.0\nAuthorization: Basic " + s + b"\n\n"
+- self.patch(base64, 'decodestring', lambda x: [])
++ self.patch(base64, 'b64decode', lambda x: [])
+ self.runRequest(f, Request, 0)
+ req = requests.pop()
+ self.assertEqual(('', ''), req.credentials)
+--
+2.26.2
+
diff --git a/dev-python/twisted/files/twisted-20.3.0-py39-b64.patch b/dev-python/twisted/files/twisted-20.3.0-py39-b64.patch
new file mode 100644
index 00000000000..f475614df40
--- /dev/null
+++ b/dev-python/twisted/files/twisted-20.3.0-py39-b64.patch
@@ -0,0 +1,158 @@
+From f44c2ff111a8961d295409186cc07aaf414c76bc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 27 May 2020 13:23:37 +0200
+Subject: [PATCH 1/4] Replace base64.*string() functions to fix py3.9 support
+
+Replace base64.decodestring() and .encodestring() functions as they
+were deprecated since Python 3.1 in favor of (equivalent) .decodebytes()
+and .encodebytes(), and were eventually removed in Python 3.9.
+
+While at it, replace most of their uses with base64.b64encode()
+and .b64decode() that are preferable to the former wrt ticket #6446,
+and they do not introduce line breaks that the twisted code usually
+discarded.
+
+Use .decodebytes() and .encodebytes() in DirDBM as it seems to rely
+on the exact presence of newlines, and changing that would break
+backwards compatibility.
+
+Fixes: ticket:6446
+Fixes: ticket:9831
+---
+ src/twisted/conch/scripts/tkconch.py | 2 +-
+ src/twisted/conch/test/test_keys.py | 2 +-
+ src/twisted/mail/pop3.py | 4 ++--
+ src/twisted/mail/test/test_pop3.py | 4 ++--
+ src/twisted/persisted/dirdbm.py | 4 ++--
+ src/twisted/web/http.py | 2 +-
+ src/twisted/web/test/test_http.py | 6 +++---
+ 14 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/src/twisted/conch/scripts/tkconch.py b/src/twisted/conch/scripts/tkconch.py
+index a662cabc8..744734343 100644
+--- a/src/twisted/conch/scripts/tkconch.py
++++ b/src/twisted/conch/scripts/tkconch.py
+@@ -412,7 +412,7 @@ class SSHClientTransport(transport.SSHClientTransport):
+ "known hosts.\r\n" %
+ (khHost, {b'ssh-dss':'DSA', b'ssh-rsa':'RSA'}[keyType]))
+ with open(os.path.expanduser('~/.ssh/known_hosts'), 'a') as known_hosts:
+- encodedKey = base64.encodestring(pubKey).replace(b'\n', b'')
++ encodedKey = base64.b64encode(pubKey)
+ known_hosts.write('\n%s %s %s' % (khHost, keyType, encodedKey))
+ except:
+ log.deferr()
+diff --git a/src/twisted/conch/test/test_keys.py b/src/twisted/conch/test/test_keys.py
+index 650a19bfb..f76cbd1b4 100644
+--- a/src/twisted/conch/test/test_keys.py
++++ b/src/twisted/conch/test/test_keys.py
+@@ -404,7 +404,7 @@ SUrCyZXsNh6VXwjs3gKQ
+
+ self.assertRaises(
+ keys.BadKeyError,
+- keys.Key.fromString, data=b'{' + base64.encodestring(sexp) + b'}',
++ keys.Key.fromString, data=b'{' + base64.b64encode(sexp) + b'}',
+ )
+
+
+diff --git a/src/twisted/mail/pop3.py b/src/twisted/mail/pop3.py
+index ffe9714c9..057389e3a 100644
+--- a/src/twisted/mail/pop3.py
++++ b/src/twisted/mail/pop3.py
+@@ -728,7 +728,7 @@ class POP3(basic.LineOnlyReceiver, policies.TimeoutMixin):
+ self._auth = auth()
+ chal = self._auth.getChallenge()
+
+- self.sendLine(b'+ ' + base64.encodestring(chal).rstrip(b'\n'))
++ self.sendLine(b'+ ' + base64.b64encode(chal))
+ self.state = 'AUTH'
+
+
+@@ -747,7 +747,7 @@ class POP3(basic.LineOnlyReceiver, policies.TimeoutMixin):
+ """
+ self.state = "COMMAND"
+ try:
+- parts = base64.decodestring(line).split(None, 1)
++ parts = base64.b64decode(line).split(None, 1)
+ except binascii.Error:
+ self.failResponse(b"Invalid BASE64 encoding")
+ else:
+diff --git a/src/twisted/mail/test/test_pop3.py b/src/twisted/mail/test/test_pop3.py
+index f7fbfaf1e..af335ab2d 100644
+--- a/src/twisted/mail/test/test_pop3.py
++++ b/src/twisted/mail/test/test_pop3.py
+@@ -1096,12 +1096,12 @@ class SASLTests(unittest.TestCase):
+
+ p.lineReceived(b"AUTH CRAM-MD5")
+ chal = s.getvalue().splitlines()[-1][2:]
+- chal = base64.decodestring(chal)
++ chal = base64.b64decode(chal)
+ response = hmac.HMAC(b'testpassword', chal,
+ digestmod=md5).hexdigest().encode("ascii")
+
+ p.lineReceived(
+- base64.encodestring(b'testuser ' + response).rstrip(b'\n'))
++ base64.b64encode(b'testuser ' + response))
+ self.assertTrue(p.mbox)
+ self.assertTrue(s.getvalue().splitlines()[-1].find(b"+OK") >= 0)
+ p.connectionLost(failure.Failure(Exception("Test harness disconnect")))
+diff --git a/src/twisted/persisted/dirdbm.py b/src/twisted/persisted/dirdbm.py
+index 3ba7a59d4..7659ff765 100644
+--- a/src/twisted/persisted/dirdbm.py
++++ b/src/twisted/persisted/dirdbm.py
+@@ -77,14 +77,14 @@ class DirDBM:
+ Encode a key so it can be used as a filename.
+ """
+ # NOTE: '_' is NOT in the base64 alphabet!
+- return base64.encodestring(k).replace(b'\n', b'_').replace(b"/", b"-")
++ return base64.encodebytes(k).replace(b'\n', b'_').replace(b"/", b"-")
+
+
+ def _decode(self, k):
+ """
+ Decode a filename to get the key.
+ """
+- return base64.decodestring(k.replace(b'_', b'\n').replace(b"-", b"/"))
++ return base64.decodebytes(k.replace(b'_', b'\n').replace(b"-", b"/"))
+
+
+ def _readFile(self, path):
+diff --git a/src/twisted/web/http.py b/src/twisted/web/http.py
+index 0e115741e..e9a080d21 100644
+--- a/src/twisted/web/http.py
++++ b/src/twisted/web/http.py
+@@ -1544,7 +1544,7 @@ class Request:
+ bas, upw = authh.split()
+ if bas.lower() != b"basic":
+ raise ValueError()
+- upw = base64.decodestring(upw)
++ upw = base64.b64decode(upw)
+ self.user, self.password = upw.split(b':', 1)
+ except (binascii.Error, ValueError):
+ self.user = self.password = b''
+diff --git a/src/twisted/web/test/test_http.py b/src/twisted/web/test/test_http.py
+index 112e56f46..02a4674a7 100644
+--- a/src/twisted/web/test/test_http.py
++++ b/src/twisted/web/test/test_http.py
+@@ -1604,7 +1604,7 @@ class ParsingTests(unittest.TestCase):
+ requests.append(self)
+
+ for u, p in [(b"foo", b"bar"), (b"hello", b"there:z")]:
+- s = base64.encodestring(b":".join((u, p))).strip()
++ s = base64.b64encode(b":".join((u, p)))
+ f = b"GET / HTTP/1.0\nAuthorization: Basic " + s + b"\n\n"
+ self.runRequest(f, Request, 0)
+ req = requests.pop()
+@@ -2209,9 +2209,9 @@ Hello,
+
+ u = b"foo"
+ p = b"bar"
+- s = base64.encodestring(b":".join((u, p))).strip()
++ s = base64.b64encode(b":".join((u, p)))
+ f = b"GET / HTTP/1.0\nAuthorization: Basic " + s + b"\n\n"
+- self.patch(base64, 'decodestring', lambda x: [])
++ self.patch(base64, 'b64decode', lambda x: [])
+ self.runRequest(f, Request, 0)
+ req = requests.pop()
+ self.assertEqual((b'', b''), req.credentials)
+--
+2.26.2
diff --git a/dev-python/twisted/files/twisted-20.3.0-py39-combined.patch b/dev-python/twisted/files/twisted-20.3.0-py39-combined.patch
new file mode 100644
index 00000000000..0ed1f7b8d9c
--- /dev/null
+++ b/dev-python/twisted/files/twisted-20.3.0-py39-combined.patch
@@ -0,0 +1,115 @@
+From 2d30860a8b71e90513ead9958f5dd312802b0d36 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 27 May 2020 14:40:53 +0200
+Subject: [PATCH 2/4] Fix imap4-utf-7 codec lookup function for Python 3.9
+
+Python 3.9 normalizes the codec name into 'imap4_utf_7' rather than
+'imap4-utf-7', and therefore the lookup function needs to account
+for the former name. Transform the latter locally to preserve support
+for all Python versions.
+
+Fixes: ticket: 9832
+---
+ src/twisted/mail/imap4.py | 2 +-
+ 2 files changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/twisted/mail/imap4.py b/src/twisted/mail/imap4.py
+index 736ef111d..3f32982ca 100644
+--- a/src/twisted/mail/imap4.py
++++ b/src/twisted/mail/imap4.py
+@@ -6369,7 +6369,7 @@ _codecInfo = codecs.CodecInfo(encoder, decoder, StreamReader, StreamWriter)
+
+
+ def imap4_utf_7(name):
+- if name == 'imap4-utf-7':
++ if name.replace('-', '_') == 'imap4_utf_7':
+ return _codecInfo
+
+ codecs.register(imap4_utf_7)
+--
+2.26.2
+
+From daf928bf0f0371816dddbd4929948c4213d0cdcb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 27 May 2020 15:12:54 +0200
+Subject: [PATCH 3/4] Fix verifyCryptedPassword() for crypt.crypt() throwing in
+ py3.9
+
+In Python 3.9, the crypt.crypt() function may throw an exception
+if the underlying crypt() function fails. Update
+verifyCryptedPassword() to account for that, and preserve the existing
+behavior of returning False in that case.
+
+Fixes: ticket:9833
+---
+ src/twisted/conch/checkers.py | 5 ++++-
+ src/twisted/plugins/cred_unix.py | 5 ++++-
+ 4 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/src/twisted/conch/checkers.py b/src/twisted/conch/checkers.py
+index 917567a39..e4e327b16 100644
+--- a/src/twisted/conch/checkers.py
++++ b/src/twisted/conch/checkers.py
+@@ -53,7 +53,10 @@ def verifyCryptedPassword(crypted, pw):
+
+ @rtype: L{bool}
+ """
+- return crypt.crypt(pw, crypted) == crypted
++ try:
++ return crypt.crypt(pw, crypted) == crypted
++ except OSError:
++ return False
+
+
+
+diff --git a/src/twisted/plugins/cred_unix.py b/src/twisted/plugins/cred_unix.py
+index 211b4ccbc..a662719b6 100644
+--- a/src/twisted/plugins/cred_unix.py
++++ b/src/twisted/plugins/cred_unix.py
+@@ -43,7 +43,10 @@ def verifyCryptedPassword(crypted, pw):
+ pw = pw.decode('utf-8')
+ if not isinstance(crypted, StringType):
+ crypted = crypted.decode('utf-8')
+- return crypt.crypt(pw, crypted) == crypted
++ try:
++ return crypt.crypt(pw, crypted) == crypted
++ except OSError:
++ return False
+
+
+
+--
+2.26.2
+
+From 4fc435df0d1eba3e5d6416a2b86d39d3404f82fe Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 27 May 2020 15:37:10 +0200
+Subject: [PATCH 4/4] Use xml.etree.ElementTree instead of deprecated
+ cElementTree
+
+The xml.etree.cElementTree is deprecated, and has been removed in Python
+3.9. At the same time, xml.etree.ElementTree has already been using
+cElementTree implicitly since Python 3.3. Update test_flatten to use
+the latter to provide compatibility with newer Python versions.
+
+Fixes: ticket:9834
+---
+ src/twisted/web/test/test_flatten.py | 2 +-
+ 2 files changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/twisted/web/test/test_flatten.py b/src/twisted/web/test/test_flatten.py
+index 677401c55..61d50e20a 100644
+--- a/src/twisted/web/test/test_flatten.py
++++ b/src/twisted/web/test/test_flatten.py
+@@ -9,7 +9,7 @@ L{twisted.web._flatten}.
+ import sys
+ import traceback
+
+-from xml.etree.cElementTree import XML
++from xml.etree.ElementTree import XML
+
+ from collections import OrderedDict
+
+--
+2.26.2
+
diff --git a/dev-python/twisted/twisted-19.10.0.ebuild b/dev-python/twisted/twisted-19.10.0.ebuild
index 6ed6b63c9d3..720e3b98f64 100644
--- a/dev-python/twisted/twisted-19.10.0.ebuild
+++ b/dev-python/twisted/twisted-19.10.0.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python2_7 python3_{6,7,8} )
+PYTHON_COMPAT=( python2_7 python3_{6,7,8,9} )
PYTHON_REQ_USE="threads(+)"
inherit distutils-r1 virtualx
@@ -85,6 +85,8 @@ python_prepare_all() {
"${FILESDIR}"/${P}-py38.patch
"${FILESDIR}"/twisted-19.10.0-py38-cgi.patch
"${FILESDIR}"/twisted-20.3.0-py38-hmac.patch
+ "${FILESDIR}"/twisted-19.10.0-py39-b64.patch
+ "${FILESDIR}"/twisted-20.3.0-py39-combined.patch
)
# upstream test for making releases; not very useful and requires
diff --git a/dev-python/twisted/twisted-20.3.0.ebuild b/dev-python/twisted/twisted-20.3.0.ebuild
index 47624031dc7..3ee3d08b812 100644
--- a/dev-python/twisted/twisted-20.3.0.ebuild
+++ b/dev-python/twisted/twisted-20.3.0.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{6,7,8} )
+PYTHON_COMPAT=( python3_{6,7,8,9} )
PYTHON_REQ_USE="threads(+)"
inherit distutils-r1 virtualx
@@ -84,6 +84,8 @@ python_prepare_all() {
local PATCHES=(
"${FILESDIR}"/twisted-20.3.0-py38-cgi.patch
"${FILESDIR}"/twisted-20.3.0-py38-hmac.patch
+ "${FILESDIR}"/twisted-20.3.0-py39-b64.patch
+ "${FILESDIR}"/twisted-20.3.0-py39-combined.patch
)
# upstream test for making releases; not very useful and requires
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2020-06-04 6:24 Michał Górny
0 siblings, 0 replies; 17+ messages in thread
From: Michał Górny @ 2020-06-04 6:24 UTC (permalink / raw
To: gentoo-commits
commit: 7603a6f3a0af50e49d9b8257195a859b55328cf5
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 4 05:47:43 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jun 4 06:23:48 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7603a6f3
dev-python/twisted: Remove old
Bug: https://bugs.gentoo.org/711760
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/twisted/Manifest | 2 -
dev-python/twisted/files/test_main.patch | 73 ------
dev-python/twisted/files/trial | 22 --
...t_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch | 11 -
.../twisted/files/twisted-16.6.0-test-fixes.patch | 282 ---------------------
.../twisted-17.9.0-Fix-test-on-Python-363.patch | 74 ------
.../files/twisted-17.9.0-python-27-utf-8-fix.patch | 47 ----
...ed-18.4.0-Disable-writing-of-plugin-cache.patch | 25 --
dev-python/twisted/files/utf8_overrides.patch | 64 -----
dev-python/twisted/twisted-16.6.0-r3.ebuild | 185 --------------
dev-python/twisted/twisted-18.4.0.ebuild | 195 --------------
11 files changed, 980 deletions(-)
diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index 36da34ceefa..0272c5077b2 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,5 +1,3 @@
-DIST Twisted-16.6.0.tar.bz2 2979747 BLAKE2B 898e0a0fa3ae8547a801b09118423ec8ad80727dd6d034e3f8a151f084eff5a3fc560f2eb9e76c452a14ec90b36d93e14d3bbb388010c3c5c01fd1c4d5ca16bb SHA512 0b8de0ec7f64457f76c396fced64b366b8e63c6e000a5edc6c6388cd917fb2f95711918cd8edda39e0aa77e2cd32b5d775d23630a5ad10fc013c18f8316300cf
-DIST Twisted-18.4.0.tar.bz2 3037019 BLAKE2B 6fc32f7591493ccc4fe03233307b566899b82cd035ba3329b3faaf950339a6653de697ba3873b37b22f9d7f8a66109694b80496917bf61e79c56eeb7e351ac87 SHA512 3733a6df0196ea580187da3576f5fd08f287437528a4e19813056d019cca213c61b62d879d80a12eef38661d3505ba33aac9a4fc956b19afa6da7d37a6465c83
DIST Twisted-19.10.0.tar.bz2 3118485 BLAKE2B a0d532b67177aa017e463bf823d7842d4f6ff694f78cd7600865718ffe861023a53ea6a922f7de232133edba26f5255074d7ef277ce8f3bdf02d556ccf4abf41 SHA512 de8d7fd0b2081cebeff68b060c8469377011648bc563a94a993d3530fb007ed42c3a54925c9a10c465ee7a3065cc9108ace12d10d358223fab13494becb9ac4b
DIST Twisted-20.3.0.tar.bz2 3127793 BLAKE2B 2e85fc3ec26d89e563c9e79a5d2adea81ff1745d18f0f92b8d45ae3729fbddf09998664257880372c7a4caeb5977c5cad7c863596b8c27ad7890275cead9f763 SHA512 1b850e5fc21a3630ead4c2cc3622c16e78bb3be38ab11d021779b7ce3d3c30acc4e19d79c7791a5fce6c5c6e09c2baa349901dffe952de67dd98eec419846365
DIST twisted-regen-cache.gz 911 BLAKE2B ffd3fcda6c67ffe6fd3ef581c8d507548396b66ed0708e9a5c790095e579c0d5f0f71596acf05712989da2ddef2b8d437eca973bc4d80ef8a9fa852915f38305 SHA512 95a9b931c73017d16d1b5e6b41345dddffe62b6af1a8e93b5e40d06d3d15be17b0dd0181c767ffeeb791534d463764ef9e066fa6c2ee2ac4b53c86d1da8fce03
diff --git a/dev-python/twisted/files/test_main.patch b/dev-python/twisted/files/test_main.patch
deleted file mode 100644
index bfef40450d5..00000000000
--- a/dev-python/twisted/files/test_main.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From 2c3c28f5dbbd61bcfa5c548d1d423fffbaf2132d Mon Sep 17 00:00:00 2001
-From: Brian Dolbec <dolsen@gentoo.org>
-Date: Fri, 31 Mar 2017 09:32:18 -0700
-Subject: [PATCH] tests/test_main.py: Fix test_twisted to handle differntly
- sorted options
-
-Some systems retuned the usage with '__main__.py' instead of the command 'trial'
-So, substitute that out if it exists.
-The options returned via python can be a different sort order than is output via the
-command --help. So break up the lines into a list and check equality, lines are neither
-missing or extra.
----
- src/twisted/test/test_main.py | 34 ++++++++++++++++++++++++++++++++--
- 1 file changed, 32 insertions(+), 2 deletions(-)
-
-diff --git a/src/twisted/test/test_main.py b/src/twisted/test/test_main.py
-index 572769018..b010a389e 100644
---- a/src/twisted/test/test_main.py
-+++ b/src/twisted/test/test_main.py
-@@ -18,6 +18,10 @@ from twisted.trial.unittest import TestCase
-
- class MainTests(TestCase):
- """Test that twisted scripts can be invoked as modules."""
-+ # this test just does not work correctly on Gentoo
-+ # the output has '__main__.py' instead of 'trial'
-+ # I have only been able to get 2.7 working correctly
-+ # with replacing the value with what is expected.
- def test_twisted(self):
- """Invoking python -m twisted should execute twist."""
- cmd = sys.executable
-@@ -28,11 +32,37 @@ class MainTests(TestCase):
-
- def processEnded(ign):
- f = p.outF
-- output = f.getvalue().replace(b'\r\n', b'\n')
-+ # Some systems may return __main__.py instead of the command name expected
-+ output = f.getvalue().replace(b'\r\n', b'\n').replace(b"__main__.py", b"trial")
-
- options = TwistOptions()
- message = '{}\n'.format(options).encode('utf-8')
-- self.assertEqual(output, message)
-+ # NOTE: python may return the options in a different order
-+ # than is output via the command --help option
-+ # so we must break up the text and compare that lines
-+ # are not missing or extra from what is expected
-+ a = output.split(b'\n')
-+ b = message.split(b'\n')
-+ extras = []
-+ missing = []
-+ equal_len = (len(a) == len(b))
-+ for i in a:
-+ if i not in b:
-+ extras.append(i)
-+ for i in b:
-+ if i not in a:
-+ missing.append(i)
-+
-+ self.assertTrue(equal_len,
-+ msg="Usage reported a different number of lines than expected")
-+ self.assertTrue(extras == [],
-+ msg="Usage returned these extra lines not expected: %s"
-+ % '\n'.join(extras)
-+ )
-+ self.assertTrue(missing == [],
-+ msg="Usage was missing these expected lines: %s"
-+ % '\n'.join(missing)
-+ )
- return d.addCallback(processEnded)
-
- def test_twisted_import(self):
---
-2.12.1
-
diff --git a/dev-python/twisted/files/trial b/dev-python/twisted/files/trial
deleted file mode 100644
index 8da58861abf..00000000000
--- a/dev-python/twisted/files/trial
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) Twisted Matrix Laboratories.
-# See LICENSE for details.
-import os, sys
-
-try:
- import _preamble
-except ImportError:
- try:
- sys.exc_clear()
- except AttributeError:
- # exc_clear() (and the requirement for it) has been removed from Py3
- pass
-
-# begin chdir armor
-sys.path[:] = map(os.path.abspath, sys.path)
-# end chdir armor
-
-sys.path.insert(0, os.path.abspath(os.getcwd()))
-
-from twisted.scripts.trial import run
-run()
diff --git a/dev-python/twisted/files/twisted-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch b/dev-python/twisted/files/twisted-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch
deleted file mode 100644
index ed1a4684067..00000000000
--- a/dev-python/twisted/files/twisted-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/twisted/plugin.py
-+++ src/twisted/plugin.py
-@@ -180,7 +180,7 @@
- if pluginKey not in existingKeys:
- del dropinDotCache[pluginKey]
- needsWrite = True
-- if needsWrite:
-+ if needsWrite and os.environ.get("TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE") is None:
- try:
- dropinPath.setContent(pickle.dumps(dropinDotCache))
- except:
diff --git a/dev-python/twisted/files/twisted-16.6.0-test-fixes.patch b/dev-python/twisted/files/twisted-16.6.0-test-fixes.patch
deleted file mode 100644
index 3ce04aa3f68..00000000000
--- a/dev-python/twisted/files/twisted-16.6.0-test-fixes.patch
+++ /dev/null
@@ -1,282 +0,0 @@
-From 91b6d8b5b9d602152fb7148c6e2921463b93a8a5 Mon Sep 17 00:00:00 2001
-From: Brian Dolbec <dolsen@gentoo.org>
-Date: Fri, 31 Mar 2017 10:55:32 -0700
-Subject: [PATCH] twisted test overrides
-
----
- src/twisted/internet/test/test_gireactor.py | 3 ++-
- src/twisted/pair/test/test_ethernet.py | 9 +++++++++
- src/twisted/pair/test/test_ip.py | 8 ++++++++
- src/twisted/pair/test/test_rawudp.py | 10 +++++++++-
- src/twisted/pair/test/test_tuntap.py | 16 ++++++++++++++++
- src/twisted/python/test/test_dist3.py | 2 ++
- src/twisted/test/test_ident.py | 5 ++++-
- src/twisted/test/test_plugin.py | 6 ++++++
- src/twisted/test/test_policies.py | 5 +++++
- src/twisted/test/test_udp.py | 6 ++++++
- 10 files changed, 67 insertions(+), 3 deletions(-)
-
-diff --git a/src/twisted/internet/test/test_gireactor.py b/src/twisted/internet/test/test_gireactor.py
-index 43147fdce..6333218e7 100644
---- a/src/twisted/internet/test/test_gireactor.py
-+++ b/src/twisted/internet/test/test_gireactor.py
-@@ -39,6 +39,7 @@ from twisted.python.compat import _PY3
- if gireactor is None:
- skip = "gtk3/gi not importable"
-
-+EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
-
-
- class GApplicationRegistrationTests(ReactorBuilder, TestCase):
-@@ -103,7 +104,7 @@ class GApplicationRegistrationTests(ReactorBuilder, TestCase):
-
- self.runReactor(app, reactor)
-
-- if gtk3reactor is None:
-+ if gtk3reactor is None or EMERGE_TEST_OVERRIDE:
- test_gtkApplicationActivate.skip = (
- "Gtk unavailable (may require running with X11 DISPLAY env set)")
-
-diff --git a/src/twisted/pair/test/test_ethernet.py b/src/twisted/pair/test/test_ethernet.py
-index a4c3a5d19..fe9c57151 100644
---- a/src/twisted/pair/test/test_ethernet.py
-+++ b/src/twisted/pair/test/test_ethernet.py
-@@ -1,11 +1,16 @@
- # Copyright (c) Twisted Matrix Laboratories.
- # See LICENSE for details.
-+
-+import os
-+
- from twisted.trial import unittest
-
- from twisted.python import components
- from twisted.pair import ethernet, raw
- from zope.interface import implementer
-
-+EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
-+
-
- @implementer(raw.IRawPacketProtocol)
- class MyProtocol:
-@@ -221,3 +226,7 @@ class EthernetTests(unittest.TestCase):
- raise
- else:
- raise AssertionError('addProto must raise an exception for bad protocols')
-+
-+
-+if EMERGE_TEST_OVERRIDE:
-+ EthernetTests.skip = "This test does not work via FEATURES=test emerge twisted"
-diff --git a/src/twisted/pair/test/test_ip.py b/src/twisted/pair/test/test_ip.py
-index 0f192a357..0a99658ef 100644
---- a/src/twisted/pair/test/test_ip.py
-+++ b/src/twisted/pair/test/test_ip.py
-@@ -1,11 +1,16 @@
- # Copyright (c) Twisted Matrix Laboratories.
- # See LICENSE for details.
-+
-+import os
-+
- from twisted.trial import unittest
-
- from twisted.python import components
- from twisted.pair import ip, raw
- from zope import interface
-
-+EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
-+
-
- @interface.implementer(raw.IRawDatagramProtocol)
- class MyProtocol:
-@@ -432,3 +437,6 @@ class IPTests(unittest.TestCase):
- raise
- else:
- raise AssertionError('addProto must raise an exception for bad protocols')
-+
-+if EMERGE_TEST_OVERRIDE:
-+ IPTests.skip = "This test does not work via FEATURES=test emerge twisted"
-diff --git a/src/twisted/pair/test/test_rawudp.py b/src/twisted/pair/test/test_rawudp.py
-index 15aae10f1..dade38618 100644
---- a/src/twisted/pair/test/test_rawudp.py
-+++ b/src/twisted/pair/test/test_rawudp.py
-@@ -1,12 +1,17 @@
- # Copyright (c) Twisted Matrix Laboratories.
- # See LICENSE for details.
--
- #
-+
-+import os
-+
- from twisted.trial import unittest
-
- from twisted.internet import protocol
- from twisted.pair import rawudp
-
-+EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
-+
-+
- class MyProtocol(protocol.DatagramProtocol):
- def __init__(self, expecting):
- self.expecting = list(expecting)
-@@ -325,3 +330,6 @@ class RawUDPTests(unittest.TestCase):
- raise
- else:
- raise AssertionError('addProto must raise an exception for bad protocols')
-+
-+if EMERGE_TEST_OVERRIDE:
-+ RawUDPTests.skip = "This test does not work via FEATURES=test emerge twisted"
-diff --git a/src/twisted/pair/test/test_tuntap.py b/src/twisted/pair/test/test_tuntap.py
-index 5e2da6e0f..53e03a008 100644
---- a/src/twisted/pair/test/test_tuntap.py
-+++ b/src/twisted/pair/test/test_tuntap.py
-@@ -64,6 +64,7 @@ if platformSkip is None:
- else:
- skip = platformSkip
-
-+EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
-
-
- @implementer(IReactorFDSet)
-@@ -1417,3 +1418,18 @@ class RealIOSystemTests(IOSystemTestsMixin, SynchronousTestCase,
- """
- General L{_IInputOutputSystem} tests applied to L{_RealSystem}.
- """
-+
-+if EMERGE_TEST_OVERRIDE:
-+ RealIOSystemTests.skip = "This test does not work via FEATURES=test emerge twisted"
-+ MemoryIOSystemTests.skip = "This test does not work via FEATURES=test emerge twisted"
-+ TapTests.skip = "This test does not work via FEATURES=test emerge twisted"
-+ TunTests.skip = "This test does not work via FEATURES=test emerge twisted"
-+ TunnelAddressEqualityTests.skip = "This test does not work via FEATURES=test emerge twisted"
-+ TunnelAddressTests.skip = "This test does not work via FEATURES=test emerge twisted"
-+ TuntapPortTests.skip = "This test does not work via FEATURES=test emerge twisted"
-+ TunnelTests.skip = "This test does not work via FEATURES=test emerge twisted"
-+ FakeTapDeviceTests.skip = "This test does not work via FEATURES=test emerge twisted"
-+ FakeTapDeviceWithPITests.skip = "This test does not work via FEATURES=test emerge twisted"
-+ FakeTunDeviceTests.skip = "This test does not work via FEATURES=test emerge twisted"
-+ RealDeviceWithProtocolInformationTests.skip = "This test does not work via FEATURES=test emerge twisted"
-+ RealDeviceWithoutProtocolInformationTests.skip = "This test does not work via FEATURES=test emerge twisted"
-diff --git a/src/twisted/python/test/test_dist3.py b/src/twisted/python/test/test_dist3.py
-index 3ce2bdd60..494674bc7 100644
---- a/src/twisted/python/test/test_dist3.py
-+++ b/src/twisted/python/test/test_dist3.py
-@@ -53,3 +53,5 @@ class ModulesToInstallTests(TestCase):
- test_exist.skip = "Only on Python 2"
- else:
- test_notexist.skip = "Only on Python 3"
-+
-+ModulesToInstallTests.skip = "This is an upstream distribution test only"
-diff --git a/src/twisted/test/test_ident.py b/src/twisted/test/test_ident.py
-index d86b840e5..3cc40261f 100644
---- a/src/twisted/test/test_ident.py
-+++ b/src/twisted/test/test_ident.py
-@@ -12,7 +12,7 @@ from twisted.protocols import ident
- from twisted.python import failure
- from twisted.internet import error
- from twisted.internet import defer
--from twisted.python.compat import NativeStringIO
-+from twisted.python.compat import NativeStringIO, _PY3
-
- from twisted.trial import unittest
- from twisted.test.proto_helpers import StringTransport
-@@ -216,6 +216,9 @@ class ProcMixinTests(unittest.TestCase):
- """
- L{ident.ProcServerMixin.lookup} uses the Linux TCP process table.
- """
-+ if not _PY3:
-+ # test is broken in py2.7
-+ return
- open_calls = []
-
- def mocked_open(*args, **kwargs):
-diff --git a/src/twisted/test/test_plugin.py b/src/twisted/test/test_plugin.py
-index a23caa72b..a6d61858c 100644
---- a/src/twisted/test/test_plugin.py
-+++ b/src/twisted/test/test_plugin.py
-@@ -29,6 +29,8 @@ else:
- On python 2, import caches don't need to be invalidated.
- """
-
-+EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
-+
-
-
- class ITestPlugin(Interface):
-@@ -327,6 +329,8 @@ class PluginTests(unittest.TestCase):
- attainable, but an error should be logged to show that the cache
- couldn't be updated.
- """
-+ if EMERGE_TEST_OVERRIDE:
-+ return
- # Generate the cache
- plugin.getCache(self.module)
-
-@@ -580,6 +584,8 @@ class DeveloperSetupTests(unittest.TestCase):
- provide useful coverage on Windows due to the different meaning of
- "read-only directory".
- """
-+ if EMERGE_TEST_OVERRIDE:
-+ return
- self.unlockSystem()
- self.sysplug.child('newstuff.py').setContent(pluginFileContents('one'))
- self.lockSystem()
-diff --git a/src/twisted/test/test_policies.py b/src/twisted/test/test_policies.py
-index 3d92633d6..c08809a66 100644
---- a/src/twisted/test/test_policies.py
-+++ b/src/twisted/test/test_policies.py
-@@ -7,6 +7,8 @@ Test code for policies.
-
- from __future__ import division, absolute_import
-
-+import os
-+
- from zope.interface import Interface, implementer, implementedBy
-
- from twisted.python.compat import NativeStringIO
-@@ -23,6 +25,7 @@ try:
- except ImportError:
- import __builtin__ as builtins
-
-+EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
-
-
- class SimpleProtocol(protocol.Protocol):
-@@ -883,6 +886,8 @@ class LoggingFactoryTests(unittest.TestCase):
- automatically opens a unique log file for that protocol and attaches
- the logfile to the built protocol.
- """
-+ if EMERGE_TEST_OVERRIDE:
-+ return
- open_calls = []
- open_rvalues = []
-
-diff --git a/src/twisted/test/test_udp.py b/src/twisted/test/test_udp.py
-index 6cf4583b2..86b513704 100644
---- a/src/twisted/test/test_udp.py
-+++ b/src/twisted/test/test_udp.py
-@@ -8,6 +8,8 @@ Tests for implementations of L{IReactorUDP} and L{IReactorMulticast}.
-
- from __future__ import division, absolute_import
-
-+import os
-+
- from twisted.trial import unittest
-
- from twisted.python.compat import intToBytes
-@@ -15,6 +17,8 @@ from twisted.internet.defer import Deferred, gatherResults, maybeDeferred
- from twisted.internet import protocol, reactor, error, defer, interfaces, udp
- from twisted.python import runtime
-
-+EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False)
-+
-
- class Mixin:
-
-@@ -699,3 +703,5 @@ if not interfaces.IReactorUDP(reactor, None):
- ReactorShutdownInteractionTests.skip = "This reactor does not support UDP"
- if not interfaces.IReactorMulticast(reactor, None):
- MulticastTests.skip = "This reactor does not support multicast"
-+elif EMERGE_TEST_OVERRIDE:
-+ MulticastTests.skip = "This reactor test does not work via FEATURES=test emerge twisted"
---
-2.12.1
-
diff --git a/dev-python/twisted/files/twisted-17.9.0-Fix-test-on-Python-363.patch b/dev-python/twisted/files/twisted-17.9.0-Fix-test-on-Python-363.patch
deleted file mode 100644
index ea7a480abac..00000000000
--- a/dev-python/twisted/files/twisted-17.9.0-Fix-test-on-Python-363.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From e58956fe12af7b41f6c1735ba7b14cba69e82a5e Mon Sep 17 00:00:00 2001
-From: Craig Rodrigues <rodrigc@FreeBSD.org>
-Date: Fri, 6 Oct 2017 02:47:55 -0700
-Subject: [PATCH] Fix test on Python 3.6.3
-
----
- src/twisted/test/test_sslverify.py | 53 +++++++++++++++++++++++++++++------------------------
- 1 file changed, 29 insertions(+), 24 deletions(-)
-
-diff --git a/src/twisted/test/test_sslverify.py b/src/twisted/test/test_sslverify.py
-index aca56f5..3fdc480 100644
---- a/src/twisted/test/test_sslverify.py
-+++ b/src/twisted/test/test_sslverify.py
-@@ -3052,28 +3052,33 @@ class SelectVerifyImplementationTests(unittest.SynchronousTestCase):
- in self.flushWarnings()
- if warning["category"] == UserWarning)
-
-- if _PY3:
-- importError = (
-- "'import of 'service_identity' halted; None in sys.modules'")
-- else:
-- importError = "'No module named service_identity'"
--
-- expectedMessage = (
-- "You do not have a working installation of the "
-- "service_identity module: {message}. Please install it from "
-- "<https://pypi.python.org/pypi/service_identity> "
-- "and make sure all of its dependencies are satisfied. "
-- "Without the service_identity module, Twisted can perform only "
-- "rudimentary TLS client hostname verification. Many valid "
-- "certificate/hostname mappings may be rejected.").format(
-- message=importError)
-+ importErrors =[
-+ # Python 3.6.3
-+ "'import of service_identity halted; None in sys.modules'",
-+ # Python 3
-+ "'import of 'service_identity' halted; None in sys.modules'",
-+ # Python 2
-+ "'No module named service_identity'"
-+ ]
-
-- self.assertEqual(
-- (warning["message"], warning["filename"], warning["lineno"]),
--
-- # Make sure we're abusing the warning system to a sufficient
-- # degree: there is no filename or line number that makes sense for
-- # this warning to "blame" for the problem. It is a system
-- # misconfiguration. So the location information should be blank
-- # (or as blank as we can make it).
-- (expectedMessage, "", 0))
-+ expectedMessages = []
-+ for importError in importErrors:
-+ expectedMessages.append(
-+ "You do not have a working installation of the "
-+ "service_identity module: {message}. Please install it from "
-+ "<https://pypi.python.org/pypi/service_identity> "
-+ "and make sure all of its dependencies are satisfied. "
-+ "Without the service_identity module, Twisted can perform only"
-+ " rudimentary TLS client hostname verification. Many valid "
-+ "certificate/hostname mappings may be rejected.".format(
-+ message=importError))
-+
-+ self.assertIn(warning["message"], expectedMessages)
-+
-+ # Make sure we're abusing the warning system to a sufficient
-+ # degree: there is no filename or line number that makes sense for
-+ # this warning to "blame" for the problem. It is a system
-+ # misconfiguration. So the location information should be blank
-+ # (or as blank as we can make it).
-+ self.assertEqual(warning["filename"], "")
-+ self.assertEqual(warning["lineno"], 0)
---
-libgit2 0.26.0
-
diff --git a/dev-python/twisted/files/twisted-17.9.0-python-27-utf-8-fix.patch b/dev-python/twisted/files/twisted-17.9.0-python-27-utf-8-fix.patch
deleted file mode 100644
index 7e3ec26bcfd..00000000000
--- a/dev-python/twisted/files/twisted-17.9.0-python-27-utf-8-fix.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From c7db4c055e92509e5c19a051cbebea53034994ba Mon Sep 17 00:00:00 2001
-From: Brian Dolbec <bdolbec@gaikai.com>
-Date: Wed, 25 Oct 2017 14:39:57 -0700
-Subject: [PATCH] python-2.7 utf-8 fixes
-
----
- src/twisted/test/test_twistd.py | 14 ++++++++++++--
- 1 file changed, 12 insertions(+), 2 deletions(-)
-
-diff --git a/src/twisted/test/test_twistd.py b/src/twisted/test/test_twistd.py
-index 3a9d337..4b0cf28 100644
---- a/src/twisted/test/test_twistd.py
-+++ b/src/twisted/test/test_twistd.py
-@@ -1902,8 +1902,12 @@ class DaemonizeTests(unittest.TestCase):
- message is Unicode, the child encodes the message as ascii
- with backslash Unicode code points.
- """
-+ if sys.hexversion >= 0x3000000:
-+ reported_str = b'\u2022'
-+ else:
-+ reported_str = b'\xe2\x80\xa2'
- self.assertErrorWritten(raised=u"\u2022",
-- reported=b'1 RuntimeError: \\u2022')
-+ reported=b'1 RuntimeError: ' + reported_str)
-
-
-
-@@ -2003,9 +2007,15 @@ class DaemonizeTests(unittest.TestCase):
- unicode and too long, it's truncated by the child, even if
- this splits a unicode escape sequence.
- """
-+ if sys.hexversion >= 0x3000000:
-+ reported_str = b'\\u2022'
-+ length = 14
-+ else:
-+ reported_str = b'\xe2\x80\xa2'
-+ length = 28
- self.assertErrorWritten(
- raised=u"\u2022" * 30,
-- reported=b'1 RuntimeError: ' + b'\\u2022' * 14,
-+ reported=b'1 RuntimeError: ' + reported_str * length,
- )
-
-
---
-libgit2 0.26.0
-
diff --git a/dev-python/twisted/files/twisted-18.4.0-Disable-writing-of-plugin-cache.patch b/dev-python/twisted/files/twisted-18.4.0-Disable-writing-of-plugin-cache.patch
deleted file mode 100644
index 318304e58df..00000000000
--- a/dev-python/twisted/files/twisted-18.4.0-Disable-writing-of-plugin-cache.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From cac07e9ef273b065eeebbeeaa27155c8402a36e1 Mon Sep 17 00:00:00 2001
-From: Brian Dolbec <dolsen@gentoo.org>
-Date: Sat, 7 Jul 2018 11:37:23 -0700
-Subject: [PATCH] Disable writing of plugin cache
-
----
- src/twisted/plugin.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/twisted/plugin.py b/src/twisted/plugin.py
-index 82522ee..e5849d6 100644
---- a/src/twisted/plugin.py
-+++ b/src/twisted/plugin.py
-@@ -180,7 +180,7 @@ def getCache(module):
- if pluginKey not in existingKeys:
- del dropinDotCache[pluginKey]
- needsWrite = True
-- if needsWrite:
-+ if needsWrite and os.environ.get("TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE") is None:
- try:
- dropinPath.setContent(pickle.dumps(dropinDotCache))
- except OSError as e:
---
-libgit2 0.26.4
-
diff --git a/dev-python/twisted/files/utf8_overrides.patch b/dev-python/twisted/files/utf8_overrides.patch
deleted file mode 100644
index 41f48cebfd8..00000000000
--- a/dev-python/twisted/files/utf8_overrides.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From f8b2e95cc9bd1cbae565e1b4d576950961edc9a7 Mon Sep 17 00:00:00 2001
-From: Brian Dolbec <dolsen@gentoo.org>
-Date: Fri, 31 Mar 2017 09:40:16 -0700
-Subject: [PATCH] UTF8 test overrides: The DaemonizeTests SafeStrTests tests
- may need to be run independantly
-
-Some other tests may leave python in a state that returns a different form of the b'\\u2022'
-bytestring (b'\xe2\x80\xa2') which causes the tests to fail.
-In StafeStrTests, the returned 't\\xfcst' != 't\xc3\xbcst' originally sent, but is just
-the unicode equivalent.
-
-This adds an environment override which can be used to skip these test during a full
-"trial twisted" run. The DaemonizeTests, SafeStrTests can then be run independantly
-with a clean python interpreter.
----
- src/twisted/test/test_reflect.py | 6 ++++++
- src/twisted/test/test_twistd.py | 3 +++
- 2 files changed, 9 insertions(+)
-
-diff --git a/src/twisted/test/test_reflect.py b/src/twisted/test/test_reflect.py
-index ff0c7fc9e..0c13b949b 100644
---- a/src/twisted/test/test_reflect.py
-+++ b/src/twisted/test/test_reflect.py
-@@ -19,6 +19,9 @@ from twisted.python.reflect import (
- accumulateMethods, prefixedMethods, prefixedMethodNames,
- addMethodNamesToDict, fullyQualifiedName)
-
-+UTF8_OVERRIDES = os.environ.get("UTF8_OVERRIDES", False)
-+
-+
-
- class Base(object):
- """
-@@ -553,6 +556,9 @@ class SafeStrTests(TestCase):
- x = b't\xc3\xbcst'
- self.assertEqual(reflect.safe_str(x), x)
-
-+ if UTF8_OVERRIDES:
-+ test_workingUtf8_2.skip = "test_workingUtf8_2 requires to be run independantly of other tests"
-+
-
- def test_workingUtf8_3(self):
- """
-diff --git a/src/twisted/test/test_twistd.py b/src/twisted/test/test_twistd.py
-index b74fe4a08..d55be16b9 100644
---- a/src/twisted/test/test_twistd.py
-+++ b/src/twisted/test/test_twistd.py
-@@ -78,6 +78,7 @@ if getattr(os, 'setuid', None) is None:
- else:
- setuidSkip = None
-
-+UTF8_OVERRIDES = os.environ.get("UTF8_OVERRIDES", False)
-
-
- def patchUserDatabase(patch, user, uid, group, gid):
-@@ -1913,3 +1914,5 @@ class DaemonizeTests(unittest.TestCase):
-
- if _twistd_unix is None:
- DaemonizeTests.skip = "twistd unix support not available"
-+elif UTF8_OVERRIDES:
-+ DaemonizeTests.skip = "twistd.DaemonizeTests testing needs to be run separately"
---
-2.12.1
-
diff --git a/dev-python/twisted/twisted-16.6.0-r3.ebuild b/dev-python/twisted/twisted-16.6.0-r3.ebuild
deleted file mode 100644
index 07002498ec4..00000000000
--- a/dev-python/twisted/twisted-16.6.0-r3.ebuild
+++ /dev/null
@@ -1,185 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-PYTHON_COMPAT=( python2_7 python3_6)
-PYTHON_REQ_USE="threads(+)"
-
-inherit eutils flag-o-matic distutils-r1 versionator
-
-TWISTED_PN="Twisted"
-TWISTED_P="${TWISTED_PN}-${PV}"
-TWISTED_RELEASE=$(get_version_component_range 1-2 "${PV}")
-
-DESCRIPTION="An asynchronous networking framework written in Python"
-HOMEPAGE="https://www.twistedmatrix.com/trac/"
-SRC_URI="https://twistedmatrix.com/Releases/${TWISTED_PN}"
-SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2
- https://dev.gentoo.org/~mgorny/dist/twisted-regen-cache.gz"
-
-# Dropped keywords due to new deps not keyworded
-#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86 ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86"
-
-LICENSE="MIT"
-SLOT="0"
-IUSE="conch crypt http2 serial +soap test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}]
- >=dev-python/zope-interface-4.0.2[${PYTHON_USEDEP}]
- conch? (
- dev-python/pyasn1[${PYTHON_USEDEP}]
- >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
- >=dev-python/appdirs-1.4.0[${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[${PYTHON_USEDEP}] )
- soap? ( $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7) )
- http2? (
- >=dev-python/hyper-h2-2.5.0[${PYTHON_USEDEP}]
- <dev-python/hyper-h2-3.0.0[${PYTHON_USEDEP}]
- >=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
- <dev-python/priority-2.0[${PYTHON_USEDEP}]
- )
- >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
- !dev-python/twisted-core
- !dev-python/twisted-conch
- !dev-python/twisted-lore
- !dev-python/twisted-mail
- !dev-python/twisted-names
- !dev-python/twisted-news
- !dev-python/twisted-pair
- !dev-python/twisted-runner
- !dev-python/twisted-words
- !dev-python/twisted-web
-"
-DEPEND="
- >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}]
- test? (
- dev-python/gmpy[${PYTHON_USEDEP}]
- dev-python/pyasn1[${PYTHON_USEDEP}]
- >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
- >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
- >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
- dev-python/service_identity[${PYTHON_USEDEP}]
- dev-python/idna[${PYTHON_USEDEP}]
- dev-python/pyserial[${PYTHON_USEDEP}]
- >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
- )
-"
-
-PATCHES=(
- # Respect TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE variable.
- "${FILESDIR}/${PN}-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch"
- "${FILESDIR}/test_main.patch"
- "${FILESDIR}/utf8_overrides.patch"
- "${FILESDIR}/${PN}-16.6.0-test-fixes.patch"
-)
-
-S=${WORKDIR}/${TWISTED_P}
-
-python_prepare_all() {
- # disable tests that don't work in our sandbox
- # and other test failures due to our conditions
- if use test ; then
- # Remove since this is an upstream distribution test for making releases
- rm src/twisted/python/test/test_release.py || die "rm src/twisted/python/test/test_release.py FAILED"
- fi
- distutils-r1_python_prepare_all
-}
-
-python_compile() {
- if ! python_is_python3; then
- # Needed to make the sendmsg extension work
- # (see https://twistedmatrix.com/trac/ticket/5701 )
- local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
- local -x CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
- fi
-
- distutils-r1_python_compile
-}
-
-python_test() {
- distutils_install_for_testing
-
- export EMERGE_TEST_OVERRIDE=1
- export UTF8_OVERRIDES=1
- # workaround for the eclass not installing the entry points
- # in the test environment. copy the old 16.3.2 start script
- # to run the tests with
- cp "${FILESDIR}"/trial "${TEST_DIR}" || die
- chmod +x "${TEST_DIR}"/trial || die
-
- pushd "${TEST_DIR}" > /dev/null || die
-
- if ! "${TEST_DIR}"/trial twisted; then
- die "Tests failed with ${EPYTHON}"
- fi
- # due to an anomoly in the tests, python doesn't return the correct form
- # of the escape sequence. So run those test separately with a clean python interpreter
- export UTF8_OVERRIDES=0
- if ! "${TEST_DIR}"/trial twisted.test.test_twistd.DaemonizeTests; then
- die "DaemonizeTests failed with ${EPYTHON}"
- fi
- if ! "${TEST_DIR}"/trial twisted.test.test_reflect.SafeStrTests; then
- die "SafeStrTests failed with ${EPYTHON}"
- fi
-
- popd > /dev/null || die
-}
-
-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
-
- 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"
- einfo "There are a few known python-2.7 errors due to some unicode issues"
- einfo "which are different in Gentoo installed python-2.7"
- 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-18.4.0.ebuild b/dev-python/twisted/twisted-18.4.0.ebuild
deleted file mode 100644
index 131a2e05578..00000000000
--- a/dev-python/twisted/twisted-18.4.0.ebuild
+++ /dev/null
@@ -1,195 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-PYTHON_COMPAT=( python2_7 python3_6 )
-PYTHON_REQ_USE="threads(+)"
-
-inherit distutils-r1
-
-TWISTED_PN="Twisted"
-TWISTED_P="${TWISTED_PN}-${PV}"
-TWISTED_RELEASE=$(ver_cut 1-2)
-
-DESCRIPTION="An asynchronous networking framework written in Python"
-HOMEPAGE="https://www.twistedmatrix.com/trac/"
-SRC_URI="https://twistedmatrix.com/Releases/${TWISTED_PN}"
-SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2
- https://dev.gentoo.org/~mgorny/dist/twisted-regen-cache.gz"
-
-# Dropped keywords due to new deps not keyworded
-#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86 ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~x86"
-
-LICENSE="MIT"
-SLOT="0"
-IUSE="conch crypt http2 serial +soap test"
-RESTRICT="!test? ( test )"
-
-# openssh-7.6_p1 test failures: bug https://twistedmatrix.com/trac/ticket/9311
-RDEPEND="
- >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}]
- >=dev-python/zope-interface-4.4.2[${PYTHON_USEDEP}]
- conch? (
- dev-python/pyasn1[${PYTHON_USEDEP}]
- >=dev-python/cryptography-1.5.0[${PYTHON_USEDEP}]
- >=dev-python/appdirs-1.4.0[${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}] )
- soap? ( $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7) )
- http2? (
- >=dev-python/hyper-h2-3.0.0[${PYTHON_USEDEP}]
- <dev-python/hyper-h2-4.0.0[${PYTHON_USEDEP}]
- >=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
- <dev-python/priority-2.0[${PYTHON_USEDEP}]
- )
- >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
- >=dev-python/automat-0.3.0[${PYTHON_USEDEP}]
- >=dev-python/hyperlink-17.1.1[${PYTHON_USEDEP}]
- !dev-python/twisted-core
- !dev-python/twisted-conch
- !dev-python/twisted-lore
- !dev-python/twisted-mail
- !dev-python/twisted-names
- !dev-python/twisted-news
- !dev-python/twisted-pair
- !dev-python/twisted-runner
- !dev-python/twisted-words
- !dev-python/twisted-web
-"
-DEPEND="
- >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}]
- test? (
- dev-python/gmpy[${PYTHON_USEDEP}]
- dev-python/pyasn1[${PYTHON_USEDEP}]
- >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
- >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
- >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
- dev-python/service_identity[${PYTHON_USEDEP}]
- dev-python/idna[${PYTHON_USEDEP}]
- dev-python/pyserial[${PYTHON_USEDEP}]
- >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
- )
-"
-
-PATCHES=(
- # ${PN}-17.9.0-Fix-test-on-Python-363.patch" <== version specific from upstream
- # Respect TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE variable.
- "${FILESDIR}/${PN}-18.4.0-Disable-writing-of-plugin-cache.patch"
- "${FILESDIR}/test_main.patch"
- "${FILESDIR}/utf8_overrides.patch"
- "${FILESDIR}/${PN}-16.6.0-test-fixes.patch"
- "${FILESDIR}/${PN}-17.9.0-python-27-utf-8-fix.patch"
-)
-
-S=${WORKDIR}/${TWISTED_P}
-
-python_prepare_all() {
- # disable tests that don't work in our sandbox
- # and other test failures due to our conditions
- if use test ; then
- # Remove since this is an upstream distribution test for making releases
- rm src/twisted/python/test/test_release.py || die "rm src/twisted/python/test/test_release.py FAILED"
-
- # Conch doesn't work with latest >=OpenSSH 7.6
- # - https://twistedmatrix.com/trac/ticket/9311
- # - https://twistedmatrix.com/trac/ticket/9515
- rm src/twisted/conch/test/test_conch.py || die "rm src/twisted/conch/test/test_conch.py FAILED"
- rm src/twisted/conch/test/test_cftp.py || die "rm src/twisted/conch/test/test_cftp.py FAILED"
- fi
- distutils-r1_python_prepare_all
-}
-
-python_compile() {
- if ! python_is_python3; then
- # Needed to make the sendmsg extension work
- # (see https://twistedmatrix.com/trac/ticket/5701 )
- local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
- local -x CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
- fi
-
- distutils-r1_python_compile
-}
-
-python_test() {
- distutils_install_for_testing
-
- export EMERGE_TEST_OVERRIDE=1
- export UTF8_OVERRIDES=1
- unset TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE
- # workaround for the eclass not installing the entry points
- # in the test environment. copy the old 16.3.2 start script
- # to run the tests with
- cp "${FILESDIR}"/trial "${TEST_DIR}" || die
- chmod +x "${TEST_DIR}"/trial || die
-
- pushd "${TEST_DIR}" > /dev/null || die
-
- if ! "${TEST_DIR}"/trial twisted; then
- die "Tests failed with ${EPYTHON}"
- fi
- # due to an anomoly in the tests, python doesn't return the correct form
- # of the escape sequence. So run those test separately with a clean python interpreter
- export UTF8_OVERRIDES=0
- if ! "${TEST_DIR}"/trial twisted.test.test_twistd.DaemonizeTests; then
- die "DaemonizeTests failed with ${EPYTHON}"
- fi
- if ! "${TEST_DIR}"/trial twisted.test.test_reflect.SafeStrTests; then
- die "SafeStrTests failed with ${EPYTHON}"
- fi
-
- popd > /dev/null || die
-}
-
-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
-
- 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
-}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2021-03-21 22:42 Michał Górny
0 siblings, 0 replies; 17+ messages in thread
From: Michał Górny @ 2021-03-21 22:42 UTC (permalink / raw
To: gentoo-commits
commit: f07ae90446439f161858e0c011e29ab0fa70c332
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 21 22:29:50 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Mar 21 22:42:14 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f07ae904
dev-python/twisted: Fix tests with incremental-21.3.0
Closes: https://bugs.gentoo.org/774126
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
.../files/twisted-21.2.0-incremental-21.patch | 65 ++++++++++++++++++++++
dev-python/twisted/twisted-21.2.0.ebuild | 7 ++-
2 files changed, 69 insertions(+), 3 deletions(-)
diff --git a/dev-python/twisted/files/twisted-21.2.0-incremental-21.patch b/dev-python/twisted/files/twisted-21.2.0-incremental-21.patch
new file mode 100644
index 00000000000..c726d32cb89
--- /dev/null
+++ b/dev-python/twisted/files/twisted-21.2.0-incremental-21.patch
@@ -0,0 +1,65 @@
+From ab934c065177422a7121e44c792c56c32962c4e4 Mon Sep 17 00:00:00 2001
+From: Thomas Grainger <tagrain@gmail.com>
+Date: Tue, 2 Mar 2021 11:27:56 +0000
+Subject: [PATCH] update tests for incremental >= 21.3.0
+
+---
+ pyproject.toml | 2 +-
+ setup.cfg | 2 +-
+ src/twisted/python/test/test_versions.py | 6 +++---
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/pyproject.toml b/pyproject.toml
+index a7d531b003d..ca12b3ef7e0 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -2,7 +2,7 @@
+ requires = [
+ "setuptools >= 35.0.2",
+ "wheel >= 0.29.0",
+- "incremental >= 16.10.1",
++ "incremental >= 21.3.0",
+ ]
+ build-backend = "setuptools.build_meta"
+
+diff --git a/setup.cfg b/setup.cfg
+index 17501b91ecf..07094f7ea6b 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -28,7 +28,7 @@ python_requires = >=3.6.7
+ install_requires =
+ zope.interface >= 4.4.2
+ constantly >= 15.1
+- incremental >= 16.10.1
++ incremental >= 21.3.0
+ Automat >= 0.8.0
+ hyperlink >= 17.1.1
+ attrs >= 19.2.0
+diff --git a/src/twisted/python/test/test_versions.py b/src/twisted/python/test/test_versions.py
+index 022010a6eec..6707169b1f8 100644
+--- a/src/twisted/python/test/test_versions.py
++++ b/src/twisted/python/test/test_versions.py
+@@ -126,7 +126,7 @@ def test_strWithPrerelease(self):
+ Calling C{str} on a version with a prerelease includes the prerelease.
+ """
+ self.assertEqual(
+- str(Version("dummy", 1, 0, 0, prerelease=1)), "[dummy, version 1.0.0rc1]"
++ str(Version("dummy", 1, 0, 0, prerelease=1)), "[dummy, version 1.0.0.rc1]"
+ )
+
+ def testShort(self):
+@@ -145,7 +145,7 @@ def test_getVersionStringWithPrerelease(self):
+ """
+ self.assertEqual(
+ getVersionString(Version("whatever", 8, 0, 0, prerelease=1)),
+- "whatever 8.0.0rc1",
++ "whatever 8.0.0.rc1",
+ )
+
+ def test_base(self):
+@@ -158,4 +158,4 @@ def test_baseWithPrerelease(self):
+ """
+ The base version includes 'preX' for versions with prereleases.
+ """
+- self.assertEqual(Version("foo", 1, 0, 0, prerelease=8).base(), "1.0.0rc8")
++ self.assertEqual(Version("foo", 1, 0, 0, prerelease=8).base(), "1.0.0.rc8")
diff --git a/dev-python/twisted/twisted-21.2.0.ebuild b/dev-python/twisted/twisted-21.2.0.ebuild
index 6fdafa97f65..eec2177e7cb 100644
--- a/dev-python/twisted/twisted-21.2.0.ebuild
+++ b/dev-python/twisted/twisted-21.2.0.ebuild
@@ -14,6 +14,7 @@ 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"
@@ -59,7 +60,7 @@ RDEPEND="
!dev-python/twisted-web
"
BDEPEND="
- >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}]
+ >=dev-python/incremental-21.3.0[${PYTHON_USEDEP}]
test? (
>=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
dev-python/bcrypt[${PYTHON_USEDEP}]
@@ -76,9 +77,9 @@ BDEPEND="
)
"
-S=${WORKDIR}/${PN}-${P}
-
python_prepare_all() {
+ eapply "${FILESDIR}"/${P}-incremental-21.patch
+
# upstream test for making releases; not very useful and requires
# sphinx (including on py2)
rm src/twisted/python/test/test_release.py || die
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2021-06-01 20:35 Michał Górny
0 siblings, 0 replies; 17+ messages in thread
From: Michał Górny @ 2021-06-01 20:35 UTC (permalink / raw
To: gentoo-commits
commit: 28edb49d257baa865d6fa94e1ab9e1a8a29a8d1f
Author: Ekaterina Vaartis <vaartis <AT> kotobank <DOT> ch>
AuthorDate: Sat May 15 21:22:13 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 1 20:35:34 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28edb49d
dev-python/twisted: Bump to python 3.10
Signed-off-by: Ekaterina Vaartis <vaartis <AT> kotobank.ch>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
.../twisted/files/twisted-21.2.0-force-gtk3.patch | 42 ++++++++++++++++++++++
.../files/twisted-21.2.0-int-from-bytes.patch | 14 ++++++++
...sted-21.2.0.ebuild => twisted-21.2.0-r1.ebuild} | 14 ++++++--
3 files changed, 68 insertions(+), 2 deletions(-)
diff --git a/dev-python/twisted/files/twisted-21.2.0-force-gtk3.patch b/dev-python/twisted/files/twisted-21.2.0-force-gtk3.patch
new file mode 100644
index 00000000000..bed31bcf611
--- /dev/null
+++ b/dev-python/twisted/files/twisted-21.2.0-force-gtk3.patch
@@ -0,0 +1,42 @@
+diff --git a/src/twisted/internet/gireactor.py b/src/twisted/internet/gireactor.py
+index 92596db1da2..a577825a87e 100644
+--- a/src/twisted/internet/gireactor.py
++++ b/src/twisted/internet/gireactor.py
+@@ -24,6 +24,7 @@
+ from twisted.internet.error import ReactorAlreadyRunning
+ from twisted.internet import _glibbase
+ from twisted.python import runtime
++import gi
+ import gi.pygtkcompat
+ from gi.repository import GLib
+
+@@ -68,6 +69,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)
+@@ -112,6 +114,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 d15a9262248..af5092a3614 100644
+--- a/src/twisted/internet/test/test_gireactor.py
++++ b/src/twisted/internet/test/test_gireactor.py
+@@ -25,6 +25,9 @@
+ 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/dev-python/twisted/files/twisted-21.2.0-int-from-bytes.patch b/dev-python/twisted/files/twisted-21.2.0-int-from-bytes.patch
new file mode 100644
index 00000000000..ef9bd777ac7
--- /dev/null
+++ b/dev-python/twisted/files/twisted-21.2.0-int-from-bytes.patch
@@ -0,0 +1,14 @@
+diff --git a/src/twisted/conch/ssh/common.py b/src/twisted/conch/ssh/common.py
+index 3e4f8cdc7..ee3d63143 100644
+--- a/src/twisted/conch/ssh/common.py
++++ b/src/twisted/conch/ssh/common.py
+@@ -11,7 +11,8 @@ Maintainer: Paul Swartz
+
+ import struct
+
+-from cryptography.utils import int_from_bytes, int_to_bytes
++from cryptography.utils import int_to_bytes
++int_from_bytes = int.from_bytes
+
+ from twisted.python.deprecate import deprecated
+ from twisted.python.versions import Version
diff --git a/dev-python/twisted/twisted-21.2.0.ebuild b/dev-python/twisted/twisted-21.2.0-r1.ebuild
similarity index 92%
rename from dev-python/twisted/twisted-21.2.0.ebuild
rename to dev-python/twisted/twisted-21.2.0-r1.ebuild
index d62ac660826..5d0d092f5d4 100644
--- a/dev-python/twisted/twisted-21.2.0.ebuild
+++ b/dev-python/twisted/twisted-21.2.0-r1.ebuild
@@ -3,8 +3,7 @@
EAPI=7
-DISTUTILS_USE_SETUPTOOLS=rdepend
-PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_COMPAT=( python3_{7..10} )
PYTHON_REQ_USE="threads(+)"
inherit distutils-r1 virtualx
@@ -77,6 +76,13 @@ BDEPEND="
)
"
+PATCHES=(
+ # https://twistedmatrix.com/trac/ticket/10200
+ "${FILESDIR}/${P}-force-gtk3.patch"
+ # int_from_bytes is deprecated
+ "${FILESDIR}/${P}-int-from-bytes.patch"
+)
+
python_prepare_all() {
eapply "${FILESDIR}"/${P}-incremental-21.patch
@@ -101,6 +107,10 @@ python_prepare_all() {
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
+
# relies on the pre-CVE parse_qs() behavior in Python
sed -e '/d=c;+=f/d' \
-i src/twisted/web/test/test_http.py || die
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2021-07-29 5:51 Michał Górny
0 siblings, 0 replies; 17+ messages in thread
From: Michał Górny @ 2021-07-29 5:51 UTC (permalink / raw
To: gentoo-commits
commit: 2e1e093b27d86e2dd5562e698e490a0c2b0b1fa9
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 29 05:37:11 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 29 05:51:26 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e1e093b
dev-python/twisted: Bump to 21.7.0
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/twisted/Manifest | 1 +
.../twisted/files/twisted-21.7.0-force-gtk3.patch | 67 ++++++++
dev-python/twisted/twisted-21.7.0.ebuild | 172 +++++++++++++++++++++
3 files changed, 240 insertions(+)
diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index 2c0ee46f9bf..0ed1eeac5fb 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,4 +1,5 @@
DIST Twisted-19.10.0.tar.bz2 3118485 BLAKE2B a0d532b67177aa017e463bf823d7842d4f6ff694f78cd7600865718ffe861023a53ea6a922f7de232133edba26f5255074d7ef277ce8f3bdf02d556ccf4abf41 SHA512 de8d7fd0b2081cebeff68b060c8469377011648bc563a94a993d3530fb007ed42c3a54925c9a10c465ee7a3065cc9108ace12d10d358223fab13494becb9ac4b
DIST Twisted-20.3.0.tar.bz2 3127793 BLAKE2B 2e85fc3ec26d89e563c9e79a5d2adea81ff1745d18f0f92b8d45ae3729fbddf09998664257880372c7a4caeb5977c5cad7c863596b8c27ad7890275cead9f763 SHA512 1b850e5fc21a3630ead4c2cc3622c16e78bb3be38ab11d021779b7ce3d3c30acc4e19d79c7791a5fce6c5c6e09c2baa349901dffe952de67dd98eec419846365
DIST twisted-21.2.0.tar.gz 3882978 BLAKE2B ba37572b0f9eadf2962a2730e4c2c0ed65f582b11b3350034660a2c53c5cd0892b19867d19e0201d4808c09fca621dbe540d153dc6c7d5827d45d2423d19d28b SHA512 fa743dcf22f3c17dfd17f39b7df0cc31fb8ce3e989478ada9a026424ec2de35e6a403ef35acdef5905eed008d42e3c2fee6b7ccdda433e6c250f1feaa83ea8a4
+DIST twisted-21.7.0.tar.gz 3895345 BLAKE2B 510165ad2933f07005e508df5a8bdf2863a7988c0f18fcc089e948d190c65aab32fc876d3120e311e91d6989f1ea2d8b3b5f5db4a9dfc63c38da56213f718728 SHA512 a946769a6bc6c72af26e7763b9e0675788f134b4d005ea89d935da1b1d5f60d92c84fdb2615e442e7da2b98291ee8a63d5236ec7ba72ef04ad3f847b092feecb
DIST twisted-regen-cache.gz 911 BLAKE2B ffd3fcda6c67ffe6fd3ef581c8d507548396b66ed0708e9a5c790095e579c0d5f0f71596acf05712989da2ddef2b8d437eca973bc4d80ef8a9fa852915f38305 SHA512 95a9b931c73017d16d1b5e6b41345dddffe62b6af1a8e93b5e40d06d3d15be17b0dd0181c767ffeeb791534d463764ef9e066fa6c2ee2ac4b53c86d1da8fce03
diff --git a/dev-python/twisted/files/twisted-21.7.0-force-gtk3.patch b/dev-python/twisted/files/twisted-21.7.0-force-gtk3.patch
new file mode 100644
index 00000000000..a2e40559ec5
--- /dev/null
+++ b/dev-python/twisted/files/twisted-21.7.0-force-gtk3.patch
@@ -0,0 +1,67 @@
+From eec6b60116e12e015387fe1fa3a729553d3848bf 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 92596db1d..a577825a8 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
++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):
+ 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)
+@@ -112,6 +114,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 d15a92622..af5092a36 100644
+--- a/src/twisted/internet/test/test_gireactor.py
++++ b/src/twisted/internet/test/test_gireactor.py
+@@ -25,6 +25,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.32.0
+
diff --git a/dev-python/twisted/twisted-21.7.0.ebuild b/dev-python/twisted/twisted-21.7.0.ebuild
new file mode 100644
index 00000000000..68bcdd4ffff
--- /dev/null
+++ b/dev-python/twisted/twisted-21.7.0.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+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 ~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/hyper-h2-3.0.0[${PYTHON_USEDEP}]
+ <dev-python/hyper-h2-4.0.0[${PYTHON_USEDEP}]
+ >=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
+ <dev-python/priority-2.0[${PYTHON_USEDEP}]
+ )
+ !dev-python/twisted-core
+ !dev-python/twisted-conch
+ !dev-python/twisted-lore
+ !dev-python/twisted-mail
+ !dev-python/twisted-names
+ !dev-python/twisted-news
+ !dev-python/twisted-pair
+ !dev-python/twisted-runner
+ !dev-python/twisted-words
+ !dev-python/twisted-web
+"
+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/cryptography-0.9.1[${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/pyopenssl-0.13[${PYTHON_USEDEP}]
+ dev-python/pyserial[${PYTHON_USEDEP}]
+ dev-python/service_identity[${PYTHON_USEDEP}]
+ net-misc/openssh
+ )
+"
+
+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
+
+ # 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
+
+ distutils-r1_python_prepare_all
+}
+
+src_test() {
+ virtx distutils-r1_src_test
+}
+
+python_test() {
+ # TODO: upstream seems to override our build paths
+ distutils_install_for_testing
+
+ "${EPYTHON}" -m twisted.trial twisted ||
+ die "Tests failed with ${EPYTHON}"
+}
+
+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
+
+ 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
+}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2022-02-08 11:43 Michał Górny
0 siblings, 0 replies; 17+ messages in thread
From: Michał Górny @ 2022-02-08 11:43 UTC (permalink / raw
To: gentoo-commits
commit: eb8d3cb0a2e53fd407e3a364b30a75366d7d8835
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 8 11:18:33 2022 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Feb 8 11:43:54 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb8d3cb0
dev-python/twisted: Bump to 22.1.0
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/twisted/Manifest | 1 +
.../twisted/files/twisted-22.1.0-force-gtk3.patch | 67 +++++++++
dev-python/twisted/twisted-22.1.0.ebuild | 162 +++++++++++++++++++++
3 files changed, 230 insertions(+)
diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index 3c5453df8fdc..06f514275b6a 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,2 +1,3 @@
DIST twisted-21.7.0.tar.gz 3895345 BLAKE2B 510165ad2933f07005e508df5a8bdf2863a7988c0f18fcc089e948d190c65aab32fc876d3120e311e91d6989f1ea2d8b3b5f5db4a9dfc63c38da56213f718728 SHA512 a946769a6bc6c72af26e7763b9e0675788f134b4d005ea89d935da1b1d5f60d92c84fdb2615e442e7da2b98291ee8a63d5236ec7ba72ef04ad3f847b092feecb
+DIST twisted-22.1.0.tar.gz 3883519 BLAKE2B 0b438481af94fbfe08c7470a71421e176ca4994efaf7144b2bd3bc7e69c774295e04831d5356af104d087d970856c1c153b30331cb1598226f83e761b624a53c SHA512 1db52865d00e07044bc755b25bef2fa260cf269a8b51512bec97a015fa484d0b331b41154b52f97b5e8c477d3e5ad1d003f5ac15c7361988d073d097c6e7355d
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
new file mode 100644
index 000000000000..7c9f2d558d65
--- /dev/null
+++ b/dev-python/twisted/files/twisted-22.1.0-force-gtk3.patch
@@ -0,0 +1,67 @@
+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/twisted-22.1.0.ebuild b/dev-python/twisted/twisted-22.1.0.ebuild
new file mode 100644
index 000000000000..de7efb1a47ce
--- /dev/null
+++ b/dev-python/twisted/twisted-22.1.0.ebuild
@@ -0,0 +1,162 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+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() {
+ # TODO: upstream seems to override our build paths
+ distutils_install_for_testing
+
+ "${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
+}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2022-02-17 19:40 Michał Górny
0 siblings, 0 replies; 17+ messages in thread
From: Michał Górny @ 2022-02-17 19:40 UTC (permalink / raw
To: gentoo-commits
commit: 1bc3b1b05987d14e32c78eed3dd893183524917a
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 17 19:24:28 2022 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Feb 17 19:40:07 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bc3b1b0
dev-python/twisted: Remove old
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/twisted/Manifest | 1 -
.../twisted/files/twisted-21.7.0-force-gtk3.patch | 67 ---------
dev-python/twisted/twisted-21.7.0-r1.ebuild | 162 --------------------
dev-python/twisted/twisted-21.7.0.ebuild | 164 ---------------------
4 files changed, 394 deletions(-)
diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index 06f514275b6a..cc06b17e4c79 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,3 +1,2 @@
-DIST twisted-21.7.0.tar.gz 3895345 BLAKE2B 510165ad2933f07005e508df5a8bdf2863a7988c0f18fcc089e948d190c65aab32fc876d3120e311e91d6989f1ea2d8b3b5f5db4a9dfc63c38da56213f718728 SHA512 a946769a6bc6c72af26e7763b9e0675788f134b4d005ea89d935da1b1d5f60d92c84fdb2615e442e7da2b98291ee8a63d5236ec7ba72ef04ad3f847b092feecb
DIST twisted-22.1.0.tar.gz 3883519 BLAKE2B 0b438481af94fbfe08c7470a71421e176ca4994efaf7144b2bd3bc7e69c774295e04831d5356af104d087d970856c1c153b30331cb1598226f83e761b624a53c SHA512 1db52865d00e07044bc755b25bef2fa260cf269a8b51512bec97a015fa484d0b331b41154b52f97b5e8c477d3e5ad1d003f5ac15c7361988d073d097c6e7355d
DIST twisted-regen-cache.gz 911 BLAKE2B ffd3fcda6c67ffe6fd3ef581c8d507548396b66ed0708e9a5c790095e579c0d5f0f71596acf05712989da2ddef2b8d437eca973bc4d80ef8a9fa852915f38305 SHA512 95a9b931c73017d16d1b5e6b41345dddffe62b6af1a8e93b5e40d06d3d15be17b0dd0181c767ffeeb791534d463764ef9e066fa6c2ee2ac4b53c86d1da8fce03
diff --git a/dev-python/twisted/files/twisted-21.7.0-force-gtk3.patch b/dev-python/twisted/files/twisted-21.7.0-force-gtk3.patch
deleted file mode 100644
index a2e40559ec59..000000000000
--- a/dev-python/twisted/files/twisted-21.7.0-force-gtk3.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From eec6b60116e12e015387fe1fa3a729553d3848bf 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 92596db1d..a577825a8 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
-+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):
- 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)
-@@ -112,6 +114,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 d15a92622..af5092a36 100644
---- a/src/twisted/internet/test/test_gireactor.py
-+++ b/src/twisted/internet/test/test_gireactor.py
-@@ -25,6 +25,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.32.0
-
diff --git a/dev-python/twisted/twisted-21.7.0-r1.ebuild b/dev-python/twisted/twisted-21.7.0-r1.ebuild
deleted file mode 100644
index cba17b0e9bd4..000000000000
--- a/dev-python/twisted/twisted-21.7.0-r1.ebuild
+++ /dev/null
@@ -1,162 +0,0 @@
-# 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
-
- # 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
-
- distutils-r1_python_prepare_all
-}
-
-src_test() {
- 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
- touch "${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-21.7.0.ebuild
deleted file mode 100644
index e095ce421151..000000000000
--- a/dev-python/twisted/twisted-21.7.0.ebuild
+++ /dev/null
@@ -1,164 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{8..10} )
-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/gmpy[${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}]
- ) ) )
- )
-"
-
-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
-
- # 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
-
- distutils-r1_python_prepare_all
-}
-
-src_test() {
- virtx distutils-r1_src_test
-}
-
-python_test() {
- # TODO: upstream seems to override our build paths
- distutils_install_for_testing
-
- "${EPYTHON}" -m twisted.trial twisted ||
- die "Tests failed with ${EPYTHON}"
-}
-
-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
-
- 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
-}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2022-05-13 9:08 Michał Górny
0 siblings, 0 replies; 17+ messages in thread
From: Michał Górny @ 2022-05-13 9:08 UTC (permalink / raw
To: gentoo-commits
commit: 35339ca7928eeb3ee59b381d1bb3d715055e3e73
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri May 13 06:59:25 2022 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri May 13 09:07:56 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35339ca7
dev-python/twisted: Enable py3.11
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
.../twisted/files/twisted-22.4.0-py311.patch | 55 ++++++++++++++++++++++
dev-python/twisted/twisted-22.4.0.ebuild | 40 ++++++++++------
2 files changed, 80 insertions(+), 15 deletions(-)
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 <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/twisted-22.4.0.ebuild b/dev-python/twisted/twisted-22.4.0.ebuild
index 65b454179630..4b5c0125c4b7 100644
--- a/dev-python/twisted/twisted-22.4.0.ebuild
+++ b/dev-python/twisted/twisted-22.4.0.ebuild
@@ -4,7 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{8..10} pypy3 )
+PYTHON_COMPAT=( python3_{8..11} pypy3 )
PYTHON_REQ_USE="threads(+)"
inherit distutils-r1 virtualx
@@ -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}"
}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2023-10-18 15:56 Michał Górny
0 siblings, 0 replies; 17+ messages in thread
From: Michał Górny @ 2023-10-18 15:56 UTC (permalink / raw
To: gentoo-commits
commit: b7926c19b2c7a6f591e23fa7129d56105eeea746
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 18 15:50:35 2023 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Oct 18 15:56:29 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7926c19
dev-python/twisted: Remove old
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/twisted/Manifest | 2 -
.../twisted/files/twisted-22.1.0-force-gtk3.patch | 67 --------
.../files/twisted-22.10.0-python3.11-tests.patch | 100 ------------
.../twisted/files/twisted-22.10.0-sendmail.patch | 28 ----
dev-python/twisted/twisted-22.10.0-r1.ebuild | 169 --------------------
dev-python/twisted/twisted-22.10.0-r3.ebuild | 173 ---------------------
dev-python/twisted/twisted-23.8.0_rc1.ebuild | 154 ------------------
7 files changed, 693 deletions(-)
diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index cb35e4cd670b..d6ca72cb076e 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,4 +1,2 @@
-DIST twisted-22.10.0.gh.tar.gz 3512714 BLAKE2B 2fd36ec6922f428e959ce0169bb9a3592b8b3e43aff8d34872883ecf0fad8d0fff01a52f06b54df3dc377f4fc1a488b6d66f9287b108b4749bb7d3c749b96061 SHA512 cf9ed96430376d499ae9627a7d0656c05cb99bc9e9b15a8f4166355363818f090bc3c2b383ed4cf19e1e38fb569e8618d35a0ddde2a90a06f3c9a4ea769837e4
DIST twisted-23.8.0.tar.gz 3478691 BLAKE2B 44fa9da691456a2b1d97f54b95787abe3e162b5639ee7ab8779c6d9525eb2a878865f450aa6fd6c461c3eba84f95361d2423e241991f52f91a27b792b6d71123 SHA512 ef0a243a4c22dd31e57087f5b2c21a657b98e23cc486f08b9926a9ebe8c4b6fec137993aea71e6c60abc3d653d995da0f65ff10dfc6c3d2cb7fdae5db08e2532
-DIST twisted-23.8.0rc1.tar.gz 3479000 BLAKE2B d3dbc54759f4dcba422cbcc57451a268834f21616ea2b5d34d972f2647750afa4ae62424ae32b2e0fe22e3a886c45ff1e64280c99553aa1ee52923a192773fdf SHA512 a1e778247a311dda30cd7f9f02fa4ab8848d6d5b89de4ff83dee5a92f968b6ec8df48d1804eef780cd0a9dc1393a1a91d624e9c54e0c9cd52d930ac2b36a0b6c
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.10.0-python3.11-tests.patch b/dev-python/twisted/files/twisted-22.10.0-python3.11-tests.patch
deleted file mode 100644
index b75c97d4997f..000000000000
--- a/dev-python/twisted/files/twisted-22.10.0-python3.11-tests.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-https://src.fedoraproject.org/rpms/python-twisted/blob/rawhide/f/0003-Fix-tests-for-Python-3.11.patch
-
-From b0574816f622bc187389df2183e2bef0492fe5f5 Mon Sep 17 00:00:00 2001
-From: eevel <eevel@weezel3.weezelnet>
-Date: Wed, 2 Nov 2022 20:35:55 -0500
-Subject: [PATCH 3/6] Fix tests for Python 3.11
-
-This is based on a subset of commits from this pull request.
-
-https://github.com/twisted/twisted/pull/11734
-
-- fix twisted.persisted tests (cherry picked from commit 4f6d7fb0749429b092fe7538a7d2b11fe58319a6)
-- fix tests for twisted.spread (cherry picked from commit 525377178adfa987ed56be753aec0fce35d721dc)
-- fix test for twisted.web (cherry picked from commit afcc224a02f72e5d12fa35d223bd753e8086b135)
-- fix persisted tests in twisted.test (cherry picked from commit 4b5ab38b09b326cec7967e04bd4cae8a84bb6784)
-- fix twisted.trial tests (cherry picked from commit f8f56d45113e5f2467a5e8375186e5db6309dfc6)
-- make test_flatten backwards-compatible (cherry picked from commit d91675ac5ffe907fcdbb3d1cedb1240008d81fd1)
---- a/src/twisted/persisted/aot.py
-+++ b/src/twisted/persisted/aot.py
-@@ -399,8 +399,10 @@ class AOTUnjellier:
- inst = klass.__new__(klass)
- if hasattr(klass, "__setstate__"):
- self.callAfter(inst.__setstate__, state)
-- else:
-+ elif isinstance(state, dict):
- inst.__dict__ = state
-+ else:
-+ inst.__dict__ = state.__getstate__()
- return inst
-
- elif c is Ref:
---- a/src/twisted/spread/flavors.py
-+++ b/src/twisted/spread/flavors.py
-@@ -398,6 +398,8 @@ class RemoteCopy(Unjellyable):
- object's dictionary (or a filtered approximation of it depending
- on my peer's perspective).
- """
-+ if not state:
-+ state = {}
- state = {
- x.decode("utf8") if isinstance(x, bytes) else x: y for x, y in state.items()
- }
---- a/src/twisted/spread/jelly.py
-+++ b/src/twisted/spread/jelly.py
-@@ -154,7 +154,8 @@ def _newInstance(cls, state):
- instance = _createBlank(cls)
-
- def defaultSetter(state):
-- instance.__dict__ = state
-+ if isinstance(state, dict):
-+ instance.__dict__ = state or {}
-
- setter = getattr(instance, "__setstate__", defaultSetter)
- setter(state)
---- a/src/twisted/test/test_persisted.py
-+++ b/src/twisted/test/test_persisted.py
-@@ -378,6 +378,10 @@ class AOTTests(TestCase):
- def __dict__(self):
- raise AttributeError()
-
-+ @property
-+ def __getstate__(self):
-+ raise AttributeError()
-+
- self.assertRaises(TypeError, aot.jellyToSource, UnknownType())
-
- def test_basicIdentity(self):
---- a/src/twisted/trial/test/test_pyunitcompat.py
-+++ b/src/twisted/trial/test/test_pyunitcompat.py
-@@ -218,8 +218,10 @@ class PyUnitResultTests(SynchronousTestCase):
- pyresult = pyunit.TestResult()
- result = PyUnitResultAdapter(pyresult)
- result.addError(self, f)
-+ tback = "".join(traceback.format_exception(*exc_info))
- self.assertEqual(
-- pyresult.errors[0][1], "".join(traceback.format_exception(*exc_info))
-+ pyresult.errors[0][1].endswith("ZeroDivisionError: division by zero\n"),
-+ tback.endswith("ZeroDivisionError: division by zero\n"),
- )
-
- def test_trialSkip(self):
---- a/src/twisted/web/test/test_flatten.py
-+++ b/src/twisted/web/test/test_flatten.py
-@@ -706,10 +706,9 @@ class FlattenerErrorTests(SynchronousTestCase):
- Exception while flattening:
- \\[<unrenderable>\\]
- <unrenderable>
-- .*
-+ <Deferred at .* current result: <twisted.python.failure.Failure builtins.RuntimeError: example>>
- File ".*", line \\d*, in _flattenTree
-- element = await element
-- RuntimeError: example
-+ element = await element.*
- """
- ),
- flags=re.MULTILINE,
---
-2.39.2
-
-
diff --git a/dev-python/twisted/files/twisted-22.10.0-sendmail.patch b/dev-python/twisted/files/twisted-22.10.0-sendmail.patch
deleted file mode 100644
index eec57752815d..000000000000
--- a/dev-python/twisted/files/twisted-22.10.0-sendmail.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-https://src.fedoraproject.org/rpms/python-twisted/raw/rawhide/f/0005-fix-sendmail-tests-for-python-3.11.patch
-
-From f29ae1ae433cd9529410a93fd5675cb01460460e Mon Sep 17 00:00:00 2001
-From: eevel <eevel@weezel3.weezelnet>
-Date: Wed, 26 Oct 2022 19:49:33 -0500
-Subject: [PATCH 5/6] fix sendmail tests for python 3.11
-
-(cherry picked from commit 00bf5be704bee022ba4d9b24eb6c2c768b4a1921)
---- a/src/twisted/mail/test/test_smtp.py
-+++ b/src/twisted/mail/test/test_smtp.py
-@@ -1771,7 +1771,8 @@ class SendmailTests(TestCase):
- The default C{reactor} parameter of L{twisted.mail.smtp.sendmail} is
- L{twisted.internet.reactor}.
- """
-- args, varArgs, keywords, defaults = inspect.getargspec(smtp.sendmail)
-+ fullSpec = inspect.getfullargspec(smtp.sendmail)
-+ defaults = fullSpec[3]
- self.assertEqual(reactor, defaults[2])
-
- def _honorsESMTPArguments(self, username, password):
---- /dev/null
-+++ b/src/twisted/newsfragments/10345.misc
-@@ -0,0 +1 @@
-+Fix SendmailTests for python 3.11.
---
-2.39.2
-
-
diff --git a/dev-python/twisted/twisted-22.10.0-r1.ebuild b/dev-python/twisted/twisted-22.10.0-r1.ebuild
deleted file mode 100644
index 2857f4759871..000000000000
--- a/dev-python/twisted/twisted-22.10.0-r1.ebuild
+++ /dev/null
@@ -1,169 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{9..11} 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 -> ${P}.gh.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 ~loong ~m68k ppc ppc64 ~riscv ~s390 sparc x86"
-IUSE="conch http2 serial ssl test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- >=dev-python/attrs-19.2.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/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-3.0.0[${PYTHON_USEDEP}]
- >=dev-python/cryptography-2.6[${PYTHON_USEDEP}]
- dev-python/pyasn1[${PYTHON_USEDEP}]
- )
- http2? (
- <dev-python/h2-5.0.0[${PYTHON_USEDEP}]
- >=dev-python/h2-3.0.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}]
- )
- ssl? (
- >=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}]
- test? (
- $(python_gen_cond_dep '
- >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
- >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
- >=dev-python/cython-test-exception-raiser-1.0.2[${PYTHON_USEDEP}]
- >=dev-python/idna-2.4[${PYTHON_USEDEP}]
- dev-python/hypothesis[${PYTHON_USEDEP}]
- dev-python/pyasn1[${PYTHON_USEDEP}]
- >=dev-python/pyhamcrest-1.9.0[${PYTHON_USEDEP}]
- >=dev-python/pyserial-3.0[${PYTHON_USEDEP}]
- virtual/openssh
- conch? (
- >=dev-python/bcrypt-3.0.0[${PYTHON_USEDEP}]
- >=dev-python/cryptography-2.6[${PYTHON_USEDEP}]
- )
- ssl? (
- >=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})
- )
-"
-
-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
-
- # broken by new expat
- sed -e 's:test_namespaceWithWhitespace:_&:' \
- -i src/twisted/words/test/test_domish.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() {
- # 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}"
-}
-
-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
-}
diff --git a/dev-python/twisted/twisted-22.10.0-r3.ebuild b/dev-python/twisted/twisted-22.10.0-r3.ebuild
deleted file mode 100644
index 4d56b83d2585..000000000000
--- a/dev-python/twisted/twisted-22.10.0-r3.ebuild
+++ /dev/null
@@ -1,173 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_TESTED=( python3_{10..11} pypy3 )
-PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" python3_12 )
-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 -> ${P}.gh.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 ~loong ~m68k ~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.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/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-3.0.0[${PYTHON_USEDEP}]
- >=dev-python/cryptography-2.6[${PYTHON_USEDEP}]
- dev-python/pyasn1[${PYTHON_USEDEP}]
- )
- http2? (
- <dev-python/h2-5.0.0[${PYTHON_USEDEP}]
- >=dev-python/h2-3.0.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}]
- )
- ssl? (
- >=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}]
- test? (
- $(python_gen_cond_dep '
- >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
- >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
- >=dev-python/cython-test-exception-raiser-1.0.2[${PYTHON_USEDEP}]
- >=dev-python/idna-2.4[${PYTHON_USEDEP}]
- dev-python/hypothesis[${PYTHON_USEDEP}]
- dev-python/pyasn1[${PYTHON_USEDEP}]
- >=dev-python/pyhamcrest-1.9.0[${PYTHON_USEDEP}]
- >=dev-python/pyserial-3.0[${PYTHON_USEDEP}]
- virtual/openssh
- conch? (
- >=dev-python/bcrypt-3.0.0[${PYTHON_USEDEP}]
- >=dev-python/cryptography-2.6[${PYTHON_USEDEP}]
- )
- ssl? (
- >=dev-python/pyopenssl-21.0.0[${PYTHON_USEDEP}]
- >=dev-python/service-identity-18.1.0[${PYTHON_USEDEP}]
- )
- ' "${PYTHON_TESTED[@]}")
- $(python_gen_cond_dep '
- dev-python/gmpy[${PYTHON_USEDEP}]
- ' python3_{8..10})
- )
-"
-
-PATCHES=(
- # https://twistedmatrix.com/trac/ticket/10200
- "${FILESDIR}/${PN}-22.1.0-force-gtk3.patch"
-
- "${FILESDIR}/${PN}-22.10.0-python3.11-tests.patch"
- "${FILESDIR}/${PN}-22.10.0-time.patch"
- "${FILESDIR}/${PN}-22.10.0-sendmail.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
-
- # broken by new expat
- sed -e 's:test_namespaceWithWhitespace:_&:' \
- -i src/twisted/words/test/test_domish.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() {
- if ! has "${EPYTHON}" "${PYTHON_TESTED[@]/_/.}"; then
- einfo "Skipping tests on ${EPYTHON} (xfail)"
- return
- fi
-
- "${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
-}
diff --git a/dev-python/twisted/twisted-23.8.0_rc1.ebuild b/dev-python/twisted/twisted-23.8.0_rc1.ebuild
deleted file mode 100644
index bdb064ec3895..000000000000
--- a/dev-python/twisted/twisted-23.8.0_rc1.ebuild
+++ /dev/null
@@ -1,154 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=hatchling
-PYTHON_TESTED=( python3_{10..12} pypy3 )
-PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" )
-PYTHON_REQ_USE="threads(+)"
-
-inherit distutils-r1 pypi virtualx
-
-DESCRIPTION="An asynchronous networking framework written in Python"
-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
-"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~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.8.0[${PYTHON_USEDEP}]
- >=dev-python/constantly-15.1[${PYTHON_USEDEP}]
- >=dev-python/hyperlink-17.1.1[${PYTHON_USEDEP}]
- >=dev-python/incremental-22.10.0[${PYTHON_USEDEP}]
- >=dev-python/typing-extensions-3.10.0[${PYTHON_USEDEP}]
- >=dev-python/zope-interface-5[${PYTHON_USEDEP}]
- conch? (
- >=dev-python/appdirs-1.4.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/priority-2.0[${PYTHON_USEDEP}]
- >=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
- )
- serial? (
- >=dev-python/pyserial-3.0[${PYTHON_USEDEP}]
- )
- ssl? (
- >=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/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/constantly-15.1.0[${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/pyhamcrest-2[${PYTHON_USEDEP}]
- >=dev-python/pyserial-3.0[${PYTHON_USEDEP}]
- virtual/openssh
- ssl? (
- >=dev-python/pyopenssl-21.0.0[${PYTHON_USEDEP}]
- >=dev-python/service-identity-18.1.0[${PYTHON_USEDEP}]
- )
- ' "${PYTHON_TESTED[@]}")
- )
-"
-
-PATCHES=(
- # https://github.com/twisted/twisted/pull/11787
- "${FILESDIR}/${PN}-22.10.0-time.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
-
- # 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
-
- 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() {
- if ! has "${EPYTHON}" "${PYTHON_TESTED[@]/_/.}"; then
- einfo "Skipping tests on ${EPYTHON} (xfail)"
- return
- fi
-
- "${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
-}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2024-01-12 19:00 Michał Górny
0 siblings, 0 replies; 17+ messages in thread
From: Michał Górny @ 2024-01-12 19:00 UTC (permalink / raw
To: gentoo-commits
commit: 1b83e3d052beb537ee6f047f9af1e16045b1491e
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 12 18:59:38 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jan 12 19:00:13 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1b83e3d0
dev-python/twisted: Remove old
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/twisted/Manifest | 2 -
.../twisted/files/twisted-22.10.0-time.patch | 113 ---------------
dev-python/twisted/twisted-23.10.0_rc1.ebuild | 149 --------------------
dev-python/twisted/twisted-23.8.0.ebuild | 154 ---------------------
4 files changed, 418 deletions(-)
diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index 6b5608b66298..8afc2594cc98 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,4 +1,2 @@
DIST twisted-23.10.0.tar.gz 3495627 BLAKE2B 3b5c2dc56686203cfe7c863211f0be34f49b26273af7b0f54a891851cf5f32096da880f35dd549b8ff82c6885fda2f644ef747fc9574e830da4fe2ddb588e70f SHA512 da6cc663005776fca716503ec53ae367576e9c89ec2b90a367e73afb1e63c51a24dfad39b9ed1edb597e77e1d805dcbd179cefc1685faddd4044efc8f6c82d5f
-DIST twisted-23.10.0rc1.tar.gz 3496017 BLAKE2B 5e681b81f51d26cf48d7e5d16af4f5c0ea18aa7c45934efe3f8801a60a8ccf7a7a7a13e49d1c065540cda6571e872ed9fc90ac42c6610fbd2a6d0f0c9288baab SHA512 9122d87f1019a2bfdc1530f176e4c607b9a26bfce937d0436a3c260662599f1058ce04c037ecf71e88d17764df7d03399b5e0e353663e848cb8a8a79992d6260
-DIST twisted-23.8.0.tar.gz 3478691 BLAKE2B 44fa9da691456a2b1d97f54b95787abe3e162b5639ee7ab8779c6d9525eb2a878865f450aa6fd6c461c3eba84f95361d2423e241991f52f91a27b792b6d71123 SHA512 ef0a243a4c22dd31e57087f5b2c21a657b98e23cc486f08b9926a9ebe8c4b6fec137993aea71e6c60abc3d653d995da0f65ff10dfc6c3d2cb7fdae5db08e2532
DIST twisted-regen-cache.gz 911 BLAKE2B ffd3fcda6c67ffe6fd3ef581c8d507548396b66ed0708e9a5c790095e579c0d5f0f71596acf05712989da2ddef2b8d437eca973bc4d80ef8a9fa852915f38305 SHA512 95a9b931c73017d16d1b5e6b41345dddffe62b6af1a8e93b5e40d06d3d15be17b0dd0181c767ffeeb791534d463764ef9e066fa6c2ee2ac4b53c86d1da8fce03
diff --git a/dev-python/twisted/files/twisted-22.10.0-time.patch b/dev-python/twisted/files/twisted-22.10.0-time.patch
deleted file mode 100644
index 1723d69c8a3c..000000000000
--- a/dev-python/twisted/files/twisted-22.10.0-time.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From 75e5e6ba1793efdfef2e2cfada0425bad5f0bcfa Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Fri, 9 Dec 2022 10:16:42 -0800
-Subject: [PATCH 4/6] #11786 fix misuse of mktime in tests
-
-(cherry picked from commit da3bf3dc29f067e7019b2a1c205834ab64b2139a)
---- a/src/twisted/logger/test/test_format.py
-+++ b/src/twisted/logger/test/test_format.py
-@@ -166,16 +166,17 @@ class TimeFormattingTests(unittest.TestCase):
- def testForTimeZone(name: str, expectedDST: str, expectedSTD: str) -> None:
- setTZ(name)
-
-- localDST = mktime((2006, 6, 30, 0, 0, 0, 4, 181, 1))
- localSTD = mktime((2007, 1, 31, 0, 0, 0, 2, 31, 0))
--
-- self.assertEqual(formatTime(localDST), expectedDST)
- self.assertEqual(formatTime(localSTD), expectedSTD)
-
-+ if expectedDST:
-+ localDST = mktime((2006, 6, 30, 0, 0, 0, 4, 181, 1))
-+ self.assertEqual(formatTime(localDST), expectedDST)
-+
- # UTC
- testForTimeZone(
- "UTC+00",
-- "2006-06-30T00:00:00+0000",
-+ None,
- "2007-01-31T00:00:00+0000",
- )
-
-@@ -196,7 +197,7 @@ class TimeFormattingTests(unittest.TestCase):
- # No DST
- testForTimeZone(
- "CST+06",
-- "2006-06-30T00:00:00-0600",
-+ None,
- "2007-01-31T00:00:00-0600",
- )
-
-@@ -211,7 +212,7 @@ class TimeFormattingTests(unittest.TestCase):
- """
- If C{timeFormat} argument is L{None}, we get the default output.
- """
-- t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, 1))
-+ t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, -1))
- self.assertEqual(formatTime(t, timeFormat=None), "-")
- self.assertEqual(formatTime(t, timeFormat=None, default="!"), "!")
-
-@@ -219,7 +220,7 @@ class TimeFormattingTests(unittest.TestCase):
- """
- Alternate time format in output.
- """
-- t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, 1))
-+ t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, -1))
- self.assertEqual(formatTime(t, timeFormat="%Y/%W"), "2013/38")
-
- def test_formatTimePercentF(self) -> None:
-@@ -246,7 +247,7 @@ class ClassicLogFormattingTests(unittest.TestCase):
- addTZCleanup(self)
- setTZ("UTC+00")
-
-- t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, 1))
-+ t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, -1))
- event = dict(log_format="XYZZY", log_time=t)
- self.assertEqual(
- formatEventAsClassicLogText(event),
-@@ -539,7 +540,7 @@ class EventAsTextTests(unittest.TestCase):
- except CapturedError:
- f = Failure()
-
-- t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, 1))
-+ t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, -1))
- event: LogEvent = {
- "log_format": "ABCD",
- "log_system": "fake_system",
-@@ -573,7 +574,7 @@ class EventAsTextTests(unittest.TestCase):
- except CapturedError:
- f = Failure()
-
-- t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, 1))
-+ t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, -1))
- event: LogEvent = {
- "log_format": "ABCD",
- "log_system": "fake_system",
-@@ -601,7 +602,7 @@ class EventAsTextTests(unittest.TestCase):
- except CapturedError:
- f = Failure()
-
-- t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, 1))
-+ t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, -1))
- event: LogEvent = {
- "log_format": "ABCD",
- "log_time": t,
-@@ -628,7 +629,7 @@ class EventAsTextTests(unittest.TestCase):
- except CapturedError:
- f = Failure()
-
-- t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, 1))
-+ t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, -1))
- event: LogEvent = {
- "log_format": "ABCD",
- "log_time": t,
-@@ -657,7 +658,7 @@ class EventAsTextTests(unittest.TestCase):
- except CapturedError:
- f = Failure()
-
-- t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, 1))
-+ t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, -1))
- event: LogEvent = {
- "log_format": "ABCD",
- "log_time": t,
---
-2.39.2
diff --git a/dev-python/twisted/twisted-23.10.0_rc1.ebuild b/dev-python/twisted/twisted-23.10.0_rc1.ebuild
deleted file mode 100644
index 345f2095aeac..000000000000
--- a/dev-python/twisted/twisted-23.10.0_rc1.ebuild
+++ /dev/null
@@ -1,149 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=hatchling
-PYTHON_TESTED=( python3_{10..12} pypy3 )
-PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" )
-PYTHON_REQ_USE="threads(+)"
-
-inherit distutils-r1 pypi virtualx
-
-DESCRIPTION="An asynchronous networking framework written in Python"
-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
-"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~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.8.0[${PYTHON_USEDEP}]
- >=dev-python/constantly-15.1[${PYTHON_USEDEP}]
- >=dev-python/hyperlink-17.1.1[${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-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/priority-2.0[${PYTHON_USEDEP}]
- >=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
- )
- serial? (
- >=dev-python/pyserial-3.0[${PYTHON_USEDEP}]
- )
- ssl? (
- >=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/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/constantly-15.1.0[${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/pyhamcrest-2[${PYTHON_USEDEP}]
- >=dev-python/pyserial-3.0[${PYTHON_USEDEP}]
- virtual/openssh
- ssl? (
- >=dev-python/pyopenssl-21.0.0[${PYTHON_USEDEP}]
- >=dev-python/service-identity-18.1.0[${PYTHON_USEDEP}]
- )
- ' "${PYTHON_TESTED[@]}")
- )
-"
-
-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
-
- # 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
-
- 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() {
- if ! has "${EPYTHON}" "${PYTHON_TESTED[@]/_/.}"; then
- einfo "Skipping tests on ${EPYTHON} (xfail)"
- return
- fi
-
- "${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
-}
diff --git a/dev-python/twisted/twisted-23.8.0.ebuild b/dev-python/twisted/twisted-23.8.0.ebuild
deleted file mode 100644
index 6c1de8481e66..000000000000
--- a/dev-python/twisted/twisted-23.8.0.ebuild
+++ /dev/null
@@ -1,154 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=hatchling
-PYTHON_TESTED=( python3_{10..12} pypy3 )
-PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" )
-PYTHON_REQ_USE="threads(+)"
-
-inherit distutils-r1 pypi virtualx
-
-DESCRIPTION="An asynchronous networking framework written in Python"
-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
-"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k 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.8.0[${PYTHON_USEDEP}]
- >=dev-python/constantly-15.1[${PYTHON_USEDEP}]
- >=dev-python/hyperlink-17.1.1[${PYTHON_USEDEP}]
- >=dev-python/incremental-22.10.0[${PYTHON_USEDEP}]
- >=dev-python/typing-extensions-3.10.0[${PYTHON_USEDEP}]
- >=dev-python/zope-interface-5[${PYTHON_USEDEP}]
- conch? (
- >=dev-python/appdirs-1.4.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/priority-2.0[${PYTHON_USEDEP}]
- >=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
- )
- serial? (
- >=dev-python/pyserial-3.0[${PYTHON_USEDEP}]
- )
- ssl? (
- >=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/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/constantly-15.1.0[${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/pyhamcrest-2[${PYTHON_USEDEP}]
- >=dev-python/pyserial-3.0[${PYTHON_USEDEP}]
- virtual/openssh
- ssl? (
- >=dev-python/pyopenssl-21.0.0[${PYTHON_USEDEP}]
- >=dev-python/service-identity-18.1.0[${PYTHON_USEDEP}]
- )
- ' "${PYTHON_TESTED[@]}")
- )
-"
-
-PATCHES=(
- # https://github.com/twisted/twisted/pull/11787
- "${FILESDIR}/${PN}-22.10.0-time.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
-
- # 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
-
- 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() {
- if ! has "${EPYTHON}" "${PYTHON_TESTED[@]/_/.}"; then
- einfo "Skipping tests on ${EPYTHON} (xfail)"
- return
- fi
-
- "${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
-}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
@ 2024-08-01 5:07 Petr Vaněk
0 siblings, 0 replies; 17+ messages in thread
From: Petr Vaněk @ 2024-08-01 5:07 UTC (permalink / raw
To: gentoo-commits
commit: 4e9a65f827401a6888820c1557109f8a441a550c
Author: Petr Vaněk <arkamar <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 1 04:37:51 2024 +0000
Commit: Petr Vaněk <arkamar <AT> gentoo <DOT> org>
CommitDate: Thu Aug 1 05:05:45 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4e9a65f8
dev-python/twisted: skip DSA tests rather than restricting openssh
Skipping related tests is preferable to restricting openssh, as
downgrade may brick it.
Signed-off-by: Petr Vaněk <arkamar <AT> gentoo.org>
.../files/twisted-24.3.0-skip-dsa-tests.patch | 75 ++++++++++++++++++++++
dev-python/twisted/twisted-24.3.0.ebuild | 6 +-
dev-python/twisted/twisted-24.3.0_p20240628.ebuild | 3 +-
dev-python/twisted/twisted-24.7.0_rc1.ebuild | 3 +-
4 files changed, 81 insertions(+), 6 deletions(-)
diff --git a/dev-python/twisted/files/twisted-24.3.0-skip-dsa-tests.patch b/dev-python/twisted/files/twisted-24.3.0-skip-dsa-tests.patch
new file mode 100644
index 000000000000..9dabba43391a
--- /dev/null
+++ b/dev-python/twisted/files/twisted-24.3.0-skip-dsa-tests.patch
@@ -0,0 +1,75 @@
+From b948467c3f01cc46b5dcda8802b913295b7c8999 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20Van=C4=9Bk?= <arkamar@atlas.cz>
+Date: Wed, 31 Jul 2024 18:05:01 +0200
+Subject: [PATCH] Skip tests requiring DSA if SSH does not support DSS
+
+Modern OpenSSH no longer supports DSA/DSS. We need to skip tests that
+use DSA if it is not supported by the installed SSH. The availability of
+DSA can be checked by querying `ssh -Q key`, which includes `ssh-dss` in
+the output if DSS is available, as suggested in [1].
+
+[1] https://github.com/twisted/twisted/issues/12273#issuecomment-2260799255
+
+Issue: https://github.com/twisted/twisted/issues/12273
+
+Based on upstream PR https://github.com/twisted/twisted/pull/12274
+
+diff --git a/src/twisted/conch/test/test_cftp.py b/src/twisted/conch/test/test_cftp.py
+index 40b2deaedb..51a978de4b 100644
+--- a/src/twisted/conch/test/test_cftp.py
++++ b/src/twisted/conch/test/test_cftp.py
+@@ -20,6 +20,7 @@ from zope.interface import implementer
+
+ from twisted.conch import ls
+ from twisted.conch.interfaces import ISFTPFile
++from twisted.conch.test.test_conch import HAS_DSA
+ from twisted.conch.test.test_filetransfer import FileTransferTestAvatar, SFTPTestBase
+ from twisted.cred import portal
+ from twisted.internet import defer, error, interfaces, protocol, reactor
+@@ -1436,6 +1437,7 @@ exit
+ @skipIf(skipTests, "don't run w/o spawnProcess or cryptography")
+ @skipIf(not which("ssh"), "no ssh command-line client available")
+ @skipIf(not which("sftp"), "no sftp command-line client available")
++@skipIf(not HAS_DSA, "needs ssh supporting dsa")
+ class OurServerSftpClientTests(CFTPClientTestBase):
+ """
+ Test the sftp server against sftp command line client.
+diff --git a/src/twisted/conch/test/test_conch.py b/src/twisted/conch/test/test_conch.py
+index 45b357c995..9e77c9b2e9 100644
+--- a/src/twisted/conch/test/test_conch.py
++++ b/src/twisted/conch/test/test_conch.py
+@@ -59,6 +59,21 @@ except ImportError as e:
+ else:
+ StdioInteractingSession = _StdioInteractingSession
+
++def _has_dsa():
++ has_dsa = False
++ try:
++ output = subprocess.check_output(
++ [which("ssh")[0], "-Q", "key"], stderr=subprocess.STDOUT, text=True
++ )
++ keys = output.split()
++ if "ssh-dss" in keys:
++ has_dsa = True
++ except BaseException:
++ pass
++ return has_dsa
++
++HAS_DSA = _has_dsa()
++
+
+ def _has_ipv6():
+ """Returns True if the system can bind an IPv6 address."""
+@@ -551,6 +566,9 @@ class OpenSSHClientMixin:
+ if not which("ssh"):
+ skip = "no ssh command-line client available"
+
++ if not HAS_DSA:
++ skip = "needs ssh supporting dsa"
++
+ def execute(self, remoteCommand, process, sshArgs=""):
+ """
+ Connects to the SSH server started in L{ConchServerSetupMixin.setUp} by
+--
+2.44.2
+
diff --git a/dev-python/twisted/twisted-24.3.0.ebuild b/dev-python/twisted/twisted-24.3.0.ebuild
index ef1b40fca895..bc02689ec2f8 100644
--- a/dev-python/twisted/twisted-24.3.0.ebuild
+++ b/dev-python/twisted/twisted-24.3.0.ebuild
@@ -55,7 +55,6 @@ RDEPEND="
>=dev-python/idna-2.4[${PYTHON_USEDEP}]
)
"
-# tests fail with openssh-9.8, see https://github.com/twisted/twisted/issues/12273
BDEPEND="
>=dev-python/hatch-fancy-pypi-readme-22.5.0[${PYTHON_USEDEP}]
>=dev-python/incremental-22.10.0[${PYTHON_USEDEP}]
@@ -73,7 +72,6 @@ BDEPEND="
>=dev-python/pyhamcrest-2[${PYTHON_USEDEP}]
>=dev-python/pyserial-3.0[${PYTHON_USEDEP}]
virtual/openssh
- <net-misc/openssh-9.8
ssl? (
>=dev-python/pyopenssl-21.0.0[${PYTHON_USEDEP}]
>=dev-python/service-identity-18.1.0[${PYTHON_USEDEP}]
@@ -82,6 +80,10 @@ BDEPEND="
)
"
+PATCHES=(
+ "${FILESDIR}/${PN}-24.3.0-skip-dsa-tests.patch"
+)
+
python_prepare_all() {
# upstream test for making releases; not very useful and requires
# sphinx (including on py2)
diff --git a/dev-python/twisted/twisted-24.3.0_p20240628.ebuild b/dev-python/twisted/twisted-24.3.0_p20240628.ebuild
index 044b23c244e6..3e145cb0de1f 100644
--- a/dev-python/twisted/twisted-24.3.0_p20240628.ebuild
+++ b/dev-python/twisted/twisted-24.3.0_p20240628.ebuild
@@ -61,7 +61,6 @@ RDEPEND="
>=dev-python/idna-2.4[${PYTHON_USEDEP}]
)
"
-# tests fail with openssh-9.8, see https://github.com/twisted/twisted/issues/12273
BDEPEND="
>=dev-python/hatch-fancy-pypi-readme-22.5.0[${PYTHON_USEDEP}]
>=dev-python/incremental-22.10.0[${PYTHON_USEDEP}]
@@ -79,7 +78,6 @@ BDEPEND="
>=dev-python/pyhamcrest-2[${PYTHON_USEDEP}]
>=dev-python/pyserial-3.0[${PYTHON_USEDEP}]
virtual/openssh
- <net-misc/openssh-9.8
ssl? (
>=dev-python/pyopenssl-21.0.0[${PYTHON_USEDEP}]
>=dev-python/service-identity-18.1.0[${PYTHON_USEDEP}]
@@ -89,6 +87,7 @@ BDEPEND="
"
PATCHES=(
+ "${FILESDIR}/${PN}-24.3.0-skip-dsa-tests.patch"
"${FILESDIR}/${P}-skip-py313-test.patch"
)
diff --git a/dev-python/twisted/twisted-24.7.0_rc1.ebuild b/dev-python/twisted/twisted-24.7.0_rc1.ebuild
index ceb4aee19fe2..ba4dbbbf84fe 100644
--- a/dev-python/twisted/twisted-24.7.0_rc1.ebuild
+++ b/dev-python/twisted/twisted-24.7.0_rc1.ebuild
@@ -55,7 +55,6 @@ RDEPEND="
>=dev-python/idna-2.4[${PYTHON_USEDEP}]
)
"
-# tests fail with openssh-9.8, see https://github.com/twisted/twisted/issues/12273
BDEPEND="
>=dev-python/hatch-fancy-pypi-readme-22.5.0[${PYTHON_USEDEP}]
>=dev-python/incremental-22.10.0[${PYTHON_USEDEP}]
@@ -73,7 +72,6 @@ BDEPEND="
>=dev-python/pyhamcrest-2[${PYTHON_USEDEP}]
>=dev-python/pyserial-3.0[${PYTHON_USEDEP}]
virtual/openssh
- <net-misc/openssh-9.8
ssl? (
>=dev-python/pyopenssl-21.0.0[${PYTHON_USEDEP}]
>=dev-python/service-identity-18.1.0[${PYTHON_USEDEP}]
@@ -83,6 +81,7 @@ BDEPEND="
"
PATCHES=(
+ "${FILESDIR}/${PN}-24.3.0-skip-dsa-tests.patch"
"${FILESDIR}/${PN}-24.3.0_p20240628-skip-py313-test.patch"
"${FILESDIR}/${PN}-24.7.0_rc1-skip-py313-tests.patch"
)
^ permalink raw reply related [flat|nested] 17+ messages in thread
end of thread, other threads:[~2024-08-01 5:07 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-27 15:22 [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2024-08-01 5:07 Petr Vaněk
2024-01-12 19:00 Michał Górny
2023-10-18 15:56 Michał Górny
2022-05-13 9:08 Michał Górny
2022-02-17 19:40 Michał Górny
2022-02-08 11:43 Michał Górny
2021-07-29 5:51 Michał Górny
2021-06-01 20:35 Michał Górny
2021-03-21 22:42 Michał Górny
2020-06-04 6:24 Michał Górny
2020-05-27 15:22 Michał Górny
2020-04-24 19:24 Michał Górny
2018-07-07 19:03 Brian Dolbec
2017-10-27 2:29 Brian Dolbec
2017-03-30 2:40 Brian Dolbec
2016-10-07 18:11 Brian Dolbec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox