Repository navigation
Implement wheelname/ — PEP 427 wheel-filename parsing (#18631) - #4
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.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.
Implements the
wheelname/package per RFD 0001 Phase 0 (#18631): PEP 427 wheel-filename parsing.What's here
WheelFilename{Name, Version version.Version, Build string, Tags []tags.Tag}.Parse(filename)— strips.whl, 5-or-6 dash-field split, parses the version field as-is viaversion.Parse(no_→+un-escape — real wheels keep the literal+, e.g.torch-2.4.0+cu121), expands the trailing tag component viatags.ParseTag. Distinct wrapped errors for malformed-filename vs version-parse vs tag-parse (ErrInvalidWheelFilename).CompareBuildTags(a, b)— total ordering (absent sorts first; leading-int then string; non-digit-led → numeric 0, never panics).Review notes: build/test/lint green; RoboRev raised two mediums, both adjudicated as not-applicable: (1) PEP 503 name canonicalization is deliberately deferred per the spec (caller canonicalizes); (2) the suggested stricter build-tag charset would be stricter than PyPA's reference (
parse_wheel_filenameaccepts leading-digit-then-anything), so applying it would wrongly reject PyPA-valid wheels.Depends on
tags/(#18632, merged) andversion/. Closes #18631.