summary refs log tree commit diff
path: root/pkgs/development/interpreters/python/hooks
diff options
context:
space:
mode:
authorThiago Kenji Okada <thiagokokada@gmail.com>2023-08-12 00:57:55 +0000
committerGitHub <noreply@github.com>2023-08-12 00:57:55 +0000
commit5dda73a16203fdca596292e85abdc309b10f1ed1 (patch)
tree963ccba4e5a9f9bb20070b861116143cb11f2663 /pkgs/development/interpreters/python/hooks
parent34e58fc4e9c09310c2895629c2265f9ffe190a70 (diff)
parent98de48fc8fc8653d82ed4769209564126d299878 (diff)
downloadnixpkgs-5dda73a16203fdca596292e85abdc309b10f1ed1.tar
nixpkgs-5dda73a16203fdca596292e85abdc309b10f1ed1.tar.gz
nixpkgs-5dda73a16203fdca596292e85abdc309b10f1ed1.tar.bz2
nixpkgs-5dda73a16203fdca596292e85abdc309b10f1ed1.tar.lz
nixpkgs-5dda73a16203fdca596292e85abdc309b10f1ed1.tar.xz
nixpkgs-5dda73a16203fdca596292e85abdc309b10f1ed1.tar.zst
nixpkgs-5dda73a16203fdca596292e85abdc309b10f1ed1.zip
Merge pull request #248516 from thiagokokada/remove-version-from-python-relax-deps-hook
pythonRelaxDepsHook: remove version from pkg_name
Diffstat (limited to 'pkgs/development/interpreters/python/hooks')
-rw-r--r--pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh13
1 files changed, 7 insertions, 6 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 31bdec914f6..3502fe10636 100644
--- a/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh
+++ b/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh
@@ -78,24 +78,25 @@ pythonRelaxDepsHook() {
     pushd dist
 
     # See https://peps.python.org/pep-0491/#escaping-and-unicode
-    local -r pkg_name="${pname//[^[:alnum:].]/_}-$version"
+    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/$pkg_name*/$pkg_name*.dist-info/METADATA"
 
     # We generally shouldn't have multiple wheel files, but let's be safer here
     for wheel in "$pkg_name"*".whl"; do
         @pythonInterpreter@ -m wheel unpack --dest "$unpack_dir" "$wheel"
         rm -rf "$wheel"
 
-        _pythonRelaxDeps "$metadata_file"
-        _pythonRemoveDeps "$metadata_file"
+        # Using no quotes on purpose since we need to expand the glob from `$metadata_file`
+        _pythonRelaxDeps $metadata_file
+        _pythonRemoveDeps $metadata_file
 
         if (( "${NIX_DEBUG:-0}" >= 1 )); then
             echo "pythonRelaxDepsHook: resulting METADATA for '$wheel':"
-            cat "$unpack_dir/$pkg_name/$pkg_name.dist-info/METADATA"
+            cat $metadata_file
         fi
 
-        @pythonInterpreter@ -m wheel pack "$unpack_dir/$pkg_name"
+        @pythonInterpreter@ -m wheel pack "$unpack_dir/$pkg_name"*
     done
 
     # Remove the folder since it will otherwise be in the dist output.