From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1D69A15806E for ; Sun, 28 May 2023 23:32:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 41A8DE07F2; Sun, 28 May 2023 23:32:05 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 060BFE07F2 for ; Sun, 28 May 2023 23:32:05 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3CEC1340E10 for ; Sun, 28 May 2023 23:32:04 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 706E6A6C for ; Sun, 28 May 2023 23:32:02 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1685316712.d2c8622b7c5df457f8ab238774f3e1c3624aecd1.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/files/, dev-python/twisted/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/twisted/files/twisted-22.10.0-python3.11-tests.patch dev-python/twisted/files/twisted-22.10.0-sendmail.patch dev-python/twisted/files/twisted-22.10.0-time.patch dev-python/twisted/twisted-22.10.0-r2.ebuild dev-python/twisted/twisted-22.10.0-r3.ebuild X-VCS-Directories: dev-python/twisted/files/ dev-python/twisted/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: d2c8622b7c5df457f8ab238774f3e1c3624aecd1 X-VCS-Branch: master Date: Sun, 28 May 2023 23:32:02 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b10751d5-bcff-4575-a1f2-480e862729a5 X-Archives-Hash: c9ffb983c81900e7f5b16a3888f4ae8f commit: d2c8622b7c5df457f8ab238774f3e1c3624aecd1 Author: Sam James gentoo org> AuthorDate: Sun May 28 23:27:48 2023 +0000 Commit: Sam James gentoo 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 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 +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: + \\[\\] + +- .* ++ > + 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 +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 +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() {