pipInstallHook: handle pipInstallFlags `__structuredAttrs`-agnostically

Changed files
+13 -3
pkgs
development
interpreters
python
+13 -3
pkgs/development/interpreters/python/hooks/pip-install-hook.sh
···
# 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