2021-05-28 09:39:13 +00:00
|
|
|
{ lib
|
|
|
|
, fetchPypi
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
2023-03-15 16:39:30 +00:00
|
|
|
, blosc2
|
2021-05-28 09:39:13 +00:00
|
|
|
, bzip2
|
|
|
|
, c-blosc
|
|
|
|
, cython
|
|
|
|
, hdf5
|
|
|
|
, lzo
|
|
|
|
, numpy
|
|
|
|
, numexpr
|
2022-01-07 04:07:37 +00:00
|
|
|
, packaging
|
2024-01-13 08:15:51 +00:00
|
|
|
, setuptools
|
2023-03-15 16:39:30 +00:00
|
|
|
, sphinx
|
2021-05-28 09:39:13 +00:00
|
|
|
# Test inputs
|
2023-03-15 16:39:30 +00:00
|
|
|
, python
|
|
|
|
, pytest
|
2023-04-12 12:48:02 +00:00
|
|
|
, py-cpuinfo
|
2021-05-28 09:39:13 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tables";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "3.9.2";
|
2024-02-07 01:22:34 +00:00
|
|
|
format = "setuptools";
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-1HAmPC5QxLfIY1oNmawf8vnnBMJNceX6M8RSnn0K2cM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
blosc2
|
|
|
|
cython
|
2024-01-13 08:15:51 +00:00
|
|
|
setuptools
|
2023-03-15 16:39:30 +00:00
|
|
|
sphinx
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
buildInputs = [
|
|
|
|
bzip2
|
|
|
|
c-blosc
|
|
|
|
hdf5
|
|
|
|
lzo
|
|
|
|
];
|
2023-04-12 12:48:02 +00:00
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
propagatedBuildInputs = [
|
2023-03-15 16:39:30 +00:00
|
|
|
blosc2
|
2023-04-12 12:48:02 +00:00
|
|
|
py-cpuinfo
|
2021-05-28 09:39:13 +00:00
|
|
|
numpy
|
|
|
|
numexpr
|
2023-04-12 12:48:02 +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"
|
2023-03-15 16:39:30 +00:00
|
|
|
substituteInPlace requirements.txt \
|
2023-03-24 00:07:29 +00:00
|
|
|
--replace "cython>=0.29.21" "" \
|
2023-03-15 16:39:30 +00:00
|
|
|
--replace "blosc2~=2.0.0" "blosc2"
|
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
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytest
|
|
|
|
];
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
preCheck = ''
|
|
|
|
cd ..
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
# Runs the light (yet comprehensive) subset of the test suite.
|
|
|
|
# The whole "heavy" test suite supposedly takes ~4 hours to run.
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
${python.interpreter} -m tables.tests.test_all
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
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/";
|
2023-04-12 12:48:02 +00:00
|
|
|
changelog = "https://github.com/PyTables/PyTables/releases/tag/v${version}";
|
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
|
|
|
};
|
|
|
|
}
|