From d30896c60b5ddc7239e40741e3ad6dd1433f1134 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 2 Feb 2026 10:57:09 +0200 Subject: [PATCH] python3.pkgs.scipy: revive Numpy 1 pyproject.toml substitution This commit reverts most of 3cadb0cf908455a617a29bc08ab317a28aecec11. See comment within. --- pkgs/development/python-modules/scipy/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/development/python-modules/scipy/default.nix b/pkgs/development/python-modules/scipy/default.nix index 43f471b1638d..38172b3fb813 100644 --- a/pkgs/development/python-modules/scipy/default.nix +++ b/pkgs/development/python-modules/scipy/default.nix @@ -64,6 +64,21 @@ buildPythonPackage (finalAttrs: { excludes = [ "doc/source/dev/contributor/meson_advanced.rst" ]; }) ]; + # A NOTE regarding the Numpy version relaxing: Both Numpy versions 1.x & + # 2.x are supported. However upstream wants to always build with Numpy 2, + # and with it to still be able to run with a Numpy 1 or 2. We insist to + # perform this substitution even though python3.pkgs.numpy is of version 2 + # nowadays, because our ecosystem unfortunately doesn't allow easily + # separating runtime and build-system dependencies. See also: + # + # https://discourse.nixos.org/t/several-comments-about-priorities-and-new-policies-in-the-python-ecosystem/51790 + # + # Being able to build (& run) with Numpy 1 helps for python environments + # that override globally the `numpy` attribute to point to `numpy_1`. + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "numpy>=2.0.0,<2.6" numpy + ''; build-system = [ cython