1{lib, fetchPypi, python, buildPythonPackage, gfortran, nose, pytest, numpy, pybind11}:
2
3let
4 pybind = pybind11.overridePythonAttrs(oldAttrs: {
5 cmakeFlags = oldAttrs.cmakeFlags ++ [
6 "-DPYBIND11_TEST=off"
7 ];
8 doCheck = false; # Circular test dependency
9 });
10in buildPythonPackage rec {
11 pname = "scipy";
12 version = "1.6.1";
13
14 src = fetchPypi {
15 inherit pname version;
16 sha256 = "048vd4c843xaq45yk3kn491gvqnvhp2i9rxhg671ddlh923fpz64";
17 };
18
19 checkInputs = [ nose pytest ];
20 nativeBuildInputs = [ gfortran ];
21 buildInputs = [ numpy.blas pybind ];
22 propagatedBuildInputs = [ numpy ];
23
24 # Remove tests because of broken wrapper
25 prePatch = ''
26 rm scipy/linalg/tests/test_lapack.py
27 '';
28
29 doCheck = true;
30
31 preConfigure = ''
32 sed -i '0,/from numpy.distutils.core/s//import setuptools;from numpy.distutils.core/' setup.py
33 export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES
34 '';
35
36 preBuild = ''
37 ln -s ${numpy.cfg} site.cfg
38 '';
39
40 checkPhase = ''
41 runHook preCheck
42 pushd dist
43 ${python.interpreter} -c 'import scipy; scipy.test("fast", verbose=10)'
44 popd
45 runHook postCheck
46 '';
47
48 passthru = {
49 blas = numpy.blas;
50 };
51
52 setupPyBuildFlags = [ "--fcompiler='gnu95'" ];
53
54 SCIPY_USE_G77_ABI_WRAPPER = 1;
55
56 meta = with lib; {
57 description = "SciPy (pronounced 'Sigh Pie') is open-source software for mathematics, science, and engineering";
58 homepage = "https://www.scipy.org/";
59 license = licenses.bsd3;
60 maintainers = [ maintainers.fridh ];
61 };
62}