andreas pushed a commit to branch master
in repository guix.

commit 93f4a0db0675fe847e1fb6bcd740393e0ddb4ceb
Author: David Elsing <david.els...@posteo.net>
AuthorDate: Thu May 1 09:35:13 2025 +0000

    gnu: python-h5py: Update to 3.13.0.
    
    * gnu/packages/python-xyz.scm (python-h5py): Update to 3.13.0.
    [build-system]: Switch to pyproject-build-system.
    [arguments]: Use gexps. Move a modified 'check phase after the 'install 
phase.
    [native-inputs]: Add python-pytest-mpi, python-setuptools and python-wheel.
    
    Signed-off-by: Andreas Enge <andr...@enge.fr>
---
 gnu/packages/python-xyz.scm | 37 +++++++++++++++++++++++++++----------
 1 file changed, 27 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 9691c48781..baeeed31d3 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -3872,24 +3872,41 @@ library.")
 (define-public python-h5py
   (package
     (name "python-h5py")
-    (version "3.8.0")
+    (version "3.13.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "h5py" version))
        (sha256
-        (base32 "0pyr6z4h2xqbp49yx2i1401gl6yqh03h771zslwcy0201hpxiskg"))))
-    (build-system python-build-system)
+        (base32 "1hq5f5mnkv2138xsq7k7qncf6b7zc0cmm2fhhpd2603j31jy8w0q"))))
+    (build-system pyproject-build-system)
     (arguments
-     '(#:phases (modify-phases %standard-phases
-                  (add-after 'unpack 'fix-hdf5-paths
-                    (lambda* (#:key inputs #:allow-other-keys)
-                      (setenv "HDF5_DIR"
-                              (assoc-ref inputs "hdf5")))))))
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'fix-hdf5-paths
+            (lambda _
+              (setenv "HDF5_DIR" #$(this-package-input "hdf5"))))
+          ;; The tests only work after being installed.
+          (delete 'check)
+          (add-after 'install 'check
+            (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+              (when tests?
+                (setenv "H5PY_TEST_CHECK_FILTERS" "1")
+                (with-directory-excursion (site-packages inputs outputs)
+                  (invoke "pytest" "-vv"))))))))
     (propagated-inputs (list python-six python-numpy))
     (inputs (list hdf5))
-    (native-inputs (list pkg-config python-cython python-ipython
-                         python-pkgconfig python-pytest))
+    (native-inputs
+     (list pkg-config
+           python-cython
+           python-ipython
+           python-pkgconfig
+           python-pytest
+           ;; Required to run tests, but the MPI tests are skipped anyway.
+           python-pytest-mpi
+           python-setuptools
+           python-wheel))
     (home-page "https://www.h5py.org/";)
     (synopsis "Read and write HDF5 files from Python")
     (description

Reply via email to