From 3a0f6fabff15e2e59847bfc6c9563cc37b21de0c Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Wed, 11 Sep 2024 04:46:25 +0800 Subject: [PATCH] pipInstallHook: handle pipInstallFlags `__structuredAttrs`-agnostically --- .../python/hooks/pip-install-hook.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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