From 8224fea3dbe4fddbcb14c1174ee03cc575a043c2 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 20 Feb 2025 15:06:45 +0200 Subject: [PATCH] python312Packages.h5py: use environment to spare mpi4py setup.py substitutions --- pkgs/development/python-modules/h5py/default.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/h5py/default.nix b/pkgs/development/python-modules/h5py/default.nix index 192fe6d7158b..26b2a38984ed 100644 --- a/pkgs/development/python-modules/h5py/default.nix +++ b/pkgs/development/python-modules/h5py/default.nix @@ -35,20 +35,19 @@ buildPythonPackage rec { pythonRelaxDeps = [ "mpi4py" ]; - # avoid strict pinning of numpy and mpi4py, can't be replaced with - # pythonRelaxDepsHook, see: https://github.com/NixOS/nixpkgs/issues/327941 + # Avoid strict pinning of Numpy, can't be replaced with pythonRelaxDepsHook, + # as these are build time dependencies. See: + # https://github.com/NixOS/nixpkgs/issues/327941 postPatch = '' substituteInPlace pyproject.toml \ --replace-fail "numpy >=2.0.0, <3" "numpy" - substituteInPlace setup.py \ - --replace-fail "mpi4py ==3.1.4" "mpi4py" \ - --replace-fail "mpi4py ==4.0.1" "mpi4py" \ - --replace-fail "mpi4py ==3.1.6" "mpi4py" ''; env = { HDF5_DIR = "${hdf5}"; HDF5_MPI = if mpiSupport then "ON" else "OFF"; + # See discussion at https://github.com/h5py/h5py/issues/2560 + H5PY_SETUP_REQUIRES = 0; }; postConfigure = ''