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

[Regression]: InvalidVersion since 22.0 #749

Closed
mexicarne opened this issue Dec 3, 2023 · 2 comments
Closed

[Regression]: InvalidVersion since 22.0 #749

mexicarne opened this issue Dec 3, 2023 · 2 comments

Comments

@mexicarne
Copy link

Something about version parse was broken in 22.0. Here is the code for reproducing the issue:

from packaging.version import parse
print(parse("6.7.8.9-10.el7"))

packaging 21.3 prints:

6.7.8.9-10.el7

while packaging starting with 22.0 raises an exception:

Traceback (most recent call last):
  File "/tmp/pp/test.py", line 5, in <module>
    print(parse("6.7.8.9-10.el7"))
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/pp/lib/python3.11/site-packages/packaging/version.py", line 54, in parse
    return Version(version)
           ^^^^^^^^^^^^^^^^
  File "/tmp/pp/lib/python3.11/site-packages/packaging/version.py", line 200, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: '6.7.8.9-10.el7'
@mexicarne mexicarne changed the title [Regression]: [Regression]: InvalidVersion since 22.0 Dec 3, 2023
@mexicarne
Copy link
Author

mexicarne commented Dec 3, 2023

Ok, I compared the changes and it looks like it's not a regression, but rather planned removal of the LegacyVersional. Is there different way to handle the issue except the sticking to 21.3 in my project?

@pradyunsg
Copy link
Member

Duplicate of #530

Please see the discussion on that issue - it mentions packvers (GitHub seemingly hides it since there's so many back references).

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

No branches or pull requests

2 participants