-
Notifications
You must be signed in to change notification settings - Fork 251
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
Incorrect comparison of two versions #341
Comments
>>> from packaging import version
>>> a = version.parse('8.0.3-a6754d8441bf')
>>> a
<LegacyVersion('8.0.3-a6754d8441bf')>
>>> b = version.parse('8.0.0')
>>> b
<Version('8.0.0')>
>>> a < b
True The issue here is that you're getting a >>> version.Version('8.0.3-a6754d8441bf')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/pradyunsg/Projects/packaging/packaging/version.py", line 277, in __init__
raise InvalidVersion("Invalid version: '{0}'".format(version))
packaging.version.InvalidVersion: Invalid version: '8.0.3-a6754d8441bf' I'd recommend either:
PS: Your comment seemed to be poorly formatted. I've edited it -- I suggest you read https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/. |
Since we aren't going to be changing the logic I vote for closing this issue. |
Ultimately I think this is a duplicate of #321 as well. |
I found an issue while comparing two versions. Below are two cases, one is correct other is not.
Case-1 (Correct)
Case-2 (Incorrect)
In second example, "8.0.3-a6754d8441bf" is definitely greater than "8.0.0", but library is not reporting this.
Please check.
The text was updated successfully, but these errors were encountered: