Subject: [PATCH python-team 09/11] gnu: python-matrix-nio: Update to 0.25.1.

From: Arjan Adriaanse <[email-masked]>
Date: Tue, 7 Jan 2025 15:09:20 +0100

* gnu/packages/matrix.scm (python-matrix-nio): Update to 0.25.1.

Change-Id: I959818595a17a6bbc423d0c083feea039698fed7
---
 gnu/packages/matrix.scm | 65 ++++++++++++-----------------------------
 1 file changed, 19 insertions(+), 46 deletions(-)

diff --git a/gnu/packages/matrix.scm b/gnu/packages/matrix.scm
index 32ae62fcb4..a65e3b0143 100644
--- a/gnu/packages/matrix.scm
+++ b/gnu/packages/matrix.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2020 Giacomo Leidi <[email-masked]>
 ;;; Copyright © 2022 Aleksandr Vityazev <[email-masked]>
 ;;; Copyright © 2022 Morgan Smith <[email-masked]>
+;;; Copyright © 2025 Arjan Adriaanse <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -160,78 +161,50 @@ (define-public synapse
 (define-public python-matrix-nio
   (package
     (name "python-matrix-nio")
-    (version "0.20.2")
+    (version "0.25.1")
     (source
      (origin
-       (method url-fetch)
-       (uri (pypi-uri "matrix_nio" version))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/matrix-nio/matrix-nio")
+             (commit version)))
+       (file-name (git-file-name name version))
        (sha256
-        (base32 "110wg1grhqqgwvlgr98r2k8wxcggpj7lbdwmgkgmi2l7qj1vw3dm"))))
+        (base32 "0fmy2qaa7cpp6qk4ilwik2jrszk36c86l5haxvwgyp009pz4rz3i"))))
     (build-system pyproject-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'relax-requirements
-           (lambda _
-             (substitute* "pyproject.toml"
-               ;; Remove upper bounds of cachetool pin.
-               (("cachetools (.*version = )\"\\^4" _ match)
-                (string-append "cachetools " match
-                               "\">=4")))))
-         (add-before 'check 'install-tests
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (copy-recursively (string-append
-                                (assoc-ref inputs "tests") "/tests")
-                               "tests")
-             #t))
          (replace 'check
            (lambda* (#:key tests? inputs outputs #:allow-other-keys)
              (when tests?
                (add-installed-pythonpath inputs outputs)
-               ;; FIXME: two tests fail, for unknown reasons
                (invoke "python" "-m" "pytest" "-vv" "tests" "-k"
-                       (string-append
-                        "not test_upload_binary_file_object "
-                        "and not test_connect_wrapper"))))))))
+                       ;; This test requires networking.
+                       "not test_connect_wrapper")))))))
     (native-inputs
-     `(("python-pytest" ,python-pytest)
-       ("python-poetry-core" ,python-poetry-core)
-       ("python-hypothesis" ,python-hypothesis)
-       ("python-faker" ,python-faker)
-       ("python-pytest-aiohttp" ,python-pytest-aiohttp)
-       ("python-pytest-asyncio" ,python-pytest-asyncio)
-       ("python-aioresponses" ,python-aioresponses)
-       ("python-pytest-benchmark" ,python-pytest-benchmark)
-       ("tests"
-        ;; The release on pypi comes without tests.  We can't build from this
-        ;; checkout, though, because installation requires an invocation of
-        ;; poetry.
-        ,(origin
-           (method git-fetch)
-           (uri (git-reference
-                 (url "https://github.com/poljar/matrix-nio.git")
-                 (commit version)))
-           (file-name (git-file-name name version))
-           (sha256
-            (base32
-             "1rd90sk5yygxzvcs4qhzr80bch7d3xszyfjf99pn10xsj10mi752"))))))
+     (list python-aioresponses
+           python-faker
+           python-hypothesis
+           python-pytest
+           python-pytest-aiohttp
+           python-pytest-asyncio
+           python-pytest-benchmark
+           python-wheel))
     (propagated-inputs
      (list python-aiofiles
            python-aiohttp
            python-aiohttp-socks
            python-atomicwrites
            python-cachetools
-           python-dataclasses
-           python-future
            python-h11
            python-h2
            python-jsonschema
-           python-logbook
            python-olm
            python-peewee
            python-pycryptodome
            python-unpaddedbase64))
-    (home-page "https://github.com/poljar/matrix-nio")
+    (home-page "https://github.com/matrix-nio/matrix-nio")
     (synopsis
      "Python Matrix client library, designed according to sans I/O principles")
     (description
-- 
2.46.0