about summary refs log tree commit diff
path: root/pkgs/development/python-modules/h5py/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/h5py/default.nix')
-rw-r--r--pkgs/development/python-modules/h5py/default.nix43
1 files changed, 17 insertions, 26 deletions
diff --git a/pkgs/development/python-modules/h5py/default.nix b/pkgs/development/python-modules/h5py/default.nix
index 13a464dccb4c..cd60ecd9100a 100644
--- a/pkgs/development/python-modules/h5py/default.nix
+++ b/pkgs/development/python-modules/h5py/default.nix
@@ -1,21 +1,18 @@
 {
   lib,
   fetchPypi,
-  fetchpatch,
   buildPythonPackage,
   pythonOlder,
   setuptools,
   numpy,
   hdf5,
-  pythonRelaxDepsHook,
-  cython_0,
+  cython,
   pkgconfig,
   mpi4py ? null,
   openssh,
   pytestCheckHook,
   pytest-mpi,
   cached-property,
-  stdenv,
 }:
 
 assert hdf5.mpiSupport -> mpi4py != null && hdf5.mpi == mpi4py.mpi;
@@ -25,7 +22,7 @@ let
   mpiSupport = hdf5.mpiSupport;
 in
 buildPythonPackage rec {
-  version = "3.11.0";
+  version = "3.12.1";
   pname = "h5py";
   pyproject = true;
 
@@ -33,30 +30,24 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    hash = "sha256-e36PeAcqLt7IfJg28l80ID/UkqRHVwmhi0F6M8+yH6k=";
+    hash = "sha256-Mm1wtT0xuqYfALiqX5XC/LliGj7oNl13DFUaE9u8v98=";
   };
 
-  patches = [
-    # Unlock an overly strict locking of mpi4py version (seems not to be necessary).
-    # See also: https://github.com/h5py/h5py/pull/2418/files#r1589372479
-    ./mpi4py-requirement.patch
-    # Fix 16-bit float dtype and tests on darwin (remove in next release)
-    (fetchpatch {
-      url = "https://github.com/h5py/h5py/commit/a27a1f49ce92d985e14b8a24fa80d30e5174add2.patch";
-      hash = "sha256-7TcmNSJucknq+Vnv4ViT6S0nWeH1+krarWxq6WXLYEA=";
-    })
-  ];
+  pythonRelaxDeps = [ "mpi4py" ];
 
-  # avoid strict pinning of numpy, can't be replaced with pythonRelaxDepsHook,
-  # see: https://github.com/NixOS/nixpkgs/issues/327941
+  # avoid strict pinning of numpy and mpi4py, can't be replaced with
+  # pythonRelaxDepsHook, see: https://github.com/NixOS/nixpkgs/issues/327941
   postPatch = ''
     substituteInPlace pyproject.toml \
-      --replace-fail "numpy >=2.0.0rc1" "numpy"
+      --replace-fail "numpy >=2.0.0, <3" "numpy"
+    substituteInPlace setup.py \
+      --replace-fail "mpi4py ==3.1.6" "mpi4py"
   '';
-  pythonRelaxDeps = [ "mpi4py" ];
 
-  HDF5_DIR = "${hdf5}";
-  HDF5_MPI = if mpiSupport then "ON" else "OFF";
+  env = {
+    HDF5_DIR = "${hdf5}";
+    HDF5_MPI = if mpiSupport then "ON" else "OFF";
+  };
 
   postConfigure = ''
     # Needed to run the tests reliably. See:
@@ -66,16 +57,16 @@ buildPythonPackage rec {
 
   preBuild = lib.optionalString mpiSupport "export CC=${lib.getDev mpi}/bin/mpicc";
 
-  nativeBuildInputs = [
-    pythonRelaxDepsHook
-    cython_0
+  build-system = [
+    cython
+    numpy
     pkgconfig
     setuptools
   ];
 
   buildInputs = [ hdf5 ] ++ lib.optional mpiSupport mpi;
 
-  propagatedBuildInputs =
+  dependencies =
     [ numpy ]
     ++ lib.optionals mpiSupport [
       mpi4py