about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/scipy
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/scipy')
-rw-r--r--nixpkgs/pkgs/development/python-modules/scipy/default.nix31
-rwxr-xr-xnixpkgs/pkgs/development/python-modules/scipy/update.sh8
2 files changed, 23 insertions, 16 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/scipy/default.nix b/nixpkgs/pkgs/development/python-modules/scipy/default.nix
index d51c049589ee..e58a165f5cca 100644
--- a/nixpkgs/pkgs/development/python-modules/scipy/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/scipy/default.nix
@@ -7,8 +7,6 @@
 , python
 , pythonOlder
 , buildPythonPackage
-, pypaBuildHook
-, pipInstallHook
 , cython
 , gfortran
 , meson-python
@@ -33,11 +31,9 @@ let
   #
   #     nix-shell maintainers/scripts/update.nix --argstr package python3.pkgs.scipy
   #
-  # Even if you do update these hashes manually, don't change their base
-  # (base16 or base64), because the update script uses sed regexes to replace
-  # them with the updated hashes.
-  version = "1.11.1";
-  srcHash = "sha256-bgnYXe3EhzL7+Gfriz1cXCl2eYQJ8zF+rcIwHyZR8bQ=";
+  # The update script uses sed regexes to replace them with the updated hashes.
+  version = "1.11.2";
+  srcHash = "sha256-7FE740/yKUXtujVX60fQB/xvCZFfV69FRihvSi6+UWo=";
   datasetsHashes = {
     ascent = "1qjp35ncrniq9rhzb14icwwykqg2208hcssznn3hz27w39615kh3";
     ecg = "1bwbjp43b7znnwha5hv6wiz3g0bhwrpqpi75s12zidxrbwvd62pj";
@@ -59,7 +55,7 @@ let
   '';
 in buildPythonPackage {
   inherit pname version;
-  format = "other";
+  format = "pyproject";
 
   src = fetchFromGitHub {
     owner = "scipy";
@@ -80,12 +76,22 @@ in buildPythonPackage {
     })
   ];
 
+  # Relax deps a bit
   postPatch = ''
     substituteInPlace pyproject.toml \
-      --replace "pybind11>=2.10.4,<2.11.0" "pybind11>=2.10.4,<2.12.0"
+      --replace 'numpy==' 'numpy>=' \
+      --replace "pybind11>=2.10.4,<2.11.0" "pybind11>=2.10.4,<2.12.0" \
+      --replace 'wheel<0.41.0' 'wheel'
   '';
 
-  nativeBuildInputs = [ pypaBuildHook pipInstallHook cython gfortran meson-python pythran pkg-config wheel ];
+  nativeBuildInputs = [
+    cython
+    gfortran
+    meson-python
+    pythran
+    pkg-config
+    wheel
+  ];
 
   buildInputs = [
     blas
@@ -99,14 +105,13 @@ in buildPythonPackage {
 
   propagatedBuildInputs = [ numpy ];
 
+  __darwinAllowLocalNetworking = true;
+
   nativeCheckInputs = [ nose pytest pytest-xdist ];
 
   doCheck = !(stdenv.isx86_64 && stdenv.isDarwin);
 
   preConfigure = ''
-    # Relax deps a bit
-    substituteInPlace pyproject.toml \
-      --replace 'numpy==' 'numpy>='
     # Helps parallelization a bit
     export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES
     # We download manually the datasets and this variable tells the pooch
diff --git a/nixpkgs/pkgs/development/python-modules/scipy/update.sh b/nixpkgs/pkgs/development/python-modules/scipy/update.sh
index b0d6e2da4f41..c6b3dca49186 100755
--- a/nixpkgs/pkgs/development/python-modules/scipy/update.sh
+++ b/nixpkgs/pkgs/development/python-modules/scipy/update.sh
@@ -16,10 +16,12 @@ if grep -q 'version = "'$version $fname; then
     echo "Current version $version is the latest available, will update only datasets' hashes (don't take long)"
 else
     echoerr got version $version
-    sed -i -E 's/(version = ).*=/\1'$version'/g' $fname
+    sed -i -E 's/(version = ").*(";)/\1'$version'\2/g' $fname
+    # Verify the sed command above did not fail
+    grep -q $version $fname
     # Update srcHash
-    srcHash='"sha256-'$(nix-prefetch-github scipy scipy --rev v${version} --fetch-submodules | jq --raw-output .sha256)'"'
-    sed -i 's/srcHash = .*=";/srcHash = '$srcHash';/g' $fname
+    srcHash="$(nix-prefetch-github scipy scipy --rev v${version} --fetch-submodules | jq --raw-output .hash)"
+    sed -i -E 's#(srcHash = ").*(";)#\1'$srcHash'\2#g' $fname
 fi
 
 for d in $datasets; do