This commit is contained in:
Denis Bilenko 2025-03-04 10:01:45 +01:00
parent cc5133a5e4
commit ba3062b654
1 changed files with 2 additions and 5 deletions

View File

@ -24,6 +24,8 @@ func ParseWheelFilename(filename string) (*WheelInfo, error) {
// The last three parts are always tags
tagStartIdx := len(parts) - 3
tags := parts[tagStartIdx:]
tags[2] = strings.TrimSuffix(tags[2], ".whl")
// Everything before the tags except the version is the distribution
versionIdx := tagStartIdx - 1
@ -32,11 +34,6 @@ func ParseWheelFilename(filename string) (*WheelInfo, error) {
distribution := strings.Join(parts[:versionIdx], "-")
version := parts[versionIdx]
// Extract tags (remove .whl from the last one)
tags := make([]string, 3)
copy(tags, parts[tagStartIdx:])
tags[2] = strings.TrimSuffix(tags[2], ".whl")
return &WheelInfo{
Distribution: distribution,
Version: version,