From d667de92a310f730a9c122083879f47051a1c066 Mon Sep 17 00:00:00 2001 From: Alexander Kiselyov Date: Tue, 4 Jul 2023 00:07:45 +0300 Subject: [PATCH] python3Packages.pyamg: enable tests --- .../python-modules/pyamg/default.nix | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/pyamg/default.nix b/pkgs/development/python-modules/pyamg/default.nix index 34702fda15e2..f441e21039ea 100644 --- a/pkgs/development/python-modules/pyamg/default.nix +++ b/pkgs/development/python-modules/pyamg/default.nix @@ -4,6 +4,7 @@ , numpy , scipy , pytest +, python , pybind11 , setuptools-scm , pythonOlder @@ -32,12 +33,16 @@ buildPythonPackage rec { pybind11 ]; - # failed with "ModuleNotFoundError: No module named 'pyamg.amg_core.evolution_strength'" - doCheck = false; - # taken from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=python-pyamg#n27 - # checkPhase = '' - # PYTHONPATH="$PWD/build/lib.linux-*:$PYTHONPATH" ${python3.interpreter} -c "import pyamg; pyamg.test()" - # ''; + checkPhase = '' + runHook preCheck + + # The `pyamg` directory in PWD doesn't have the compiled Cython modules in it, but has higher import priority compared to the properly built and installed `pyamg`. + # It's easier to just remove the package directory in PWD. + rm -r pyamg + ${python.interpreter} -c "import pyamg; pyamg.test()" + + runHook postCheck + ''; pythonImportsCheck = [ "pyamg"