-
Notifications
You must be signed in to change notification settings - Fork 701
Better version comparison #1993
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
Conversation
|
Please use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@papr why do we use packaging.version.parse instead of packaging.version.Version?
It feels like the special case with LegacyVersions being sorted strictly below Version could potentially cause headaches. Are there any versions in our ecosystem that are not PEP440 compatible?
pfaion
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@romanroibu I'm honestly not sure, if SemanticVersion is a better name here.
This strongly suggests versioning according to the Semantic Versioning scheme, but this is specifically not the case here as packaging.version.parse() will strictly order non-PEP440-compliant < PEP440-compliant, which is not the case for "semantic versions".
|
Specifically, Semantic Versioning is not fully compatible with PEP440: https://www.python.org/dev/peps/pep-0440/#semantic-versioning |
|
I also considered |
|
I'd be open to calling it |
|
I agree nothing is optimal here. I'm still angry at the Python folks for making PEP440 essentially a subset of SemVer, thereby creating so many problems. At least we are not creating our own versioning scheme again but rely on the result of packaging's For this reason, I also don't like For simplicity, I'd probably favor |
|
It's sad that |
|
How about |
|
I'd be fine with I mean either you don't think about it at all if you come across it and assume PEP440 (which will just work fine), or you are aware of the hassle in Python and look at where |
|
This PR requires having the If you got this error, please update |
This PR ensures all comparisons of version numbers are done with parsed version strings, and using the best practices.