From b4da2596864abc36f04301a286b1c4fd17abdccd Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Mon, 6 May 2024 15:14:21 +0200 Subject: [PATCH] python3Packages.h5py: lift requirement for mpi4py version Unbreak the build for python 3.11 and python 3.12 --- pkgs/development/python-modules/h5py/default.nix | 6 ++++++ .../python-modules/h5py/mpi4py-requirement.patch | 13 +++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 pkgs/development/python-modules/h5py/mpi4py-requirement.patch diff --git a/pkgs/development/python-modules/h5py/default.nix b/pkgs/development/python-modules/h5py/default.nix index bc23ce61c176..0da90d4ccb9e 100644 --- a/pkgs/development/python-modules/h5py/default.nix +++ b/pkgs/development/python-modules/h5py/default.nix @@ -31,6 +31,12 @@ in buildPythonPackage rec { hash = "sha256-e36PeAcqLt7IfJg28l80ID/UkqRHVwmhi0F6M8+yH6k="; }; + 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 + ]; + # avoid strict pinning of numpy postPatch = '' substituteInPlace pyproject.toml \ diff --git a/pkgs/development/python-modules/h5py/mpi4py-requirement.patch b/pkgs/development/python-modules/h5py/mpi4py-requirement.patch new file mode 100644 index 000000000000..b32e804ebe5f --- /dev/null +++ b/pkgs/development/python-modules/h5py/mpi4py-requirement.patch @@ -0,0 +1,13 @@ +diff --git a/setup.py b/setup.py +index b1463422..7f0c7b10 100755 +--- a/setup.py ++++ b/setup.py +@@ -47,7 +47,7 @@ if setup_configure.mpi_enabled(): + # incompatible with newer setuptools. + RUN_REQUIRES.append('mpi4py >=3.1.1') + SETUP_REQUIRES.append("mpi4py ==3.1.1; python_version<'3.11'") +- SETUP_REQUIRES.append("mpi4py ==3.1.4; python_version>='3.11'") ++ SETUP_REQUIRES.append("mpi4py >=3.1.4; python_version>='3.11'") + + # Set the environment variable H5PY_SETUP_REQUIRES=0 if we need to skip + # setup_requires for any reason.