From 732c65bc8348473cf71bc1468b4f25d2b9f8c516 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Wed, 10 Jul 2024 12:38:34 +0300 Subject: [PATCH] python312Packages.freud: use pytestCheckHook --- .../python-modules/freud/default.nix | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/freud/default.nix b/pkgs/development/python-modules/freud/default.nix index e6bfd2af341b..10ddbedfb320 100644 --- a/pkgs/development/python-modules/freud/default.nix +++ b/pkgs/development/python-modules/freud/default.nix @@ -11,7 +11,8 @@ , numpy , rowan , scipy -, pytest +, pytestCheckHook +, python , gsd , matplotlib , sympy @@ -65,25 +66,22 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ - # Encountering circular ImportError issues with pytestCheckHook, see also: - # https://github.com/NixOS/nixpkgs/issues/255262 - pytest + pytestCheckHook gsd matplotlib sympy ]; - checkPhase = '' - runHook preCheck - - pytest - - runHook postCheck + disabledTests = [ + ] ++ lib.optionals stdenv.isAarch64 [ + # https://github.com/glotzerlab/freud/issues/961 + "test_docstring" + ]; + # On top of cd $out due to https://github.com/NixOS/nixpkgs/issues/255262 , + # we need to also copy the tests because otherwise pytest won't find them. + preCheck = '' + cp -R tests $out/${python.sitePackages}/freud/tests + cd $out ''; - # Some tests fail on aarch64. If we could have used pytestCheckHook, we would - # have disabled only the tests that fail with the disabledTests attribute. - # But that is not possible unfortunately. See upstream report for the - # failure: https://github.com/glotzerlab/freud/issues/961 - doCheck = !stdenv.isAarch64; pythonImportsCheck = [ "freud" ];