Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / python-modules / accupy / default.nix
blob67aba734214894aaf59f3ef75b21f58a06caa2e1
1 { lib
2 , buildPythonPackage
3 , fetchPypi
4 , pythonOlder
5 , mpmath
6 , numpy
7 , pybind11
8 , pyfma
9 , eigen
10 , importlib-metadata
11 , pytestCheckHook
12 , matplotlib
13 , dufte
14 , isPy27
17 buildPythonPackage rec {
18   pname = "accupy";
19   version = "0.3.4";
20   disabled = isPy27;
22   src = fetchPypi {
23     inherit pname version;
24     sha256 = "36506aca53154528997ac22aee6292c83da0f4850bb375c149512b5284bd4948";
25   };
27   nativeBuildInputs = [
28     pybind11
29   ];
31   buildInputs = [
32     eigen
33   ];
35   propagatedBuildInputs = [
36     mpmath
37     numpy
38     pyfma
39   ] ++ lib.optional (pythonOlder "3.8") importlib-metadata;
41   checkInputs = [
42     pytestCheckHook
43     matplotlib
44     dufte
45   ];
47   postConfigure = ''
48    substituteInPlace setup.py \
49      --replace "/usr/include/eigen3/" "${eigen}/include/eigen3/"
50   '';
52   preBuild = ''
53     export HOME=$(mktemp -d)
54   '';
56   # performance tests aren't useful to us and disabling them allows us to
57   # decouple ourselves from an unnecessary build dep
58   preCheck = ''
59     for f in test/test*.py ; do
60       substituteInPlace $f --replace 'import perfplot' ""
61     done
62   '';
63   disabledTests = [ "test_speed_comparison1" "test_speed_comparison2" ];
64   pythonImportsCheck = [ "accupy" ];
66   meta = with lib; {
67     description = "Accurate sums and dot products for Python";
68     homepage = "https://github.com/nschloe/accupy";
69     license = licenses.mit;
70     maintainers = [ maintainers.costrouc ];
71   };