core/pkgs/by-name/py/python/hooks/python-runtime-deps-check-hook.sh

21 lines
572 B
Bash
Raw Normal View History

2024-05-02 00:46:19 +00:00
# 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"
preInstallPhases+=" pythonRuntimeDepsCheckHook"
fi