about summary refs log tree commit diff
path: root/pkgs/development/python-modules/scipy
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2024-05-22 16:01:06 +0200
committerMartin Weinelt <hexa@darmstadt.ccc.de>2024-05-22 17:32:03 +0200
commit59b1aef59071cae6e87859dc65de973d2cc595c0 (patch)
tree18c3aaf31188cb7430359a1bb130d637a363351e /pkgs/development/python-modules/scipy
parent691216eca3d0ce5ad6ac10562e75910fa02415b0 (diff)
python3Packages: format with nixfmt
Diffstat (limited to 'pkgs/development/python-modules/scipy')
-rw-r--r--pkgs/development/python-modules/scipy/default.nix124
1 files changed, 65 insertions, 59 deletions
diff --git a/pkgs/development/python-modules/scipy/default.nix b/pkgs/development/python-modules/scipy/default.nix
index 57769c7f6afec..19bba41bfa501 100644
--- a/pkgs/development/python-modules/scipy/default.nix
+++ b/pkgs/development/python-modules/scipy/default.nix
@@ -1,33 +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
-
-# Reverse dependency
-, sage
+{
+  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
@@ -45,7 +46,8 @@ let
     face = "11i8x29h80y7hhyqhil1fg8mxag5f827g33lhnsf44qk116hp2wx";
   };
   datasets = lib.mapAttrs (
-    d: hash: fetchurl {
+    d: hash:
+    fetchurl {
       url = "https://raw.githubusercontent.com/scipy/dataset-${d}/main/${d}.dat";
       sha256 = hash;
     }
@@ -58,7 +60,8 @@ let
     host-python-path = '${python.interpreter}'
     host-python-version = '${python.pythonVersion}'
   '';
-in buildPythonPackage {
+in
+buildPythonPackage {
   inherit pname version;
   format = "pyproject";
 
@@ -75,9 +78,7 @@ 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:
@@ -113,9 +114,7 @@ in buildPythonPackage {
     pybind11
     pooch
     xsimd
-  ] ++ lib.optionals (pythonOlder "3.9") [
-    libxcrypt
-  ];
+  ] ++ lib.optionals (pythonOlder "3.9") [ libxcrypt ];
 
   propagatedBuildInputs = [ numpy ];
 
@@ -141,18 +140,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}"
@@ -188,15 +192,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)
-    ;
-    tests = { inherit sage; };
+    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;