python3Packages.dtw-python: set pytestFlagsArray in preCheck hook

This flag relies on bash eval of pytestFlagsArray, which we'd like to
get rid of. By moving the evaluation of $src into the preCheck hook, we
achieve the same.
This commit is contained in:
Wolfgang Walther 2024-10-30 22:01:04 +01:00
parent cfd186f097
commit c23f21bead
No known key found for this signature in database
GPG Key ID: B39893FA5F65CAE1

View File

@ -39,10 +39,12 @@ buildPythonPackage rec {
];
# We need to run tests on real built package: https://github.com/NixOS/nixpkgs/issues/255262
preCheck = "cd $out";
nativeCheckInputs = [ pytestCheckHook ];
# tests/ are not included to output package, so we have to set path explicitly
pytestFlagsArray = [ "$src/tests" ];
preCheck = ''
appendToVar pytestFlagsArray "$src/tests"
cd $out
'';
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "dtw" ];