python310Packages.tables: Fix build, update tests

The build now requires blosc2, packaged in the previous commit.

The tests via pytest were stuck, so I looked up how they run their tests
and adapted our check phase.
This commit is contained in:
Martin Weinelt 2023-03-08 00:05:23 +00:00
parent 9d62ef9265
commit b0723a0ac6
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759

View File

@ -3,6 +3,7 @@
, fetchpatch
, buildPythonPackage
, pythonOlder
, blosc2
, bzip2
, c-blosc
, cython
@ -11,8 +12,10 @@
, numpy
, numexpr
, packaging
, sphinx
# Test inputs
, pytestCheckHook
, python
, pytest
}:
buildPythonPackage rec {
@ -25,7 +28,11 @@ buildPythonPackage rec {
hash = "sha256-NPP6I2bOILGPHfVzp3wdJzBs4fKkHZ+e/2IbUZLqh4g=";
};
nativeBuildInputs = [ cython ];
nativeBuildInputs = [
blosc2
cython
sphinx
];
buildInputs = [
bzip2
@ -34,6 +41,7 @@ buildPythonPackage rec {
lzo
];
propagatedBuildInputs = [
blosc2
numpy
numexpr
packaging # uses packaging.version at runtime
@ -46,6 +54,8 @@ buildPythonPackage rec {
substituteInPlace tables/tests/test_suite.py \
--replace "return 0" "assert result.wasSuccessful(); return 0" \
--replace "return 1" "assert result.wasSuccessful(); return 1"
substituteInPlace requirements.txt \
--replace "blosc2~=2.0.0" "blosc2"
'';
# Regenerate C code with Cython
@ -60,15 +70,21 @@ buildPythonPackage rec {
"--blosc=${lib.getDev c-blosc}"
];
nativeCheckInputs = [ pytestCheckHook ];
nativeCheckInputs = [
pytest
];
preCheck = ''
cd ..
'';
# 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"
];
# 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
'';
pythonImportsCheck = [ "tables" ];