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"