From be51056b8538aa23f18e7f4fff72e44b4dd56c59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 15 Mar 2024 11:10:45 +0100 Subject: [PATCH] pythonRelaxDepsHook: don't rely on pname as that could be normalized already according to the language docs --- .../interpreters/python/hooks/python-relax-deps-hook.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh b/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh index 293bd5cebd50..16df00013925 100644 --- a/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh +++ b/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh @@ -77,13 +77,12 @@ _pythonRemoveDeps() { pythonRelaxDepsHook() { pushd dist - # See https://peps.python.org/pep-0491/#escaping-and-unicode - local -r pkg_name="${pname//[^[:alnum:].]/_}" local -r unpack_dir="unpacked" - local -r metadata_file="$unpack_dir/$pkg_name*/$pkg_name*.dist-info/METADATA" + local -r metadata_file="$unpack_dir/*/*.dist-info/METADATA" # We generally shouldn't have multiple wheel files, but let's be safer here - for wheel in "$pkg_name"*".whl"; do + for wheel in *".whl"; do + PYTHONPATH="@wheel@/@pythonSitePackages@:$PYTHONPATH" \ @pythonInterpreter@ -m wheel unpack --dest "$unpack_dir" "$wheel" rm -rf "$wheel" @@ -98,7 +97,7 @@ pythonRelaxDepsHook() { fi PYTHONPATH="@wheel@/@pythonSitePackages@:$PYTHONPATH" \ - @pythonInterpreter@ -m wheel pack "$unpack_dir/$pkg_name"* + @pythonInterpreter@ -m wheel pack "$unpack_dir/"* done # Remove the folder since it will otherwise be in the dist output.