summary refs log tree commit diff
path: root/pkgs/development/python-modules/accupy/default.nix
blob: 07c2bcfeb5e8a70e881c741ae4f452968d54b65f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{ lib
, buildPythonPackage
, fetchPypi
, mpmath
, numpy
, pipdate
, pybind11
, pyfma
, eigen
, pytest
, matplotlib
, perfplot
, isPy27
}:

buildPythonPackage rec {
  pname = "accupy";
  version = "0.2.0";
  disabled = isPy27;

  src = fetchPypi {
    inherit pname version;
    sha256 = "e27ca7eed8a1bde2e6e040f8f3ee94a5d7522f42c4360756c9ec8931cf13ca98";
  };

  buildInputs = [
    pybind11 eigen
  ];

  propagatedBuildInputs = [
    mpmath
    numpy
    pipdate
    pyfma
  ];

  checkInputs = [
    pytest
    matplotlib
    perfplot
  ];

  postConfigure = ''
   substituteInPlace setup.py \
     --replace "/usr/include/eigen3/" "${eigen}/include/eigen3/"
  '';

  preBuild = ''
    export HOME=$(mktemp -d)
  '';

  checkPhase = ''
    pytest test
  '';

  meta = with lib; {
    description = "Accurate sums and dot products for Python";
    homepage = https://github.com/nschloe/accupy;
    license = licenses.mit;
    maintainers = [ maintainers.costrouc ];
  };
}