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
abn
left a comment
There was a problem hiding this comment.
Very minor comment. Otherwise lgtm.
9cc246d to
7d70b01
Compare
|
Kudos, SonarCloud Quality Gate passed!
|








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.