diff --git a/pkgs/development/interpreters/python/hooks/pip-install-hook.sh b/pkgs/development/interpreters/python/hooks/pip-install-hook.sh index a4f08b8b14cb..0f718a6c4bb8 100644 --- a/pkgs/development/interpreters/python/hooks/pip-install-hook.sh +++ b/pkgs/development/interpreters/python/hooks/pip-install-hook.sh @@ -1,17 +1,27 @@ # Setup hook for pip. -echo "Sourcing pip-install-hook" +# shellcheck shell=bash -declare -a pipInstallFlags +echo "Sourcing pip-install-hook" pipInstallPhase() { echo "Executing pipInstallPhase" runHook preInstall + # shellcheck disable=SC2154 mkdir -p "$out/@pythonSitePackages@" export PYTHONPATH="$out/@pythonSitePackages@:$PYTHONPATH" + local -a flagsArray=( + --no-index + --no-warn-script-location + --prefix="$out" + --no-cache + ) + concatTo flagsArray pipInstallFlags + pushd dist || return 1 - @pythonInterpreter@ -m pip install ./*.whl --no-index --no-warn-script-location --prefix="$out" --no-cache $pipInstallFlags + echoCmd 'pip install flags' "${flagsArray[@]}" + @pythonInterpreter@ -m pip install ./*.whl "${flagsArray[@]}" popd || return 1 runHook postInstall