Skip to content

[1.2] don't use normalize_version()#6550

Merged
neersighted merged 1 commit into1.2from
backport-6476-to-1.2
Sep 17, 2022
Merged

[1.2] don't use normalize_version()#6550
neersighted merged 1 commit into1.2from
backport-6476-to-1.2

Conversation

@poetry-bot
Copy link
Copy Markdown

@poetry-bot poetry-bot Bot commented Sep 17, 2022

Backport a14a93d from #6476.

…#6476)

When you already have a `Version` in hand,
`normalize_version(version.text)` is a very roundabout way of calling
`version.to_string()`: it re-parses the version text to give you the
same `Version` you already had and then calls `to_string()` on that.

https://github.com/python-poetry/poetry-core/blob/37cee90a5dd4c7ee2c5ee836216ba813242b3ade/src/poetry/core/utils/helpers.py#L27-L28

Then calling `escape_version()` on such a version is actually
counter-productive, per #6466.

Similar changes can and should be made over in poetry-core, but it
should be safe to merge this before that is done.

(cherry picked from commit a14a93d)
@neersighted neersighted enabled auto-merge (rebase) September 17, 2022 18:00
@neersighted neersighted merged commit 024c4a5 into 1.2 Sep 17, 2022
@neersighted neersighted deleted the backport-6476-to-1.2 branch September 17, 2022 18:04
@github-actions
Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants