nixpkgs/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.sh
Yueh-Shun Li 385d523a8e treewide: handle preInstallPhases __structuredAttrs-agnostically
Always specify the preInstallPhases attribute as a list instead of a
string.

Append elements to the preInstallPhases Bash variable using appendToVar
instead of string or Bash array concatenation.
2024-09-03 05:33:59 +08:00

21 lines
580 B
Bash

# Setup hook for PyPA installer.
echo "Sourcing python-runtime-deps-check-hook"
pythonRuntimeDepsCheckHook() {
echo "Executing pythonRuntimeDepsCheck"
export PYTHONPATH="$out/@pythonSitePackages@:$PYTHONPATH"
for wheel in dist/*.whl; do
echo "Checking runtime dependencies for $(basename $wheel)"
@pythonInterpreter@ @hook@ "$wheel"
done
echo "Finished executing pythonRuntimeDepsCheck"
}
if [ -z "${dontCheckRuntimeDeps-}" ]; then
echo "Using pythonRuntimeDepsCheckHook"
appendToVar preInstallPhases pythonRuntimeDepsCheckHook
fi