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

parse_wheel_name and parse_sdist_filename now raises InvalidVersion #660

Closed
uranusjr opened this issue Jan 13, 2023 · 1 comment · Fixed by #721
Closed

parse_wheel_name and parse_sdist_filename now raises InvalidVersion #660

uranusjr opened this issue Jan 13, 2023 · 1 comment · Fixed by #721

Comments

@uranusjr
Copy link
Member

uranusjr commented Jan 13, 2023

Since LegacyVersion is dropped, the dist filename parsing functions can now raise InvalidVersion. This is however not mentioned in the docs. I can see two solutions:

  • Mention this in the docs.
  • Catch InvalidVersion and raise InvalidWheelFilename or InvalidSdistFilename instead. Having an invalid version in the filename arguably qualifies as having an invalid filename? (Considering the functions don’t raise e.g. InvalidProjectName when the project part is not a valid name.)

cc @zooba, xref uranusjr/simpleindex#10

@pradyunsg
Copy link
Member

Catch InvalidVersion and raise InvalidWheelFilename or InvalidSdistFilename instead. Having an invalid version in the filename arguably qualifies as having an invalid filename? (Considering the functions don’t raise e.g. InvalidProjectName when the project part is not a valid name.)

Let's do this, yea.

@pradyunsg pradyunsg changed the title parse_wheel_name and parse_sdist_filename now raises InvalidVersion parse_wheel_name and parse_sdist_filename now raises InvalidVersion Feb 13, 2023
@pradyunsg pradyunsg changed the title parse_wheel_name and parse_sdist_filename now raises InvalidVersion parse_wheel_name and parse_sdist_filename now raises InvalidVersion Feb 13, 2023
SpecLad added a commit to SpecLad/packaging that referenced this issue Sep 7, 2023
pradyunsg pushed a commit to SpecLad/packaging that referenced this issue Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants