Merge pull request #296117 from SuperSandro2000/python-relax-deps-hook-no-pname

pythonRelaxDepsHook: don't rely on pname as that could be normalized already
This commit is contained in:
Martin Weinelt 2024-03-17 03:07:48 +01:00 committed by GitHub
commit b54e2bc7fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 5 deletions

View File

@ -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.