Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.03 16 lines 637 B view raw
1# Setup hook for checking whether Python imports succeed 2echo "Sourcing python-imports-check-hook.sh" 3 4pythonImportsCheckPhase () { 5 echo "Executing pythonImportsCheckPhase" 6 7 if [ -n "$pythonImportsCheck" ]; then 8 echo "Check whether the following modules can be imported: $pythonImportsCheck" 9 cd $out && eval "@pythonCheckInterpreter@ -c 'import os; import importlib; list(map(lambda mod: importlib.import_module(mod), os.environ[\"pythonImportsCheck\"].split()))'" 10 fi 11} 12 13if [ -z "${dontUsePythonImportsCheck-}" ]; then 14 echo "Using pythonImportsCheckPhase" 15 preDistPhases+=" pythonImportsCheckPhase" 16fi