public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/files/, dev-python/twisted/
@ 2017-03-31 21:11 Brian Dolbec
  0 siblings, 0 replies; 10+ messages in thread
From: Brian Dolbec @ 2017-03-31 21:11 UTC (permalink / raw
  To: gentoo-commits

commit:     60c130fb3c577d11be4f0cb4fe15696f8e2e9a2d
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 31 20:18:47 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Mar 31 21:08:51 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60c130fb

dev-python/twisted: Work on the test patches, separate some for upstream submission

Separate several test fixes and improve them for possible inclusion upstream.
Determined that there were some python anomlies occuring causing some utf8 test failures.
Isolate those with an UTF8_OVERRIDES environment variable.  Then run them separately
after the main twisted test run.
Adjust the ebuild to suit the patch and test changes.

Package-Manager: Portage-2.3.5, Repoman-2.3.2_p30

 dev-python/twisted/files/test_main.patch           |  73 +++++++++++++
 .../twisted/files/twisted-16.6.0-test-fixes.patch  | 114 ++-------------------
 dev-python/twisted/files/utf8_overrides.patch      |  64 ++++++++++++
 ...sted-16.6.0.ebuild => twisted-16.6.0-r1.ebuild} |  12 +++
 4 files changed, 157 insertions(+), 106 deletions(-)

diff --git a/dev-python/twisted/files/test_main.patch b/dev-python/twisted/files/test_main.patch
new file mode 100644
index 00000000000..bfef40450d5
--- /dev/null
+++ b/dev-python/twisted/files/test_main.patch
@@ -0,0 +1,73 @@
+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/twisted-16.6.0-test-fixes.patch b/dev-python/twisted/files/twisted-16.6.0-test-fixes.patch
index a04cafd1ccb..3ce04aa3f68 100644
--- a/dev-python/twisted/files/twisted-16.6.0-test-fixes.patch
+++ b/dev-python/twisted/files/twisted-16.6.0-test-fixes.patch
@@ -1,7 +1,7 @@
-From 7fddbadde3f1f65c1ef78223e6af98a066a2315b Mon Sep 17 00:00:00 2001
+From 91b6d8b5b9d602152fb7148c6e2921463b93a8a5 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
+Date: Fri, 31 Mar 2017 10:55:32 -0700
+Subject: [PATCH] twisted test overrides
 
 ---
  src/twisted/internet/test/test_gireactor.py |  3 ++-
@@ -10,14 +10,11 @@ Subject: [PATCH] Twisted-16.6.0 test fixes
  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_ident.py              |  5 ++++-
  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(-)
+ 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
@@ -169,17 +166,10 @@ index 3ce2bdd60..494674bc7 100644
 +
 +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
+index d86b840e5..3cc40261f 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
+@@ -12,7 +12,7 @@ from twisted.protocols import ident
  from twisted.python import failure
  from twisted.internet import error
  from twisted.internet import defer
@@ -188,15 +178,7 @@ index d86b840e5..028778a2d 100644
  
  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):
+@@ -216,6 +216,9 @@ class ProcMixinTests(unittest.TestCase):
          """
          L{ident.ProcServerMixin.lookup} uses the Linux TCP process table.
          """
@@ -206,26 +188,6 @@ index d86b840e5..028778a2d 100644
          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
@@ -287,66 +249,6 @@ index 3d92633d6..c08809a66 100644
          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

diff --git a/dev-python/twisted/files/utf8_overrides.patch b/dev-python/twisted/files/utf8_overrides.patch
new file mode 100644
index 00000000000..41f48cebfd8
--- /dev/null
+++ b/dev-python/twisted/files/utf8_overrides.patch
@@ -0,0 +1,64 @@
+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.ebuild b/dev-python/twisted/twisted-16.6.0-r1.ebuild
similarity index 90%
rename from dev-python/twisted/twisted-16.6.0.ebuild
rename to dev-python/twisted/twisted-16.6.0-r1.ebuild
index e8d10cecd29..74f7447e1fb 100644
--- a/dev-python/twisted/twisted-16.6.0.ebuild
+++ b/dev-python/twisted/twisted-16.6.0-r1.ebuild
@@ -67,6 +67,8 @@ DEPEND="
 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"
 )
 
@@ -95,6 +97,7 @@ 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
@@ -105,6 +108,15 @@ python_test() {
 	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
 }


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/files/, dev-python/twisted/
@ 2017-05-03  9:26 Michał Górny
  0 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2017-05-03  9:26 UTC (permalink / raw
  To: gentoo-commits

commit:     f82d9d8f774dd4f7d2ad924ca1abd81ce9812e7e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May  3 07:49:27 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May  3 09:26:01 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f82d9d8f

dev-python/twisted: Clean old versions up

 dev-python/twisted/Manifest                        |   3 -
 ...t_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch |  11 --
 dev-python/twisted/twisted-16.2.0.ebuild           | 129 ----------------
 dev-python/twisted/twisted-16.3.2.ebuild           | 133 ----------------
 dev-python/twisted/twisted-16.4.1.ebuild           | 170 ---------------------
 5 files changed, 446 deletions(-)

diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index 19a472c33ce..3f7728f2a58 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,5 +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
-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
 DIST Twisted-17.1.0.tar.bz2 2997334 SHA256 dbf211d70afe5b4442e3933ff01859533eba9f13d8b3e2e1b97dc2125e2d44dc SHA512 e5eedc9a70b7e4d0ec18dddaa82aa9a784e96fd517db65c278d822d15e8bdc65a35307a5a0474eb68dcb73fcd5508086bec605580a9f2f767bcbe27d714b4966 WHIRLPOOL 828a939134df47950a285c732867b3d4172e5e86a75fbdc1cc4365b5a24699a0b3fcb573b7e3d389eea591fc9fc79456c09f2d2c8f08d7e1215dc5761e88ed8e

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
deleted file mode 100644
index 2fe22f1640b..00000000000
--- a/dev-python/twisted/files/twisted-core-9.0.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- 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/twisted-16.2.0.ebuild b/dev-python/twisted/twisted-16.2.0.ebuild
deleted file mode 100644
index f4e6bdcf992..00000000000
--- a/dev-python/twisted/twisted-16.2.0.ebuild
+++ /dev/null
@@ -1,129 +0,0 @@
-# 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})
-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 ~ppc ~ppc64 ~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) )
-	!dev-python/twisted-conch
-	!dev-python/twisted-core
-	!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-web
-	!dev-python/twisted-words
-"
-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}]
-		$(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
deleted file mode 100644
index 26b3776bb69..00000000000
--- a/dev-python/twisted/twisted-16.3.2.ebuild
+++ /dev/null
@@ -1,133 +0,0 @@
-# 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})
-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 ~ppc ~ppc64 ~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
-}

diff --git a/dev-python/twisted/twisted-16.4.1.ebuild b/dev-python/twisted/twisted-16.4.1.ebuild
deleted file mode 100644
index 457429d4e73..00000000000
--- a/dev-python/twisted/twisted-16.4.1.ebuild
+++ /dev/null
@@ -1,170 +0,0 @@
-# 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"
-
-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/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-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.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-conch
-	!dev-python/twisted-core
-	!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-web
-	!dev-python/twisted-words
-"
-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"
-)
-
-_twisted_prepare_test() {
-	# Remove since this is an upstream distribution test for making releases
-	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
-
-	# Remove tests known to fail due to the network sandbox
-	rm -R twisted/pair/test/test_*.py || die "rm twisted/pair/test/test_*.py FAILED"
-	sed \
-		-e "s/test_loggingFactoryOpensLogfileAutomatically/_&/" \
-		-i twisted/test/test_policies.py
-	sed \
-		-e "s/testLookupProcNetTcp/_&/" \
-		-i twisted/test/test_ident.py
-
-	# py2.7 only failures... appears to get the wrong form of the correct data
-	# upstream bug: https://twistedmatrix.com/trac/ticket/8872
-	sed \
-		-e "s/test_unicodeErrorMessageTruncated(self)/_&/" \
-		-e "s/test_unicodeError/_&/" \
-		-i twisted/test/test_twistd.py
-
-	# disable due to removing some tests from installation
-	sed \
-		-e "s/test_exist/_&/" \
-		-i twisted/python/test/test_dist3.py
-}
-
-python_prepare_all() {
-	# disable tests that don't work in our sandbox
-	# and other test failures due to our conditions
-	if use test ; then
-		_twisted_prepare_test
-	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
-
-	# 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}"/lib/
-
-	pushd "${TEST_DIR}"/lib > /dev/null || die
-
-	if ! "${TEST_DIR}"/lib/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(){
-	# 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] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/files/, dev-python/twisted/
@ 2019-09-18 16:23 Michał Górny
  0 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2019-09-18 16:23 UTC (permalink / raw
  To: gentoo-commits

commit:     a6e7afbaec56eb08f43682f6381c16b9f1e7198f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 18 16:17:04 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Sep 18 16:23:23 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6e7afba

dev-python/twisted: Remove +x from files/trial

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/twisted/files/trial              | 0
 dev-python/twisted/twisted-16.6.0-r3.ebuild | 3 ++-
 dev-python/twisted/twisted-17.1.0-r2.ebuild | 3 ++-
 dev-python/twisted/twisted-17.9.0.ebuild    | 3 ++-
 dev-python/twisted/twisted-18.4.0.ebuild    | 3 ++-
 dev-python/twisted/twisted-18.7.0.ebuild    | 3 ++-
 6 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/dev-python/twisted/files/trial b/dev-python/twisted/files/trial
old mode 100755
new mode 100644

diff --git a/dev-python/twisted/twisted-16.6.0-r3.ebuild b/dev-python/twisted/twisted-16.6.0-r3.ebuild
index cc2d554f402..61c95aa34aa 100644
--- a/dev-python/twisted/twisted-16.6.0-r3.ebuild
+++ b/dev-python/twisted/twisted-16.6.0-r3.ebuild
@@ -112,7 +112,8 @@ python_test() {
 	# 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}"
+	cp "${FILESDIR}"/trial "${TEST_DIR}" || die
+	chmod +x "${TEST_DIR}"/trial || die
 
 	pushd "${TEST_DIR}" > /dev/null || die
 

diff --git a/dev-python/twisted/twisted-17.1.0-r2.ebuild b/dev-python/twisted/twisted-17.1.0-r2.ebuild
index 7b72031402e..2c5297195b2 100644
--- a/dev-python/twisted/twisted-17.1.0-r2.ebuild
+++ b/dev-python/twisted/twisted-17.1.0-r2.ebuild
@@ -113,7 +113,8 @@ python_test() {
 	# 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}"
+	cp "${FILESDIR}"/trial "${TEST_DIR}" || die
+	chmod +x "${TEST_DIR}"/trial || die
 
 	pushd "${TEST_DIR}" > /dev/null || die
 

diff --git a/dev-python/twisted/twisted-17.9.0.ebuild b/dev-python/twisted/twisted-17.9.0.ebuild
index d9ab3a98e0b..2af9dc59009 100644
--- a/dev-python/twisted/twisted-17.9.0.ebuild
+++ b/dev-python/twisted/twisted-17.9.0.ebuild
@@ -120,7 +120,8 @@ python_test() {
 	# 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}"
+	cp "${FILESDIR}"/trial "${TEST_DIR}" || die
+	chmod +x "${TEST_DIR}"/trial || die
 
 	pushd "${TEST_DIR}" > /dev/null || die
 

diff --git a/dev-python/twisted/twisted-18.4.0.ebuild b/dev-python/twisted/twisted-18.4.0.ebuild
index 05bc6ecafa7..62428e4db22 100644
--- a/dev-python/twisted/twisted-18.4.0.ebuild
+++ b/dev-python/twisted/twisted-18.4.0.ebuild
@@ -119,7 +119,8 @@ python_test() {
 	# 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}"
+	cp "${FILESDIR}"/trial "${TEST_DIR}" || die
+	chmod +x "${TEST_DIR}"/trial || die
 
 	pushd "${TEST_DIR}" > /dev/null || die
 

diff --git a/dev-python/twisted/twisted-18.7.0.ebuild b/dev-python/twisted/twisted-18.7.0.ebuild
index a3d79b03733..9b927dd62be 100644
--- a/dev-python/twisted/twisted-18.7.0.ebuild
+++ b/dev-python/twisted/twisted-18.7.0.ebuild
@@ -121,7 +121,8 @@ python_test() {
 	# 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}"
+	cp "${FILESDIR}"/trial "${TEST_DIR}" || die
+	chmod +x "${TEST_DIR}"/trial || die
 
 	pushd "${TEST_DIR}" > /dev/null || die
 


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/files/, dev-python/twisted/
@ 2020-05-27 11:00 Michał Górny
  0 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2020-05-27 11:00 UTC (permalink / raw
  To: gentoo-commits

commit:     b98dada7f5fb8026d33d2743451e62af63240327
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 27 10:07:25 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May 27 11:00:20 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b98dada7

dev-python/twisted: Fix 19.10.0 on py3.8

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../twisted/files/twisted-19.10.0-py38.patch       | 110 +++++++++++++++++++++
 dev-python/twisted/twisted-19.10.0.ebuild          |   8 +-
 2 files changed, 117 insertions(+), 1 deletion(-)

diff --git a/dev-python/twisted/files/twisted-19.10.0-py38.patch b/dev-python/twisted/files/twisted-19.10.0-py38.patch
new file mode 100644
index 00000000000..e787167d45b
--- /dev/null
+++ b/dev-python/twisted/files/twisted-19.10.0-py38.patch
@@ -0,0 +1,110 @@
+From d33b90880b8eb024daa73bc3fd39aca0bc791ff1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Lucas=20Treffenst=C3=A4dt?= <lucas@treffenstaedt.de>
+Date: Mon, 13 Jan 2020 13:54:08 +0100
+Subject: [PATCH 1/2] CramMD5ClientAuthenticator now specifies the digestmod
+ argument to hmac.HMAC constructor explicitly.
+
+---
+ src/twisted/mail/_cred.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/twisted/mail/_cred.py b/src/twisted/mail/_cred.py
+index 9d3646948..43c406f90 100644
+--- a/src/twisted/mail/_cred.py
++++ b/src/twisted/mail/_cred.py
+@@ -8,6 +8,7 @@ Credential managers for L{twisted.mail}.
+ from __future__ import absolute_import, division
+ 
+ import hmac
++import hashlib
+ 
+ from zope.interface import implementer
+ 
+@@ -28,7 +29,7 @@ class CramMD5ClientAuthenticator:
+ 
+ 
+     def challengeResponse(self, secret, chal):
+-        response = hmac.HMAC(secret, chal).hexdigest().encode('ascii')
++        response = hmac.HMAC(secret, chal, digestmod = hashlib.md5).hexdigest().encode('ascii')
+         return self.user + b' ' + response
+ 
+ 
+-- 
+2.26.2
+
+From 694bc67f3cf7d36a6f512f0b76882e85d0966dd2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Poisson?= <goffi@goffi.org>
+Date: Sun, 17 Nov 2019 19:48:53 +0100
+Subject: [PATCH 2/2] Fix parsing of namespaced attributes with Python 3.8 in
+ twisted.words.xish.domish.ExpatElementStream
+
+---
+ src/twisted/words/newsfragments/9730.bugfix |  1 +
+ src/twisted/words/test/test_domish.py       | 17 +++++++++++++++++
+ src/twisted/words/xish/domish.py            | 11 +++++++++--
+ 3 files changed, 27 insertions(+), 2 deletions(-)
+ create mode 100644 src/twisted/words/newsfragments/9730.bugfix
+
+diff --git a/src/twisted/words/newsfragments/9730.bugfix b/src/twisted/words/newsfragments/9730.bugfix
+new file mode 100644
+index 000000000..5c91305c8
+--- /dev/null
++++ b/src/twisted/words/newsfragments/9730.bugfix
+@@ -0,0 +1 @@
++Fixed parsing of streams with Python 3.8 when there are spaces in namespaces or namespaced attributes in twisted.words.xish.domish.ExpatElementStream
+diff --git a/src/twisted/words/test/test_domish.py b/src/twisted/words/test/test_domish.py
+index a8f8fa76b..cd16e3a4d 100644
+--- a/src/twisted/words/test/test_domish.py
++++ b/src/twisted/words/test/test_domish.py
+@@ -350,6 +350,23 @@ class DomishStreamTestsMixin:
+             self.elements[0].attributes, {(" bar baz ", "baz"): "quux"})
+ 
+ 
++    def test_attributesWithNamespaces(self):
++        """
++        Attributes with namespace are parsed without Exception.
++        (https://twistedmatrix.com/trac/ticket/9730 regression test)
++        """
++
++        xml = b"""<root xmlns:test='http://example.org' xml:lang='en'>
++                    <test:test>test</test:test>
++                  </root>"""
++
++        # with Python 3.8 and without #9730 fix, the following error would
++        # happen at next line:
++        # ``RuntimeError: dictionary keys changed during iteration``
++        self.stream.parse(xml)
++        self.assertEqual(self.elements[0].uri, "http://example.org")
++
++
+     def testChildPrefix(self):
+         xml = b"<root xmlns='testns' xmlns:foo='testns2'><foo:child/></root>"
+ 
+diff --git a/src/twisted/words/xish/domish.py b/src/twisted/words/xish/domish.py
+index 2063c410a..fc49285f5 100644
+--- a/src/twisted/words/xish/domish.py
++++ b/src/twisted/words/xish/domish.py
+@@ -807,11 +807,18 @@ class ExpatElementStream:
+             qname = ('', name)
+ 
+         # Process attributes
++        newAttrs = {}
++        toDelete = []
+         for k, v in attrs.items():
+             if " " in k:
+                 aqname = k.rsplit(" ", 1)
+-                attrs[(aqname[0], aqname[1])] = v
+-                del attrs[k]
++                newAttrs[(aqname[0], aqname[1])] = v
++                toDelete.append(k)
++
++        attrs.update(newAttrs)
++
++        for k in toDelete:
++            del attrs[k]
+ 
+         # Construct the new element
+         e = Element(qname, self.defaultNsStack[-1], attrs, self.localPrefixes)
+-- 
+2.26.2
+

diff --git a/dev-python/twisted/twisted-19.10.0.ebuild b/dev-python/twisted/twisted-19.10.0.ebuild
index 53a20c32ca0..46a5d0dbc96 100644
--- a/dev-python/twisted/twisted-19.10.0.ebuild
+++ b/dev-python/twisted/twisted-19.10.0.ebuild
@@ -17,6 +17,7 @@ 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"
+S=${WORKDIR}/${TWISTED_P}
 
 KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux"
 
@@ -79,9 +80,14 @@ DEPEND="
 	)
 "
 
-S=${WORKDIR}/${TWISTED_P}
 
 python_prepare_all() {
+	local PATCHES=(
+		"${FILESDIR}"/${P}-py38.patch
+		"${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] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/files/, dev-python/twisted/
@ 2021-07-30 18:14 Michał Górny
  0 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2021-07-30 18:14 UTC (permalink / raw
  To: gentoo-commits

commit:     c7eead8493f6ba9e8c373341c8cf86403ad490ef
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 30 15:48:03 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul 30 18:14:16 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c7eead84

dev-python/twisted: Remove old

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/twisted/Manifest                        |   2 -
 .../twisted/files/twisted-19.10.0-py38-cgi.patch   |  41 ----
 .../twisted/files/twisted-19.10.0-py38.patch       | 110 ---------
 .../twisted/files/twisted-19.10.0-py39-b64.patch   | 165 -------------
 .../twisted/files/twisted-20.3.0-py38-cgi.patch    | 259 ---------------------
 .../twisted/files/twisted-20.3.0-py38-hmac.patch   |  94 --------
 .../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          | 194 ---------------
 dev-python/twisted/twisted-20.3.0.ebuild           | 190 ---------------
 10 files changed, 1328 deletions(-)

diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index 0ed1eeac5fb..8f648038b16 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,5 +1,3 @@
-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-19.10.0-py38-cgi.patch b/dev-python/twisted/files/twisted-19.10.0-py38-cgi.patch
deleted file mode 100644
index 5fc4768e5d2..00000000000
--- a/dev-python/twisted/files/twisted-19.10.0-py38-cgi.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-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/files/twisted-19.10.0-py38.patch b/dev-python/twisted/files/twisted-19.10.0-py38.patch
deleted file mode 100644
index e787167d45b..00000000000
--- a/dev-python/twisted/files/twisted-19.10.0-py38.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From d33b90880b8eb024daa73bc3fd39aca0bc791ff1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Lucas=20Treffenst=C3=A4dt?= <lucas@treffenstaedt.de>
-Date: Mon, 13 Jan 2020 13:54:08 +0100
-Subject: [PATCH 1/2] CramMD5ClientAuthenticator now specifies the digestmod
- argument to hmac.HMAC constructor explicitly.
-
----
- src/twisted/mail/_cred.py | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/twisted/mail/_cred.py b/src/twisted/mail/_cred.py
-index 9d3646948..43c406f90 100644
---- a/src/twisted/mail/_cred.py
-+++ b/src/twisted/mail/_cred.py
-@@ -8,6 +8,7 @@ Credential managers for L{twisted.mail}.
- from __future__ import absolute_import, division
- 
- import hmac
-+import hashlib
- 
- from zope.interface import implementer
- 
-@@ -28,7 +29,7 @@ class CramMD5ClientAuthenticator:
- 
- 
-     def challengeResponse(self, secret, chal):
--        response = hmac.HMAC(secret, chal).hexdigest().encode('ascii')
-+        response = hmac.HMAC(secret, chal, digestmod = hashlib.md5).hexdigest().encode('ascii')
-         return self.user + b' ' + response
- 
- 
--- 
-2.26.2
-
-From 694bc67f3cf7d36a6f512f0b76882e85d0966dd2 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Poisson?= <goffi@goffi.org>
-Date: Sun, 17 Nov 2019 19:48:53 +0100
-Subject: [PATCH 2/2] Fix parsing of namespaced attributes with Python 3.8 in
- twisted.words.xish.domish.ExpatElementStream
-
----
- src/twisted/words/newsfragments/9730.bugfix |  1 +
- src/twisted/words/test/test_domish.py       | 17 +++++++++++++++++
- src/twisted/words/xish/domish.py            | 11 +++++++++--
- 3 files changed, 27 insertions(+), 2 deletions(-)
- create mode 100644 src/twisted/words/newsfragments/9730.bugfix
-
-diff --git a/src/twisted/words/newsfragments/9730.bugfix b/src/twisted/words/newsfragments/9730.bugfix
-new file mode 100644
-index 000000000..5c91305c8
---- /dev/null
-+++ b/src/twisted/words/newsfragments/9730.bugfix
-@@ -0,0 +1 @@
-+Fixed parsing of streams with Python 3.8 when there are spaces in namespaces or namespaced attributes in twisted.words.xish.domish.ExpatElementStream
-diff --git a/src/twisted/words/test/test_domish.py b/src/twisted/words/test/test_domish.py
-index a8f8fa76b..cd16e3a4d 100644
---- a/src/twisted/words/test/test_domish.py
-+++ b/src/twisted/words/test/test_domish.py
-@@ -350,6 +350,23 @@ class DomishStreamTestsMixin:
-             self.elements[0].attributes, {(" bar baz ", "baz"): "quux"})
- 
- 
-+    def test_attributesWithNamespaces(self):
-+        """
-+        Attributes with namespace are parsed without Exception.
-+        (https://twistedmatrix.com/trac/ticket/9730 regression test)
-+        """
-+
-+        xml = b"""<root xmlns:test='http://example.org' xml:lang='en'>
-+                    <test:test>test</test:test>
-+                  </root>"""
-+
-+        # with Python 3.8 and without #9730 fix, the following error would
-+        # happen at next line:
-+        # ``RuntimeError: dictionary keys changed during iteration``
-+        self.stream.parse(xml)
-+        self.assertEqual(self.elements[0].uri, "http://example.org")
-+
-+
-     def testChildPrefix(self):
-         xml = b"<root xmlns='testns' xmlns:foo='testns2'><foo:child/></root>"
- 
-diff --git a/src/twisted/words/xish/domish.py b/src/twisted/words/xish/domish.py
-index 2063c410a..fc49285f5 100644
---- a/src/twisted/words/xish/domish.py
-+++ b/src/twisted/words/xish/domish.py
-@@ -807,11 +807,18 @@ class ExpatElementStream:
-             qname = ('', name)
- 
-         # Process attributes
-+        newAttrs = {}
-+        toDelete = []
-         for k, v in attrs.items():
-             if " " in k:
-                 aqname = k.rsplit(" ", 1)
--                attrs[(aqname[0], aqname[1])] = v
--                del attrs[k]
-+                newAttrs[(aqname[0], aqname[1])] = v
-+                toDelete.append(k)
-+
-+        attrs.update(newAttrs)
-+
-+        for k in toDelete:
-+            del attrs[k]
- 
-         # Construct the new element
-         e = Element(qname, self.defaultNsStack[-1], attrs, self.localPrefixes)
--- 
-2.26.2
-

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
deleted file mode 100644
index f67d6240558..00000000000
--- a/dev-python/twisted/files/twisted-19.10.0-py39-b64.patch
+++ /dev/null
@@ -1,165 +0,0 @@
-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-py38-cgi.patch b/dev-python/twisted/files/twisted-20.3.0-py38-cgi.patch
deleted file mode 100644
index 5151f297f7f..00000000000
--- a/dev-python/twisted/files/twisted-20.3.0-py38-cgi.patch
+++ /dev/null
@@ -1,259 +0,0 @@
-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
deleted file mode 100644
index 1c1ee01b218..00000000000
--- a/dev-python/twisted/files/twisted-20.3.0-py38-hmac.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-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/files/twisted-20.3.0-py39-b64.patch b/dev-python/twisted/files/twisted-20.3.0-py39-b64.patch
deleted file mode 100644
index f475614df40..00000000000
--- a/dev-python/twisted/files/twisted-20.3.0-py39-b64.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-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
deleted file mode 100644
index 0ed1f7b8d9c..00000000000
--- a/dev-python/twisted/files/twisted-20.3.0-py39-combined.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-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
deleted file mode 100644
index cd70c36f469..00000000000
--- a/dev-python/twisted/twisted-19.10.0.ebuild
+++ /dev/null
@@ -1,194 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7,8,9} )
-PYTHON_REQ_USE="threads(+)"
-
-inherit distutils-r1 virtualx
-
-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"
-S=${WORKDIR}/${TWISTED_P}
-
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux"
-
-LICENSE="MIT"
-SLOT="0"
-IUSE="conch crypt http2 serial test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
-	>=dev-python/attrs-17.4.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-16.10.1[${PYTHON_USEDEP}]
-	>=dev-python/pyhamcrest-1.9.0[${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}] )
-	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
-"
-DEPEND="
-	dev-python/bcrypt
-	>=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
-	)
-"
-
-python_prepare_all() {
-	local PATCHES=(
-		"${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
-	# sphinx (including on py2)
-	rm src/twisted/python/test/test_release.py || die
-
-	# 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_ckeygen.py || die
-	rm src/twisted/conch/test/test_conch.py || die
-	rm src/twisted/conch/test/test_cftp.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:None:"Fails on non-pristine systems":' \
-		-i src/twisted/internet/test/test_tcp.py || die
-
-	# TODO: times out, i can't find where to increase the timeout
-	sed -e 's:test_manyProcesses:_&:' \
-		-i src/twisted/test/test_process.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
-
-	# TODO: figure it out, probably doesn't accept DST date here
-	sed -e 's:test_getTimezoneOffsetWithoutDaylightSavingTime:_&:' \
-		-i src/twisted/test/test_log.py || die
-
-	# TODO: failures specific to Python 2
-	sed -e 's:testLookupProcNetTcp:_&:' \
-		-i src/twisted/test/test_ident.py || die
-	sed -e 's:test_loggingFactoryOpensLogfileAutomatically:_&:' \
-		-i src/twisted/test/test_policies.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
-}

diff --git a/dev-python/twisted/twisted-20.3.0.ebuild b/dev-python/twisted/twisted-20.3.0.ebuild
deleted file mode 100644
index 48c006ad930..00000000000
--- a/dev-python/twisted/twisted-20.3.0.ebuild
+++ /dev/null
@@ -1,190 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7,8,9} )
-PYTHON_REQ_USE="threads(+)"
-
-inherit distutils-r1 virtualx
-
-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"
-
-KEYWORDS="~alpha amd64 arm arm64 ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
-
-LICENSE="MIT"
-SLOT="0"
-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-16.10.1[${PYTHON_USEDEP}]
-	>=dev-python/pyhamcrest-1.9.0[${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}] )
-	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
-"
-DEPEND="
-	dev-python/bcrypt
-	>=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
-	)
-"
-
-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
-		"${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
-	# sphinx (including on py2)
-	rm src/twisted/python/test/test_release.py || die
-
-	# 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_ckeygen.py || die
-	rm src/twisted/conch/test/test_conch.py || die
-	rm src/twisted/conch/test/test_cftp.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:None:"Fails on non-pristine systems":' \
-		-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
-
-	# TODO: figure it out, probably doesn't accept DST date here
-	sed -e 's:test_getTimezoneOffsetWithoutDaylightSavingTime:_&:' \
-		-i src/twisted/test/test_log.py || die
-
-	# TODO: failures specific to Python 2
-	sed -e 's:testLookupProcNetTcp:_&:' \
-		-i src/twisted/test/test_ident.py || die
-	sed -e 's:test_loggingFactoryOpensLogfileAutomatically:_&:' \
-		-i src/twisted/test/test_policies.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] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/files/, dev-python/twisted/
@ 2021-10-17  7:15 Michał Górny
  0 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2021-10-17  7:15 UTC (permalink / raw
  To: gentoo-commits

commit:     8a435c5b462cd81c98bbc40da85d922305e23782
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 17 06:40:04 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Oct 17 07:14:52 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a435c5b

dev-python/twisted: Remove old

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/twisted/Manifest                        |   1 -
 .../twisted/files/twisted-21.2.0-force-gtk3.patch  |  42 -----
 .../files/twisted-21.2.0-incremental-21.patch      |  65 --------
 .../files/twisted-21.2.0-int-from-bytes.patch      |  14 --
 dev-python/twisted/twisted-21.2.0-r1.ebuild        | 179 ---------------------
 5 files changed, 301 deletions(-)

diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index 8f648038b16..3c5453df8fd 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,3 +1,2 @@
-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.2.0-force-gtk3.patch b/dev-python/twisted/files/twisted-21.2.0-force-gtk3.patch
deleted file mode 100644
index bed31bcf611..00000000000
--- a/dev-python/twisted/files/twisted-21.2.0-force-gtk3.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-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-incremental-21.patch b/dev-python/twisted/files/twisted-21.2.0-incremental-21.patch
deleted file mode 100644
index c726d32cb89..00000000000
--- a/dev-python/twisted/files/twisted-21.2.0-incremental-21.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-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/files/twisted-21.2.0-int-from-bytes.patch b/dev-python/twisted/files/twisted-21.2.0-int-from-bytes.patch
deleted file mode 100644
index ef9bd777ac7..00000000000
--- a/dev-python/twisted/files/twisted-21.2.0-int-from-bytes.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-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-r1.ebuild b/dev-python/twisted/twisted-21.2.0-r1.ebuild
deleted file mode 100644
index 89ae1e3b892..00000000000
--- a/dev-python/twisted/twisted-21.2.0-r1.ebuild
+++ /dev/null
@@ -1,179 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7..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-16.10.1[${PYTHON_USEDEP}]
-	>=dev-python/pyhamcrest-1.9.0[${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}]
-	)
-	!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"
-	# int_from_bytes is deprecated
-	"${FILESDIR}/${P}-int-from-bytes.patch"
-)
-
-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
-
-	# 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
-
-	# 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
-
-	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] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/files/, dev-python/twisted/
@ 2022-10-11  7:27 Michał Górny
  0 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2022-10-11  7:27 UTC (permalink / raw
  To: gentoo-commits

commit:     b453f4789c869b73d454e3ea5d17dc126c4d0680
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 11 07:19:55 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Oct 11 07:19:55 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b453f478

dev-python/twisted: Remove old

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/twisted/Manifest                        |   1 -
 .../twisted/files/twisted-22.4.0-py311.patch       |  55 -------
 dev-python/twisted/twisted-22.4.0-r2.ebuild        | 168 ---------------------
 3 files changed, 224 deletions(-)

diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index 63b80aae3084..35a9df374cd8 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,3 +1,2 @@
-DIST twisted-22.4.0.tar.gz 3896724 BLAKE2B 830a724156473a28394e6c731f6cec184c491410dc880bc2e37a99cb460c7fe040219463f224941532b12478abe953aa0228c70676e5baecda4a3b2bdd6a0a32 SHA512 776d36040bcefb9ca65e471d9058fe1067ffc8171a501cb451e9d4824a88dd83f79dc9b27a127ca898451587454ee661000acbce6c4c39b069aeadd64710f103
 DIST twisted-22.8.0.gh.tar.gz 3937858 BLAKE2B de5f56f2ac92db3ccd29122f3c3bacc01de325e4b00b60a0ea9bcf13c5714487d596299990d292758821e242443d8c65cda03b895196df0a635b0739f08668fc SHA512 890a11ca55fd88636f404678c6fad3fcea9d0604b1b37681a4b92ea74952bc4d1b96a571dde39a4aa82d966121156801f6b42dbd0bb5a309503591a7a77c6d71
 DIST twisted-regen-cache.gz 911 BLAKE2B ffd3fcda6c67ffe6fd3ef581c8d507548396b66ed0708e9a5c790095e579c0d5f0f71596acf05712989da2ddef2b8d437eca973bc4d80ef8a9fa852915f38305 SHA512 95a9b931c73017d16d1b5e6b41345dddffe62b6af1a8e93b5e40d06d3d15be17b0dd0181c767ffeeb791534d463764ef9e066fa6c2ee2ac4b53c86d1da8fce03

diff --git a/dev-python/twisted/files/twisted-22.4.0-py311.patch b/dev-python/twisted/files/twisted-22.4.0-py311.patch
deleted file mode 100644
index ed8ded87d4de..000000000000
--- a/dev-python/twisted/files/twisted-22.4.0-py311.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 074fc742a699278ea5266b34aace1e34049b3de3 Mon Sep 17 00:00:00 2001
-From: Colin Watson <cjwatson@canonical.com>
-Date: Sat, 23 Apr 2022 22:29:07 +0100
-Subject: [PATCH] Implement twisted.python.failure._Code.co_positions
-
-This is needed for compatibility with Python 3.11.
----
- src/twisted/newsfragments/10336.bugfix | 1 +
- src/twisted/python/failure.py          | 5 ++++-
- src/twisted/test/test_failure.py       | 1 +
- 3 files changed, 6 insertions(+), 1 deletion(-)
- create mode 100644 src/twisted/newsfragments/10336.bugfix
-
-diff --git a/src/twisted/newsfragments/10336.bugfix b/src/twisted/newsfragments/10336.bugfix
-new file mode 100644
-index 00000000000..a7ffab3627d
---- /dev/null
-+++ b/src/twisted/newsfragments/10336.bugfix
-@@ -0,0 +1 @@
-+Implement twisted.python.failure._Code.co_positions for compatibility with Python 3.11.
-diff --git a/src/twisted/python/failure.py b/src/twisted/python/failure.py
-index 6471e7bca59..c5a359e405b 100644
---- a/src/twisted/python/failure.py
-+++ b/src/twisted/python/failure.py
-@@ -130,7 +130,7 @@ def _Traceback(stackFrames, tbFrames):
- 
- 
- # The set of attributes for _TracebackFrame, _Frame and _Code were taken from
--# https://docs.python.org/3.10/library/inspect.html Other Pythons may have a
-+# https://docs.python.org/3.11/library/inspect.html Other Pythons may have a
- # few more attributes that should be added if needed.
- class _TracebackFrame:
-     """
-@@ -202,6 +202,9 @@ def __init__(self, name, filename):
-         self.co_nlocals = 0
-         self.co_stacksize = 0
- 
-+    def co_positions(self):
-+        return ((None, None, None, None),)
-+
- 
- _inlineCallbacksExtraneous = []
- 
-diff --git a/src/twisted/test/test_failure.py b/src/twisted/test/test_failure.py
-index 6dd7c682bf9..6fd82c868ec 100644
---- a/src/twisted/test/test_failure.py
-+++ b/src/twisted/test/test_failure.py
-@@ -825,6 +825,7 @@ def test_fakeCodeAttributes(self):
-         self.assertIsInstance(code.co_nlocals, int)
-         self.assertIsInstance(code.co_stacksize, int)
-         self.assertIsInstance(code.co_varnames, list)
-+        self.assertIsInstance(code.co_positions(), tuple)
- 
-     def test_fakeTracebackFrame(self):
-         """

diff --git a/dev-python/twisted/twisted-22.4.0-r2.ebuild b/dev-python/twisted/twisted-22.4.0-r2.ebuild
deleted file mode 100644
index 5acedaa99e6a..000000000000
--- a/dev-python/twisted/twisted-22.4.0-r2.ebuild
+++ /dev/null
@@ -1,168 +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..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
-	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.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}]
-	)
-	http2? (
-		>=dev-python/h2-3.0.0[${PYTHON_USEDEP}]
-		<dev-python/h2-5.0.0[${PYTHON_USEDEP}]
-		>=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
-		<dev-python/priority-2.0[${PYTHON_USEDEP}]
-	)
-	serial? ( >=dev-python/pyserial-3.0[${PYTHON_USEDEP}] )
-	ssl? (
-		>=dev-python/pyopenssl-16.0.0[${PYTHON_USEDEP}]
-		dev-python/service_identity[${PYTHON_USEDEP}]
-		>=dev-python/idna-0.6[${PYTHON_USEDEP}]
-	)
-"
-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[${PYTHON_USEDEP}]
-			dev-python/idna[${PYTHON_USEDEP}]
-			dev-python/pyasn1[${PYTHON_USEDEP}]
-			dev-python/pyserial[${PYTHON_USEDEP}]
-			net-misc/openssh
-			conch? (
-				dev-python/bcrypt[${PYTHON_USEDEP}]
-				>=dev-python/cryptography-1.5.0[${PYTHON_USEDEP}]
-			)
-			ssl? (
-				>=dev-python/pyopenssl-16.0.0[${PYTHON_USEDEP}]
-				dev-python/service_identity[${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"
-	# https://github.com/twisted/twisted/pull/1723
-	"${FILESDIR}/${P}-py311.patch"
-)
-
-python_prepare_all() {
-	# upstream test for making releases; not very useful and requires
-	# sphinx (including on py2)
-	rm src/twisted/python/test/test_release.py || die
-
-	# puts system in EMFILE state, then the exception handler may fail
-	# trying to open more files due to some gi magic
-	sed -e '/SKIP_EMFILE/s:False:True:' \
-		-i src/twisted/internet/test/test_tcp.py || die
-
-	# multicast tests fail within network-sandbox
-	sed -e 's:test_joinLeave:_&:' \
-		-e 's:test_loopback:_&:' \
-		-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
-}


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/files/, dev-python/twisted/
@ 2023-05-28 23:32 Sam James
  0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2023-05-28 23:32 UTC (permalink / raw
  To: gentoo-commits

commit:     d2c8622b7c5df457f8ab238774f3e1c3624aecd1
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun May 28 23:27:48 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun May 28 23:31:52 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2c8622b

dev-python/twisted: backport some 3.11 fixes

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/twisted-22.10.0-python3.11-tests.patch   | 100 ++++++++++++++++++
 .../twisted/files/twisted-22.10.0-sendmail.patch   |  28 +++++
 .../twisted/files/twisted-22.10.0-time.patch       | 113 +++++++++++++++++++++
 ...22.10.0-r2.ebuild => twisted-22.10.0-r3.ebuild} |   4 +
 4 files changed, 245 insertions(+)

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
new file mode 100644
index 000000000000..b75c97d4997f
--- /dev/null
+++ b/dev-python/twisted/files/twisted-22.10.0-python3.11-tests.patch
@@ -0,0 +1,100 @@
+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
new file mode 100644
index 000000000000..eec57752815d
--- /dev/null
+++ b/dev-python/twisted/files/twisted-22.10.0-sendmail.patch
@@ -0,0 +1,28 @@
+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/files/twisted-22.10.0-time.patch b/dev-python/twisted/files/twisted-22.10.0-time.patch
new file mode 100644
index 000000000000..1723d69c8a3c
--- /dev/null
+++ b/dev-python/twisted/files/twisted-22.10.0-time.patch
@@ -0,0 +1,113 @@
+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-22.10.0-r2.ebuild b/dev-python/twisted/twisted-22.10.0-r3.ebuild
similarity index 97%
rename from dev-python/twisted/twisted-22.10.0-r2.ebuild
rename to dev-python/twisted/twisted-22.10.0-r3.ebuild
index 086760de159e..1f8f2ef6a7e9 100644
--- a/dev-python/twisted/twisted-22.10.0-r2.ebuild
+++ b/dev-python/twisted/twisted-22.10.0-r3.ebuild
@@ -84,6 +84,10 @@ BDEPEND="
 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() {


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/files/, dev-python/twisted/
@ 2024-06-28  7:47 Petr Vaněk
  0 siblings, 0 replies; 10+ messages in thread
From: Petr Vaněk @ 2024-06-28  7:47 UTC (permalink / raw
  To: gentoo-commits

commit:     d8bb94111fd4ed5b76a62c9f48416847679127c0
Author:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 28 07:04:47 2024 +0000
Commit:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
CommitDate: Fri Jun 28 07:47:16 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8bb9411

dev-python/twisted: add 24.3.0_p20240628

This is py3.13 enabled snapshot from the PR-12092 [1], which resolves
most of py3.13 issues. The remaining test failure [2] is skipped by
patch in similar fashion like Fedora does [3].

[1] https://github.com/twisted/twisted/pull/12092
[2] https://github.com/twisted/twisted/issues/12099
[3] https://src.fedoraproject.org/rpms/python-twisted/blob/c8c63fe475594326f50fd748b40ae65f925c1325/f/0010-Skip-failing-tests.patch

Signed-off-by: Petr Vaněk <arkamar <AT> gentoo.org>

 dev-python/twisted/Manifest                        |   1 +
 .../twisted-24.3.0_p20240628-skip-py313-test.patch |  35 +++++
 dev-python/twisted/twisted-24.3.0_p20240628.ebuild | 162 +++++++++++++++++++++
 3 files changed, 198 insertions(+)

diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index 437756ad44fa..c721f0b6b783 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,2 +1,3 @@
 DIST twisted-24.3.0.tar.gz 3500456 BLAKE2B b2cebb2f3482dbeba250786b1977ddbb09e1a9a81f71ce5906efe8289b0e134a8b26c191c2262e8ee8ba3fccccea508c34145016b29ecf301541134dcea19e08 SHA512 c3dd227f5936ffa586a0b7447f5df4c2257dce0c0ba740373d82197a72029e7eeb0aef9789247dde73e2f24dd043f3b0b7d795f16e6e908583b054aad9b9eb6a
+DIST twisted-24.3.0_p20240628.gh.tar.gz 3598828 BLAKE2B 6f37190caa0fe6e0ff566cb4f86b625425bfe60d8743b4c22463da63df3184646eda2b7d1a73e30452390bab54f8001f9eb33e1e7adc645071fe0eba4fb2d30c SHA512 f182d6c5006f1043f3586468d628b6b87a4d74d4aa1ce3c882938f0a831a191b38b311a4cf68488b24cd3d87547aeb0b9725e93ce4be86638aa11552d294cd95
 DIST twisted-regen-cache.gz 911 BLAKE2B ffd3fcda6c67ffe6fd3ef581c8d507548396b66ed0708e9a5c790095e579c0d5f0f71596acf05712989da2ddef2b8d437eca973bc4d80ef8a9fa852915f38305 SHA512 95a9b931c73017d16d1b5e6b41345dddffe62b6af1a8e93b5e40d06d3d15be17b0dd0181c767ffeeb791534d463764ef9e066fa6c2ee2ac4b53c86d1da8fce03

diff --git a/dev-python/twisted/files/twisted-24.3.0_p20240628-skip-py313-test.patch b/dev-python/twisted/files/twisted-24.3.0_p20240628-skip-py313-test.patch
new file mode 100644
index 000000000000..c469f7883f71
--- /dev/null
+++ b/dev-python/twisted/files/twisted-24.3.0_p20240628-skip-py313-test.patch
@@ -0,0 +1,35 @@
+From 2f14c47947206d7f2e53af85567938601728abbd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20Van=C4=9Bk?= <arkamar@gentoo.org>
+Date: Fri, 28 Jun 2024 06:48:23 +0000
+Subject: [PATCH] skip failing test in py3.13
+
+Let's skip failing test for now, Fedora does it as well [1].
+
+[1] https://src.fedoraproject.org/rpms/python-twisted/blob/c8c63fe475594326f50fd748b40ae65f925c1325/f/0010-Skip-failing-tests.patch
+
+Upstream-Issue: https://github.com/twisted/twisted/issues/12099
+
+diff --git a/src/twisted/test/test_failure.py b/src/twisted/test/test_failure.py
+index 9a3daae306..a7a3ce29bd 100644
+--- a/src/twisted/test/test_failure.py
++++ b/src/twisted/test/test_failure.py
+@@ -17,7 +17,7 @@ from io import StringIO
+ from traceback import FrameSummary
+ from types import TracebackType
+ from typing import Any, Generator, cast
+-from unittest import skipIf
++from unittest import skipIf, skip
+ 
+ from cython_test_exception_raiser import raiser
+ 
+@@ -990,6 +990,7 @@ class ExtendedGeneratorTests(SynchronousTestCase):
+ 
+         self.assertEqual(traceback.extract_tb(stuff[0][2])[-1][-1], "1 / 0")
+ 
++    @skip("Fails with Python 3.13")
+     def test_findFailureInGenerator(self) -> None:
+         """
+         Within an exception handler, it should be possible to find the
+-- 
+2.45.2
+

diff --git a/dev-python/twisted/twisted-24.3.0_p20240628.ebuild b/dev-python/twisted/twisted-24.3.0_p20240628.ebuild
new file mode 100644
index 000000000000..4fd83b143c4f
--- /dev/null
+++ b/dev-python/twisted/twisted-24.3.0_p20240628.ebuild
@@ -0,0 +1,162 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=hatchling
+PYTHON_TESTED=( python3_{10..13} pypy3 )
+PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" )
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1 virtualx
+
+DESCRIPTION="An asynchronous networking framework written in Python"
+HOMEPAGE="
+	https://twisted.org/
+	https://github.com/twisted/twisted/
+	https://pypi.org/project/Twisted/
+"
+# The snapshot is based on commit from PR https://github.com/twisted/twisted/pull/12092
+# which resolves most of remaining py3.13 issues.
+COMMIT="8f6b89855d4384e3ed80884ca6f7ecc46f7a92fb"
+SRC_URI="
+	https://github.com/twisted/twisted/archive/${COMMIT}.tar.gz
+		-> ${P}.gh.tar.gz
+	https://dev.gentoo.org/~mgorny/dist/twisted-regen-cache.gz
+"
+S="${WORKDIR}/${PN}-${COMMIT}"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos"
+IUSE="conch http2 serial ssl test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	>=dev-python/attrs-19.2.0[${PYTHON_USEDEP}]
+	>=dev-python/automat-0.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/bcrypt-3.0.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=(
+	"${FILESDIR}/${P}-skip-py313-test.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
+
+	# breaks some tests by overriding empty environment
+	local -x SANDBOX_ON=0
+	"${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] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/files/, dev-python/twisted/
@ 2024-07-31 15:10 Petr Vaněk
  0 siblings, 0 replies; 10+ messages in thread
From: Petr Vaněk @ 2024-07-31 15:10 UTC (permalink / raw
  To: gentoo-commits

commit:     bd1823b11ee33e884083f92047071e3cb82cb0d9
Author:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 31 10:30:25 2024 +0000
Commit:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
CommitDate: Wed Jul 31 15:08:58 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd1823b1

dev-python/twisted: add 24.7.0_rc1

Few tests are skipped by a patch based on changes made in upstream PR
https://github.com/twisted/twisted/pull/12092.

Some tests fail with openssh-9.8, therefore, this test dependency is
restricted to <net-misc/openssh-9.8. See
https://github.com/twisted/twisted/issues/12273

Signed-off-by: Petr Vaněk <arkamar <AT> gentoo.org>

 dev-python/twisted/Manifest                        |   1 +
 .../twisted-24.7.0_rc1-skip-py313-tests.patch      |  54 +++++++
 dev-python/twisted/twisted-24.7.0_rc1.ebuild       | 161 +++++++++++++++++++++
 3 files changed, 216 insertions(+)

diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index c721f0b6b783..4bebe2fb86ae 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,3 +1,4 @@
 DIST twisted-24.3.0.tar.gz 3500456 BLAKE2B b2cebb2f3482dbeba250786b1977ddbb09e1a9a81f71ce5906efe8289b0e134a8b26c191c2262e8ee8ba3fccccea508c34145016b29ecf301541134dcea19e08 SHA512 c3dd227f5936ffa586a0b7447f5df4c2257dce0c0ba740373d82197a72029e7eeb0aef9789247dde73e2f24dd043f3b0b7d795f16e6e908583b054aad9b9eb6a
 DIST twisted-24.3.0_p20240628.gh.tar.gz 3598828 BLAKE2B 6f37190caa0fe6e0ff566cb4f86b625425bfe60d8743b4c22463da63df3184646eda2b7d1a73e30452390bab54f8001f9eb33e1e7adc645071fe0eba4fb2d30c SHA512 f182d6c5006f1043f3586468d628b6b87a4d74d4aa1ce3c882938f0a831a191b38b311a4cf68488b24cd3d87547aeb0b9725e93ce4be86638aa11552d294cd95
+DIST twisted-24.7.0rc1.tar.gz 3517026 BLAKE2B ce7c2aec350c08ccaee03010dcff7f82fb37760d905206862e77c77c71d5eb8a0c9e04433bfe3ef19f39761ddbacdacb1eeb64b4de6663569f06ed06302276f9 SHA512 7bc5a65d1813573e980c1171a579d3b76a0275706175c2d83d5cfe389bc8ef1e965ec50b4680579af1eb796ed7131eb0bbad173ef2a73c9ed0a367f6a121666a
 DIST twisted-regen-cache.gz 911 BLAKE2B ffd3fcda6c67ffe6fd3ef581c8d507548396b66ed0708e9a5c790095e579c0d5f0f71596acf05712989da2ddef2b8d437eca973bc4d80ef8a9fa852915f38305 SHA512 95a9b931c73017d16d1b5e6b41345dddffe62b6af1a8e93b5e40d06d3d15be17b0dd0181c767ffeeb791534d463764ef9e066fa6c2ee2ac4b53c86d1da8fce03

diff --git a/dev-python/twisted/files/twisted-24.7.0_rc1-skip-py313-tests.patch b/dev-python/twisted/files/twisted-24.7.0_rc1-skip-py313-tests.patch
new file mode 100644
index 000000000000..9be4283567ec
--- /dev/null
+++ b/dev-python/twisted/files/twisted-24.7.0_rc1-skip-py313-tests.patch
@@ -0,0 +1,54 @@
+From 314fb5e18cbcaa11040a129d6ffaee3c376f55e7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20Van=C4=9Bk?= <arkamar@gentoo.org>
+Date: Wed, 31 Jul 2024 15:08:20 +0200
+Subject: [PATCH] skip py3.13 incompatible tests
+
+Based on upstream changes in PR https://github.com/twisted/twisted/pull/12092
+
+diff --git a/src/twisted/internet/test/test_inlinecb.py b/src/twisted/internet/test/test_inlinecb.py
+index 355572b566..11c09c6996 100644
+--- a/src/twisted/internet/test/test_inlinecb.py
++++ b/src/twisted/internet/test/test_inlinecb.py
+@@ -6,11 +6,13 @@
+ Tests for L{twisted.internet.inlineCallbacks}.
+ """
+ 
++import sys
+ import traceback
+ import unittest as pyunit
+ import weakref
+ from enum import Enum
+ from typing import Any, Generator, List, Set, Union
++from unittest import skipIf
+ 
+ from twisted.internet import reactor, task
+ from twisted.internet.defer import (
+@@ -1122,6 +1124,9 @@ class NonLocalExitTests(TestCase):
+ 
+ 
+ class ForwardTraceBackTests(SynchronousTestCase):
++    HAVE_PY3_12_OR_OLDER = sys.version_info < (3, 13)
++
++    @skipIf(not HAVE_PY3_12_OR_OLDER, "Needs Python 3.12 or older")
+     def test_forwardTracebacks(self):
+         """
+         Chained inlineCallbacks are forwarding the traceback information
+@@ -1171,6 +1176,7 @@ class ForwardTraceBackTests(SynchronousTestCase):
+ 
+         return d
+ 
++    @skipIf(not HAVE_PY3_12_OR_OLDER, "Needs Python 3.12 or older")
+     def test_forwardLotsOfTracebacks(self):
+         """
+         Several Chained inlineCallbacks gives information about all generators.
+@@ -1218,6 +1224,7 @@ class ForwardTraceBackTests(SynchronousTestCase):
+         self.assertIn("Error Marker", tb)
+         self.assertIn("in erroring", f.getTraceback())
+ 
++    @skipIf(not HAVE_PY3_12_OR_OLDER, "Needs Python 3.12 or older")
+     def test_forwardLotsOfTracebacksCoro(self):
+         """
+         Several chained inlineCallbacks mixed with coroutines gives information
+-- 
+2.44.2
+

diff --git a/dev-python/twisted/twisted-24.7.0_rc1.ebuild b/dev-python/twisted/twisted-24.7.0_rc1.ebuild
new file mode 100644
index 000000000000..dc3b1cf4ce80
--- /dev/null
+++ b/dev-python/twisted/twisted-24.7.0_rc1.ebuild
@@ -0,0 +1,161 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=hatchling
+PYTHON_TESTED=( python3_{10..13} 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 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos"
+IUSE="conch http2 serial ssl test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	>=dev-python/attrs-19.2.0[${PYTHON_USEDEP}]
+	>=dev-python/automat-0.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}]
+	)
+"
+# 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}]
+	test? (
+		${RDEPEND}
+		$(python_gen_cond_dep '
+			>=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+			>=dev-python/bcrypt-3.0.0[${PYTHON_USEDEP}]
+			>=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
+			<dev-python/cython-test-exception-raiser-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
+			<net-misc/openssh-9.8
+			ssl? (
+				>=dev-python/pyopenssl-21.0.0[${PYTHON_USEDEP}]
+				>=dev-python/service-identity-18.1.0[${PYTHON_USEDEP}]
+			)
+		' "${PYTHON_TESTED[@]}")
+	)
+"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-24.3.0_p20240628-skip-py313-test.patch"
+	"${FILESDIR}/${PN}-24.7.0_rc1-skip-py313-tests.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
+
+	# breaks some tests by overriding empty environment
+	local -x SANDBOX_ON=0
+	local -x LINES=25
+	local -x COLUMNS=80
+	"${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] 10+ messages in thread

end of thread, other threads:[~2024-07-31 15:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-27 11:00 [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/files/, dev-python/twisted/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2024-07-31 15:10 Petr Vaněk
2024-06-28  7:47 Petr Vaněk
2023-05-28 23:32 Sam James
2022-10-11  7:27 Michał Górny
2021-10-17  7:15 Michał Górny
2021-07-30 18:14 Michał Górny
2019-09-18 16:23 Michał Górny
2017-05-03  9:26 Michał Górny
2017-03-31 21: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