pipInstallHook: handle pipInstallFlags __structuredAttrs-agnostically

This commit is contained in:
Yueh-Shun Li
2024-10-28 21:21:15 +08:00
parent c4bc1a8bb6
commit 3a0f6fabff
@@ -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