Allow py3x-none tags in newer than Python 3.x (#7867)

Unlike `cp36-...`, which requires exactly CPython 3.6, `py36-none` is
compatible with all versions starting at Python 3.6.

Note that `py3x-none` should not be used. Instead, use `py3-none` with
`requires-python`.

Fixes #7800
This commit is contained in:
konsti 2024-10-03 19:02:14 +02:00 committed by GitHub
parent 172bff4aec
commit 41fdecf457
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -362,8 +362,9 @@ impl RequiresPython {
let Some(minor) = python_tag
.strip_prefix("cp3")
.or_else(|| python_tag.strip_prefix("pp3"))
.or_else(|| python_tag.strip_prefix("py3"))
else {
// We also return true for bounds such as `py36`, where the Python version
// is a lower bound (redundant with `requires-python`)
return true;
};
let Ok(minor) = minor.parse::<u64>() else {
@ -725,6 +726,7 @@ mod tests {
"cbor2-5.6.4-py3-none-any.whl",
"watchfiles-0.22.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl",
"dearpygui-1.11.1-cp312-cp312-win_amd64.whl",
"solace_pubsubplus-1.8.0-py36-none-manylinux_2_12_x86_64.whl",
];
for wheel_name in wheel_names {
assert!(
@ -754,7 +756,6 @@ mod tests {
"psutil-6.0.0-cp36-cp36m-win32.whl",
"pydantic_core-2.20.1-pp39-pypy39_pp73-win_amd64.whl",
"torch-1.10.0-cp36-none-macosx_10_9_x86_64.whl",
"torch-1.10.0-py36-none-macosx_10_9_x86_64.whl",
];
for wheel_name in wheel_names {
assert!(