Subject: [PATCH v2 2/5] gnu: python-twisted: Update to 21.7.0

From: Stephen Paul Weber <[email-masked]>
Date: Sat, 13 Nov 2021 20:50:28 -0500

* gnu/packages/python-xyz.scm (python-twisted): Update to 21.7.0.
[propagated-inputs]: Add python-typing-extensions, python-attrs, and
                     python-service-identity.
[source]: No longer need to manually specify ".tar.bz2".
[arguments]: New build phase to add back the _PY3 compat variable, used by some
             libraries even though it is a private symbol.
---
 gnu/packages/python-xyz.scm | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 639945c278..68d397d012 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -15105,23 +15105,32 @@ format.")
 (define-public python-twisted
   (package
     (name "python-twisted")
-    (version "19.7.0")
+    (version "21.7.0")
     (source (origin
               (method url-fetch)
-              (uri (pypi-uri "Twisted" version ".tar.bz2"))
+              (uri (pypi-uri "Twisted" version))
               (sha256
                (base32
-                "17d3hnxv9qndagzz63mdpyk99xj63p9gq586vjn0rxk8cl197nym"))))
+                "01lh225d7lfnmfx4f4kxwl3963gjc9yg8jfkn1w769v34ia55mic"))))
     (build-system python-build-system)
     (arguments
-     '(#:tests? #f))                    ; FIXME: some tests fail
+     '(#:tests? #f ; FIXME: some tests fail
+       #:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'add-py3-var
+                    (lambda _
+                      (substitute* "src/twisted/python/compat.py"
+                        (("_PY37PLUS = True")
+                         "_PY37PLUS = True\n    _PY3 = True")))))))
     (propagated-inputs
-     `(("python-zope-interface" ,python-zope-interface)
-       ("python-pyhamcrest" ,python-pyhamcrest)
-       ("python-incremental" ,python-incremental)
-       ("python-hyperlink" ,python-hyperlink)
+     `(("python-attrs" ,python-attrs)
+       ("python-automat" ,python-automat)
        ("python-constantly" ,python-constantly)
-       ("python-automat" ,python-automat)))
+       ("python-hyperlink" ,python-hyperlink)
+       ("python-incremental" ,python-incremental)
+       ("python-pyhamcrest" ,python-pyhamcrest)
+       ("python-service-identity" ,python-service-identity)
+       ("python-typing-extensions" ,python-typing-extensions)
+       ("python-zope-interface" ,python-zope-interface)))
     (home-page "https://twistedmatrix.com/")
     (synopsis "Asynchronous networking framework written in Python")
     (description
-- 
2.30.2