Skip to content
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

Fix parsing of wheel version numbers #183

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

diazona
Copy link
Owner

@diazona diazona commented Sep 14, 2024

In our test support code we have a function that parses sdist and wheel filenames, but it turns out that function had a bug that caused it to miss the number in the prerelease component of a wheel filename. To fix that, I replaced the wheel filename parser with the wheel-filename package, and reduced our custom code to just parsing sdist filenames, which is much easier. I also added tests of the new parsing function.

I discovered this while adding the extrainterpreters package as a distribution package test case.

While adding the extrainterpreters package as a test case, I discovered
a bug where the regex we use for matching sdist and wheel filenames is
not correctly parsing certain prerelease versions. In this commit I'm
fixing that by outsourcing the parsing of wheel filenames to the package
wheel_filename, and writing a more accurate regex to parse sdist
filenames. I've added a tuple representing the components of an sdist
filename to parallel the structure that wheel_filename uses.

The new dependency is only needed in testing so it's relatively low cost
to add it.
This commit adds some tests of the sdist/wheel filename matching
function added in the previous commit. It's not terribly valuable to
have a lot of tests of wheel filename matching because it's being
handled by a separate package which (presumably) has its own tests,
but it'll be good to have tests regardless in case we ever switch to
a different implementation, and it costs us very little to add them.
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