[WheelVariant] variants.json
support prototype
#2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
2DA1
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Quite hacky, but I think that's the simplest way of injecting it. Basically:
need_variants
andvariants_json
argument that are passed transitively to `get_supported():variants.json
, we use the fast path to generate supported tags from specified variants.variants.json
and none of the wheels include a variant hash, we don't include variants in supported tags, so we don't introduce slowdown for non-variant packages.variants.json
and at least one includes a variant hash, we use the previous logic of generating all variants.variants.json
file first, so that we have it processed before processing the first wheel. Since the code apparently processes the index multiple times, I've added caching to avoid refetching it.variants.json
is wrapped into thinVariantJson
class that adds a__hash__()
method, so that it can trivially work with@cache
.Requires wheelnext/variantlib#2