Commit d29eae89 authored by Doron Behar's avatar Doron Behar
Browse files

python312Packages.scipy: Allow building with Numpy 1

parent e3984ab1
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -91,6 +91,21 @@ buildPythonPackage {
      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.5" numpy
  '';

  build-system =
    [