Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix priority of ABI tags #2489

Merged
merged 4 commits into from
Mar 18, 2024
Merged

Fix priority of ABI tags #2489

merged 4 commits into from
Mar 18, 2024

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Mar 16, 2024

Brings us in-line with Python's behavior:

  1. Prioritize none tags after all of the relevant platform tags
  2. Omit none tags for CPython versions less than the current version
  3. Prioritize major (i.e. py3-none) version tags over minor (i.e. py3x-none) version tags less than the current version
  4. Add a none-any tag for the current CPython version

Test plan

Tested on my Linux machine with a script to emit tags at the desired glibc version:

from packaging import tags
import re

exclude = re.compile("_(21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39)_")

for tag in tags.sys_tags():
    if exclude.search(str(tag)):
        continue
    print(tag)

Then performed a diff with the snapshot in tags.rs

@zanieb zanieb force-pushed the zb/platform-tags-fix branch 2 times, most recently from ef2c792 to ec7d8cc Compare March 16, 2024 17:08
@zanieb zanieb force-pushed the zb/platform-tags-fix branch from ec7d8cc to b325acd Compare March 16, 2024 17:34
@zanieb zanieb added the bug Something isn't working label Mar 16, 2024
@zanieb
Copy link
Member Author

zanieb commented Mar 16, 2024

I'd like to do some additional verification that changes are correct on other platforms too e.g. macOS

@zanieb zanieb requested review from charliermarsh and konstin March 16, 2024 17:49
@zanieb zanieb force-pushed the zb/platform-tags-fix branch from b325acd to 313dd0c Compare March 16, 2024 22:21
Base automatically changed from zb/platform-tags-fix to main March 16, 2024 22:33
zanieb added a commit that referenced this pull request Mar 16, 2024
zanieb added 4 commits March 16, 2024 18:03
# Conflicts:
#	crates/platform-tags/src/tags.rs

# Conflicts:
#	crates/platform-tags/src/tags.rs
# Conflicts:
#	crates/platform-tags/src/tags.rs

# Conflicts:
#	crates/platform-tags/src/tags.rs
…t version

# Conflicts:
#	crates/platform-tags/src/tags.rs

# Conflicts:
#	crates/platform-tags/src/tags.rs
# Conflicts:
#	crates/platform-tags/src/tags.rs
@zanieb
Copy link
Member Author

zanieb commented Mar 17, 2024

I've confirmed this is correct on macOS

@zanieb zanieb merged commit b71973c into main Mar 18, 2024
30 checks passed
@zanieb zanieb deleted the zb/abi-tags-fix branch March 18, 2024 14:21
zanieb added a commit that referenced this pull request Mar 18, 2024
Following #2489 this is the last remaining difference from Python 3.12's
packaging module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants