Skip to content

feat(pypi): implement a new whl selection algorithm #3111

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aignas
Copy link
Collaborator

@aignas aignas commented Jul 21, 2025

This PR only implements the selection algorithm where instead of
selecting all wheels that are compatible with the set of target
platforms, we select a single wheel that is most specialized for a
particular single target platform.

What is more, compared to the existing algorithm it does not assume
a particular list of supported platforms and just fully implements the
spec.

Work towards #2747
Work towards #2759
Work towards #2849

@aignas aignas added the type: pip pip/pypi integration label Jul 21, 2025
@aignas aignas marked this pull request as ready for review July 21, 2025 07:17
@aignas aignas requested review from rickeylev and groodt as code owners July 21, 2025 07:17
@aignas aignas force-pushed the feat.select_whl branch 2 times, most recently from 0ed5c7d to 9792058 Compare August 9, 2025 12:20
@aignas aignas marked this pull request as draft August 9, 2025 13:45
@rickeylev
Copy link
Collaborator

didn't have time to review, but qq: does it still handle if multiple wheels are compatible?

The type of case I have in mind are things that aren't represented by env markers. e.g. cuda version, free threading, etc.

@aignas
Copy link
Collaborator Author

aignas commented Aug 11, 2025

The main idea is that the user can specify the preference for the abi tags and the platform tags. If cuda version or the abi can be expressed by them, then it will work as expected.

On top of this I could implement freethreaded support using this algorithm in #3063, so I am pretty confident that we have the right abstractions in place now, because the configuration of which wheel we should prefer is injected into the extension through the defaults API.

DO NOT MERGE: stacked on bazel-contrib#3110

This PR only implements the selection algorithm where instead of
selecting all wheels that are compatible with the set of target
platforms, we select a single wheel that is most specialized for a
particular *single* target platform.

What is more, compared to the existing algorithm it does not assume
a particular list of supported platforms and just fully implements the
spec.

Work towards bazel-contrib#2747
Work towards bazel-contrib#2759
Work towards bazel-contrib#2849
@aignas aignas marked this pull request as ready for review August 11, 2025 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: pip pip/pypi integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants