From 522225af7710bf9da37c0ae067fcb1fbfad31866 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 14 Jan 2025 20:28:51 +0100 Subject: [PATCH] gnu: python-twisted: Update to 24.11.0. * gnu/packages/python-xyz.scm (python-twisted): Update to 24.11.0. [build-system]: Use pyproject-build-system. [arguments]: Enable tests; add phases 'patch-build-system and 'disable-broken-tests; add custom 'check phase. [propagated-inputs]: Delete python-pyhamcrest; add python-attrs, python-bcrypt, and python-typing-extensions. [native-inputs]: Add python-coverage, python-hatch-fancy-pypi-readme, python-hatchling, python-httpx, python-hypothesis, python-pyflakes, python-pyhamcrest, python-pytest, python-sphinx, and python-sphinx-rtd-theme. Change-Id: Ib55c2363f4cdb06e70f84545142d225271c0fa0a --- gnu/packages/python-xyz.scm | 85 +++++++++++++++++++++++++++++-------- 1 file changed, 67 insertions(+), 18 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 0220c858c8..9e2a48abe0 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -22135,30 +22135,79 @@ format.") (define-public python-twisted (package (name "python-twisted") - (version "19.7.0") + (version "24.11.0") (source (origin - (method url-fetch) - (uri (pypi-uri "Twisted" version ".tar.bz2")) + (method git-fetch) + (uri (git-reference + (url "https://github.com/twisted/twisted") + (commit (string-append "twisted-" version)))) + (file-name (git-file-name name version)) (sha256 (base32 - "17d3hnxv9qndagzz63mdpyk99xj63p9gq586vjn0rxk8cl197nym")))) - (build-system python-build-system) + "0k4rd5bpx40j1k0mgbhzqa35dyni0kk7pxjr8x3pm1iaka1718rh")))) + (build-system pyproject-build-system) (arguments - '(#:tests? #f ; FIXME: some tests fail - #:phases - (modify-phases %standard-phases - ;; Remove scripts, because they depend on [conch] - (add-after 'unpack 'remove-entrypoint - (lambda _ - (substitute* "src/twisted/python/_setup.py" - (("\".+ = twisted\\.conch\\.scripts\\..+\",") ""))))))) + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-build-system + (lambda _ + (substitute* "pyproject.toml" + ((" \"version\",") "") + (("name = \"Twisted\".*" m) + (string-append m "version = \"" #$version "\"\n")) + (("\\[tool.hatch.version\\]") "") + (("source = \"incremental\"") "")))) + (add-after 'unpack 'disable-broken-tests + (lambda _ + (for-each delete-file + (list + ;; No idea why they fail + "src/twisted/test/test_log.py" + ;; Network tests + "src/twisted/conch/test/test_cftp.py" + "src/twisted/internet/test/test_endpoints.py" + "src/twisted/protocols/test/test_tls.py" + "src/twisted/test/test_sslverify.py" + "src/twisted/web/test/test_agent.py" + "src/twisted/web/test/test_tap.py" + ;; These need a git executable + "src/twisted/python/test/test_release.py" + ;; These leave behind a socket file, which breaks the + ;; build with "...has an unsupported type" + "src/twisted/internet/test/test_unix.py" + "src/twisted/test/test_unix.py" + ;; These complain about missing test modules. + "src/twisted/test/test_failure.py" + "src/twisted/web/test/test_http2.py" + "src/twisted/conch/test/test_forwarding.py")))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (with-directory-excursion #$output + (setenv "HOME" (getcwd)) + (invoke "python3" "-m" "twisted.trial" "twisted")))))))) (propagated-inputs - (list python-zope-interface - python-pyhamcrest - python-incremental - python-hyperlink + (list python-attrs + python-automat + python-bcrypt python-constantly - python-automat)) + python-hyperlink + python-incremental + python-typing-extensions + python-zope-interface)) + (native-inputs + (list glibc-utf8-locales + python-coverage + python-hatch-fancy-pypi-readme + python-hatchling + python-httpx + python-hypothesis + python-pyflakes + python-pyhamcrest + python-pytest + python-sphinx + python-sphinx-rtd-theme)) (home-page "https://twistedmatrix.com/") (synopsis "Asynchronous networking framework written in Python") (description