diff options
Diffstat (limited to 'pkgs/development/python-modules/scipy/default.nix')
-rw-r--r-- | pkgs/development/python-modules/scipy/default.nix | 130 |
1 files changed, 67 insertions, 63 deletions
diff --git a/pkgs/development/python-modules/scipy/default.nix b/pkgs/development/python-modules/scipy/default.nix index 64e261c374039..1bd02b708089e 100644 --- a/pkgs/development/python-modules/scipy/default.nix +++ b/pkgs/development/python-modules/scipy/default.nix @@ -1,30 +1,34 @@ -{ lib -, stdenv -, fetchFromGitHub -, fetchpatch -, fetchurl -, writeText -, python -, pythonOlder -, buildPythonPackage -, cython -, gfortran -, meson-python -, nukeReferences -, pkg-config -, pythran -, wheel -, setuptools -, hypothesis -, pytest7CheckHook -, pytest-xdist -, numpy -, pybind11 -, pooch -, libxcrypt -, xsimd -, blas -, lapack +{ + lib, + stdenv, + fetchFromGitHub, + fetchpatch, + fetchurl, + writeText, + python, + pythonOlder, + buildPythonPackage, + cython, + gfortran, + meson-python, + nukeReferences, + pkg-config, + pythran, + wheel, + setuptools, + hypothesis, + pytest7CheckHook, + pytest-xdist, + numpy, + pybind11, + pooch, + libxcrypt, + xsimd, + blas, + lapack, + + # Reverse dependency + sage, }: let @@ -34,15 +38,16 @@ let # nix-shell maintainers/scripts/update.nix --argstr package python3.pkgs.scipy # # The update script uses sed regexes to replace them with the updated hashes. - version = "1.13.0"; - srcHash = "sha256-HaYk92hOREHMOXppK+Bs9DrBu9KUVUsZ0KV+isTofUo="; + version = "1.13.1"; + srcHash = "sha256-KpTvBJhiJ/IBjIFQhvS+NhRP3tbyXU5gQnAiFv47sKU="; datasetsHashes = { ascent = "1qjp35ncrniq9rhzb14icwwykqg2208hcssznn3hz27w39615kh3"; ecg = "1bwbjp43b7znnwha5hv6wiz3g0bhwrpqpi75s12zidxrbwvd62pj"; face = "11i8x29h80y7hhyqhil1fg8mxag5f827g33lhnsf44qk116hp2wx"; }; datasets = lib.mapAttrs ( - d: hash: fetchurl { + d: hash: + fetchurl { url = "https://raw.githubusercontent.com/scipy/dataset-${d}/main/${d}.dat"; sha256 = hash; } @@ -55,7 +60,8 @@ let host-python-path = '${python.interpreter}' host-python-version = '${python.pythonVersion}' ''; -in buildPythonPackage { +in +buildPythonPackage { inherit pname version; format = "pyproject"; @@ -72,16 +78,8 @@ in buildPythonPackage { (fetchpatch { url = "https://github.com/scipy/scipy/commit/dd50ac9d98dbb70625333a23e3a90e493228e3be.patch"; hash = "sha256-Vf6/hhwu6X5s8KWhq8bUZKtSkdVu/GtEpGtj8Olxe7s="; - excludes = [ - "doc/source/dev/contributor/meson_advanced.rst" - ]; + excludes = [ "doc/source/dev/contributor/meson_advanced.rst" ]; }) - # Fix for https://github.com/scipy/scipy/issues/20300 until 1.13.1 is - # released. Patch is based upon: - # https://github.com/scipy/pocketfft/commit/9367142748fcc9696a1c9e5a99b76ed9897c9daa - # Couldn't use fetchpatch because it is a submodule of scipy, and - # extraPrefix doesn't fit this purpose. - ./pocketfft-aligned_alloc.patch ]; # Upstream says in a comment in their pyproject.toml that building against @@ -110,9 +108,7 @@ in buildPythonPackage { pybind11 pooch xsimd - ] ++ lib.optionals (pythonOlder "3.9") [ - libxcrypt - ]; + ] ++ lib.optionals (pythonOlder "3.9") [ libxcrypt ]; propagatedBuildInputs = [ numpy ]; @@ -138,18 +134,23 @@ in buildPythonPackage { doCheck = !(stdenv.isx86_64 && stdenv.isDarwin); - preConfigure = '' - # Helps parallelization a bit - export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES - # We download manually the datasets and this variable tells the pooch - # library where these files are cached. See also: - # https://github.com/scipy/scipy/pull/18518#issuecomment-1562350648 And at: - # https://github.com/scipy/scipy/pull/17965#issuecomment-1560759962 - export XDG_CACHE_HOME=$PWD; export HOME=$(mktemp -d); mkdir scipy-data - '' + (lib.concatStringsSep "\n" (lib.mapAttrsToList (d: dpath: - # Actually copy the datasets - "cp ${dpath} scipy-data/${d}.dat" - ) datasets)); + preConfigure = + '' + # Helps parallelization a bit + export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES + # We download manually the datasets and this variable tells the pooch + # library where these files are cached. See also: + # https://github.com/scipy/scipy/pull/18518#issuecomment-1562350648 And at: + # https://github.com/scipy/scipy/pull/17965#issuecomment-1560759962 + export XDG_CACHE_HOME=$PWD; export HOME=$(mktemp -d); mkdir scipy-data + '' + + (lib.concatStringsSep "\n" ( + lib.mapAttrsToList ( + d: dpath: + # Actually copy the datasets + "cp ${dpath} scipy-data/${d}.dat" + ) datasets + )); mesonFlags = [ "-Dblas=${blas.pname}" @@ -185,14 +186,17 @@ in buildPythonPackage { passthru = { inherit blas; - updateScript = [ - ./update.sh - # Pass it this file name as argument - (builtins.unsafeGetAttrPos "pname" python.pkgs.scipy).file - ] - # Pass it the names of the datasets to update their hashes - ++ (builtins.attrNames datasetsHashes) - ; + updateScript = + [ + ./update.sh + # Pass it this file name as argument + (builtins.unsafeGetAttrPos "pname" python.pkgs.scipy).file + ] + # Pass it the names of the datasets to update their hashes + ++ (builtins.attrNames datasetsHashes); + tests = { + inherit sage; + }; }; SCIPY_USE_G77_ABI_WRAPPER = 1; |