pythonRelaxDepsHook: make distribution name matching case insensitive

Is it PyOpenSSL or pyOpenSSL or pyopenssl? With this change you don't
have to care. Write it as pYoPeNSsL for all I care¹.

Can we do it like that? Yes, we can. Distribution names should be matched
with `re.IGNORECASE` according to the wheel specification².

[1] https://packaging.python.org/en/latest/specifications/core-metadata/#name
[2] Just kidding, please make it look sane.
This commit is contained in:
Martin Weinelt 2023-12-09 19:34:50 +01:00
parent e9d5ba3cfe
commit 48b43e51e5
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759

View File

@ -52,7 +52,7 @@ _pythonRelaxDeps() {
else
for dep in $pythonRelaxDeps; do
sed -i "$metadata_file" -r \
-e "s/(Requires-Dist: $dep\s*(\[[^]]+\])?)[^;]*(;.*)?/\1\3/"
-e "s/(Requires-Dist: $dep\s*(\[[^]]+\])?)[^;]*(;.*)?/\1\3/i"
done
fi
}