-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add semver ignore-condition range code into python version #10844
Conversation
@@ -214,6 +214,38 @@ def lowest_prerelease_suffix | |||
"dev0" | |||
end | |||
|
|||
sig { override.returns(T::Array[String]) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just overriding these from common/verison.rb
@@ -234,8 +234,8 @@ def updated_version_req_lower_bound | |||
.reject { |req_string| req_string.start_with?("<") } | |||
.select { |req_string| req_string.match?(VERSION_REGEX) } | |||
.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) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -77,10 +77,6 @@ | |||
describe ".new" do | |||
subject(:version) { described_class.new(version_string) } | |||
|
|||
before do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't cleanup fully previously, but this is no longer needed.
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