mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 04:46:43 +00:00
python3Packages.pythonImportsCheck: set $PYTHONPATH
Don't rely on the installPhase doing so.
This commit is contained in:
parent
967daf62ee
commit
fa3feb9f65
@ -93,7 +93,7 @@ in {
|
||||
makePythonHook {
|
||||
name = "python-imports-check-hook.sh";
|
||||
substitutions = {
|
||||
inherit pythonCheckInterpreter;
|
||||
inherit pythonCheckInterpreter pythonSitePackages;
|
||||
};
|
||||
} ./python-imports-check-hook.sh) {};
|
||||
|
||||
|
@ -6,6 +6,7 @@ pythonImportsCheckPhase () {
|
||||
|
||||
if [ -n "$pythonImportsCheck" ]; then
|
||||
echo "Check whether the following modules can be imported: $pythonImportsCheck"
|
||||
export PYTHONPATH="$out/@pythonSitePackages@:$PYTHONPATH"
|
||||
( cd $out && eval "@pythonCheckInterpreter@ -c 'import os; import importlib; list(map(lambda mod: importlib.import_module(mod), os.environ[\"pythonImportsCheck\"].split()))'" )
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user