-
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
version: fix normalize_version() according to PEP440 #344
Conversation
de218b4
to
8382da1
Compare
My 2c, I would say we return PEP440 compliant string when short is true rather than introducing another property. I'd like to avoid adding more cognitive load here and standardise one way. |
That was my first thought, too. But it seemed a bit confusing later. It would be a bit weird especially for I'm not sure whether the two different variants (short and long) are useful at all. I tend to say that Further, I'm not happy with |
8382da1
to
9cc246d
Compare
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.
Very minor comment. Otherwise lgtm.
9cc246d
to
7d70b01
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Resolves: python-poetry/poetry#5534
normalize_version()
seems quite buggy supposing that it should do normalizations according to PEP 440. This PR fixes this method and adds tests derived from PEP 440 examples.Since I wasn't sure if the
to_string(short=False)
method has some other usage (seems to be more semver than PEP440), I introduced a new propertynorm_string
.