don't use normalize_version()#6476
Merged
neersighted merged 2 commits intopython-poetry:masterfrom Sep 17, 2022
Merged
Conversation
475f5f4 to
ab767a4
Compare
it's just a complicated way of calling version.to_string()
version.to_string() already gave an escaped version
Contributor
Author
|
test failure is not the usual 3.11 one, but it still looks like noise |
neersighted
approved these changes
Sep 17, 2022
Member
|
Requires a backport to avoid deprecation warnings after merging python-poetry/poetry-core#469 |
poetry-bot bot
pushed a commit
that referenced
this pull request
Sep 17, 2022
…#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
pushed a commit
that referenced
this pull request
Sep 17, 2022
…#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)
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When you already have a
Versionin hand,normalize_version(version.text)is a very roundabout way of callingversion.to_string(): it re-parses the version text to give you the sameVersionyou already had and then callsto_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.