depot/third_party/nixpkgs/pkgs/development/interpreters/python/hooks/pypa-install-hook.sh
Default email 5e7c2d6cef Project import generated by Copybara.
GitOrigin-RevId: f99e5f03cc0aa231ab5950a15ed02afec45ed51a
2023-10-09 21:29:22 +02:00

26 lines
627 B
Bash

# Setup hook for PyPA installer.
echo "Sourcing pypa-install-hook"
pypaInstallPhase() {
echo "Executing pypaInstallPhase"
runHook preInstall
pushd dist > /dev/null
for wheel in *.whl; do
@pythonInterpreter@ -m installer --prefix "$out" "$wheel"
echo "Successfully installed $wheel"
done
popd > /dev/null
export PYTHONPATH="$out/@pythonSitePackages@:$PYTHONPATH"
runHook postInstall
echo "Finished executing pypaInstallPhase"
}
if [ -z "${dontUsePypaInstall-}" ] && [ -z "${installPhase-}" ]; then
echo "Using pypaInstallPhase"
installPhase=pypaInstallPhase
fi