lol

pythonImportsCheckHook: support __structuredAttrs = true

+6 -5
+6 -5
pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh
··· 4 4 pythonImportsCheckPhase() { 5 5 echo "Executing pythonImportsCheckPhase" 6 6 7 - if [ -n "$pythonImportsCheck" ]; then 8 - echo "Check whether the following modules can be imported: $pythonImportsCheck" 9 - pythonImportsCheckOutput=$out 10 - if [ -n "$python" ]; then 7 + if [ -n "${pythonImportsCheck[*]-}" ]; then 8 + echo "Check whether the following modules can be imported: ${pythonImportsCheck[*]}" 9 + # shellcheck disable=SC2154 10 + pythonImportsCheckOutput="$out" 11 + if [ -n "${python-}" ]; then 11 12 echo "Using python specific output \$python for imports check" 12 13 pythonImportsCheckOutput=$python 13 14 fi 14 15 export PYTHONPATH="$pythonImportsCheckOutput/@pythonSitePackages@:$PYTHONPATH" 15 - (cd $pythonImportsCheckOutput && @pythonCheckInterpreter@ -c 'import os; import importlib; list(map(lambda mod: importlib.import_module(mod), os.environ["pythonImportsCheck"].split()))') 16 + (cd "$pythonImportsCheckOutput" && @pythonCheckInterpreter@ -c 'import sys; import importlib; list(map(lambda mod: importlib.import_module(mod), sys.argv[1:]))' ${pythonImportsCheck[*]}) 16 17 fi 17 18 } 18 19