2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2021-03-09 03:18:52 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, mpmath
|
|
|
|
, numpy
|
|
|
|
, pybind11
|
|
|
|
, pyfma
|
|
|
|
, eigen
|
2021-03-09 03:18:52 +00:00
|
|
|
, importlib-metadata
|
2020-10-07 09:15:18 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, matplotlib
|
2021-03-09 03:18:52 +00:00
|
|
|
, dufte
|
2020-04-24 23:36:52 +00:00
|
|
|
, isPy27
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "accupy";
|
2021-03-09 03:18:52 +00:00
|
|
|
version = "0.3.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-03-09 03:18:52 +00:00
|
|
|
sha256 = "36506aca53154528997ac22aee6292c83da0f4850bb375c149512b5284bd4948";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pybind11
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2021-03-09 03:18:52 +00:00
|
|
|
eigen
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
mpmath
|
|
|
|
numpy
|
|
|
|
pyfma
|
2021-03-09 03:18:52 +00:00
|
|
|
] ++ lib.optional (pythonOlder "3.8") importlib-metadata;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
2020-10-07 09:15:18 +00:00
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
matplotlib
|
2021-03-09 03:18:52 +00:00
|
|
|
dufte
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postConfigure = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "/usr/include/eigen3/" "${eigen}/include/eigen3/"
|
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
# 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
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2020-10-07 09:15:18 +00:00
|
|
|
disabledTests = [ "test_speed_comparison1" "test_speed_comparison2" ];
|
|
|
|
pythonImportsCheck = [ "accupy" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Accurate sums and dot products for Python";
|
|
|
|
homepage = "https://github.com/nschloe/accupy";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.costrouc ];
|
|
|
|
};
|
|
|
|
}
|