2021-05-28 09:39:13 +00:00
|
|
|
{ lib
|
|
|
|
, fetchPypi
|
|
|
|
, fetchpatch
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, bzip2
|
|
|
|
, c-blosc
|
|
|
|
, cython
|
|
|
|
, hdf5
|
|
|
|
, lzo
|
|
|
|
, numpy
|
|
|
|
, numexpr
|
2022-01-07 04:07:37 +00:00
|
|
|
, packaging
|
2021-05-28 09:39:13 +00:00
|
|
|
# Test inputs
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tables";
|
2022-01-07 04:07:37 +00:00
|
|
|
version = "3.7.0";
|
2021-05-28 09:39:13 +00:00
|
|
|
disabled = pythonOlder "3.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-01-07 04:07:37 +00:00
|
|
|
sha256 = "sha256-6SqIetbyqYPlZKaZAt5KdkXDAGn8AavTU+xdolXF4f4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cython ];
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
buildInputs = [
|
|
|
|
bzip2
|
|
|
|
c-blosc
|
|
|
|
hdf5
|
|
|
|
lzo
|
|
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
numexpr
|
2022-01-07 04:07:37 +00:00
|
|
|
packaging # uses packaging.version at runtime
|
2021-05-28 09:39:13 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# When doing `make distclean`, ignore docs
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile --replace "src doc" "src"
|
2021-05-28 09:39:13 +00:00
|
|
|
# Force test suite to error when unittest runner fails
|
|
|
|
substituteInPlace tables/tests/test_suite.py \
|
|
|
|
--replace "return 0" "assert result.wasSuccessful(); return 0" \
|
|
|
|
--replace "return 1" "assert result.wasSuccessful(); return 1"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# Regenerate C code with Cython
|
|
|
|
preBuild = ''
|
|
|
|
make distclean
|
|
|
|
'';
|
|
|
|
|
|
|
|
setupPyBuildFlags = [
|
2021-02-05 17:12:51 +00:00
|
|
|
"--hdf5=${lib.getDev hdf5}"
|
|
|
|
"--lzo=${lib.getDev lzo}"
|
|
|
|
"--bzip2=${lib.getDev bzip2}"
|
|
|
|
"--blosc=${lib.getDev c-blosc}"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2021-05-28 09:39:13 +00:00
|
|
|
|
|
|
|
checkInputs = [ pytestCheckHook ];
|
|
|
|
preCheck = ''
|
|
|
|
cd ..
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2021-05-28 09:39:13 +00:00
|
|
|
# Runs the test suite as one single test via unittest. The whole "heavy" test suite supposedly takes ~5 hours to run.
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"--pyargs"
|
|
|
|
"tables.tests.test_suite"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
pythonImportsCheck = [ "tables" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Hierarchical datasets for Python";
|
2021-05-28 09:39:13 +00:00
|
|
|
homepage = "https://www.pytables.org/";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = licenses.bsd2;
|
2021-05-28 09:39:13 +00:00
|
|
|
maintainers = with maintainers; [ drewrisinger ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|