about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.sh
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.sh')
-rw-r--r--nixpkgs/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.sh b/nixpkgs/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.sh
new file mode 100644
index 000000000000..43a2f9b88745
--- /dev/null
+++ b/nixpkgs/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.sh
@@ -0,0 +1,20 @@
+# 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