Skip to content

fix(pypi): include none and any tags in wheel selection and fix prerelease platform parsing - #4120

Draft
rickeylev wants to merge 4 commits into
bazel-contrib:mainfrom
rickeylev:fix_whl_abi_tags
Draft

fix(pypi): include none and any tags in wheel selection and fix prerelease platform parsing#4120
rickeylev wants to merge 4 commits into
bazel-contrib:mainfrom
rickeylev:fix_whl_abi_tags

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

Pure-Python wheels with the none ABI tag and any platform tag fail
to match target platform configurations when explicit platform tags
omit them. In addition, prerelease Python version strings (such as
3.13.0rc1) cause improper platform key formatting in
requirements_files_by_platform.

To resolve these issues:

  • Add none ABI tags and ensure any platform tags are present in
    platform descriptors within hub builder and extension defaults.
  • Use version.parse in requirements_files_by_platform to format
    prerelease Python version platform prefixes correctly.
  • Support exact platform names without trailing wildcards in
    requirements_files_by_platform.

…form parsing

Add tests reproducing wheel resolution tag handling in default_platforms and
hub_builder, along with prerelease Python version platform prefixing and exact
platform matching in requirements_files_by_platform.
…lease platform parsing

Ensure pure-Python wheels can match target platforms by including 'none'
in default ABI tags and guaranteeing 'none' and 'any' tags in hub
builder platform descriptors. Fix prerelease Python version string
parsing in requirements_files_by_platform to properly format platform keys.
Wrap docstrings and expressions to conform to the 80 column line limit
across pypi Starlark files and analysis tests.
Rename news/whl_abi_tags.fixed.md to news/4120.fixed.md to align with the
created draft PR number.

@aignas aignas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a confusing PR, the select_whl should do none-any wheel selection by default. There should be no need to change all of this. I think the best way would be to change only that part.

EDIT: https://github.com/bazel-contrib/rules_python/blob/main/python/private/pypi/platform.bzl#L31

This is the code that I had in mind writing the comment, it is not the select_whl but the platform construction code. That part will add none and any if they are not present. So I am curious what is happening here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants