nixpkgs-suyu/pkgs/development/python-modules/accupy/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

76 lines
1.4 KiB
Nix
Raw Normal View History

2019-05-20 16:55:11 +02:00
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
2019-05-20 16:55:11 +02:00
, mpmath
, numpy
, pybind11
, pyfma
, eigen
, importlib-metadata
, pytestCheckHook
2019-05-20 16:55:11 +02:00
, matplotlib
, dufte
, perfplot
2019-05-20 16:55:11 +02:00
}:
buildPythonPackage rec {
pname = "accupy";
2021-10-09 00:22:56 +02:00
version = "0.3.6";
disabled = pythonOlder "3.7";
2019-05-20 16:55:11 +02:00
src = fetchFromGitHub {
owner = "nschloe";
repo = pname;
rev = version;
sha256 = "0sxkwpp2xy2jgakhdxr4nh1cspqv8l89kz6s832h05pbpyc0n767";
2019-05-20 16:55:11 +02:00
};
nativeBuildInputs = [
pybind11
];
2019-05-20 16:55:11 +02:00
buildInputs = [
eigen
2019-05-20 16:55:11 +02:00
];
propagatedBuildInputs = [
mpmath
numpy
pyfma
] ++ lib.optional (pythonOlder "3.8") importlib-metadata;
2019-05-20 16:55:11 +02:00
checkInputs = [
perfplot
pytestCheckHook
2019-05-20 16:55:11 +02:00
matplotlib
dufte
2019-05-20 16:55:11 +02:00
];
postConfigure = ''
substituteInPlace setup.py \
--replace "/usr/include/eigen3/" "${eigen}/include/eigen3/"
'';
preBuild = ''
export HOME=$(mktemp -d)
'';
# performance tests aren't useful to us and disabling them allows us to
# decouple ourselves from an unnecessary build dep
preCheck = ''
for f in test/test*.py ; do
substituteInPlace $f --replace 'import perfplot' ""
done
2019-05-20 16:55:11 +02:00
'';
disabledTests = [ "test_speed_comparison1" "test_speed_comparison2" ];
pythonImportsCheck = [ "accupy" ];
2019-05-20 16:55:11 +02:00
meta = with lib; {
description = "Accurate sums and dot products for Python";
homepage = "https://github.com/nschloe/accupy";
2019-05-20 16:55:11 +02:00
license = licenses.mit;
maintainers = [ maintainers.costrouc ];
};
}