-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
don't use normalize_version() #6476
Merged
neersighted
merged 2 commits into
python-poetry:master
from
dimbleby:no-normalize-version
Sep 17, 2022
Merged
don't use normalize_version() #6476
neersighted
merged 2 commits into
python-poetry:master
from
dimbleby:no-normalize-version
Sep 17, 2022
Conversation
This file contains 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
dimbleby
force-pushed
the
no-normalize-version
branch
from
September 11, 2022 16:20
475f5f4
to
ab767a4
Compare
it's just a complicated way of calling version.to_string()
version.to_string() already gave an escaped version
test failure is not the usual 3.11 one, but it still looks like noise |
neersighted
added
kind/refactor
Pulls that refactor, or clean-up code
area/uploader
Related to the repository uploader
impact/changelog
Requires a changelog entry
labels
Sep 17, 2022
neersighted
approved these changes
Sep 17, 2022
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area/uploader
Related to the repository uploader
impact/backport
Requires backport to stable branch
impact/changelog
Requires a changelog entry
kind/refactor
Pulls that refactor, or clean-up code
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
Version
in hand,normalize_version(version.text)
is a very roundabout way of callingversion.to_string()
: it re-parses the version text to give you the sameVersion
you 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.