Skip to content

Implement wheelname/ — PEP 427 wheel-filename parsing (#18631) - #4

Merged
jonyoder merged 1 commit into
mainfrom
impl-wheelname
Jul 8, 2026
Merged

jonyoder merged 1 commit into
mainfrom
impl-wheelname

Conversation

@jonyoder

@jonyoder jonyoder commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

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 via version.Parse (no _→+ un-escape — real wheels keep the literal +, e.g. torch-2.4.0+cu121), expands the trailing tag component via tags.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_filename accepts leading-digit-then-anything), so applying it would wrongly reject PyPA-valid wheels.

Depends on tags/ (#18632, merged) and version/. Closes #18631.

@jonyoder
jonyoder merged commit e1a9c5a into main Jul 8, 2026
2 checks passed
@jonyoder
jonyoder deleted the impl-wheelname branch July 8, 2026 19:04
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.

1 participant