Add semver ignore-condition range code into python version#10844
Merged
Add semver ignore-condition range code into python version#10844
Conversation
amazimbe
commented
Oct 25, 2024
| "dev0" | ||
| end | ||
|
|
||
| sig { override.returns(T::Array[String]) } |
Contributor
Author
There was a problem hiding this comment.
Just overriding these from common/verison.rb
amazimbe
commented
Oct 25, 2024
| .map { |req_string| req_string.match(VERSION_REGEX) } | ||
| .select { |version| Gem::Version.correct?(version) } | ||
| .max_by { |version| Gem::Version.new(version) } | ||
| .select { |version| Python::Version.correct?(version) } |
Contributor
Author
There was a problem hiding this comment.
We need to use th correct method that is ecosystem specific and not the one from gem version that checks against a completely different regex.
amazimbe
commented
Oct 25, 2024
| describe ".new" do | ||
| subject(:version) { described_class.new(version_string) } | ||
|
|
||
| before do |
Contributor
Author
There was a problem hiding this comment.
I didn't cleanup fully previously, but this is no longer needed.
randhircs
approved these changes
Oct 25, 2024
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue: #10845
What are you trying to accomplish?
Backport this fix from maven into python.
Though, currently, ignore conditions like ["version-update:semver-major", "version-update:semver-minor"] are working exactly like in the previous python version implementation, this is not strictly correct. Based on (the python version specification)[https://packaging.python.org/en/latest/specifications/version-specifiers], dev0 is the suffix with the lowest precedence so that's what we need to use in the ranges. Otherwise, we could end up in a situation where a dependency with version 2.9 and settings that say ignore majors could upgrade to 3.dev0 as 3.dev0 < 3.a.
How will you know you've accomplished your goal?
Checklist