2019-07-17 19:36:47 +01:00
|
|
|
# Setup hook for checking whether Python imports succeed
|
|
|
|
echo "Sourcing python-imports-check-hook.sh"
|
|
|
|
|
|
|
|
pythonImportsCheckPhase () {
|
|
|
|
echo "Executing pythonImportsCheckPhase"
|
|
|
|
|
|
|
|
if [ -n "$pythonImportsCheck" ]; then
|
|
|
|
echo "Check whether the following modules can be imported: $pythonImportsCheck"
|
2020-02-20 02:36:56 +00:00
|
|
|
( cd $out && eval "@pythonCheckInterpreter@ -c 'import os; import importlib; list(map(lambda mod: importlib.import_module(mod), os.environ[\"pythonImportsCheck\"].split()))'" )
|
2019-07-17 19:36:47 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2019-10-31 16:50:15 +00:00
|
|
|
if [ -z "${dontUsePythonImportsCheck-}" ]; then
|
2019-07-17 19:36:47 +01:00
|
|
|
echo "Using pythonImportsCheckPhase"
|
|
|
|
preDistPhases+=" pythonImportsCheckPhase"
|
|
|
|
fi
|