-
Notifications
You must be signed in to change notification settings - Fork 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
Added in_range method to Version class #17658
Conversation
conan/internal/model/version.py
Outdated
if version_range.startswith("[") and version_range.endswith("]"): | ||
version_range = version_range[1:-1] |
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.
No, not necessary to provide 2 different ways to achieve exactly the same.
Lets go first with the simpler, not using [ ]
one.
The [ ]
syntax is for requires
to differentiate regular fixed version from version ranges.
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.
Okay, removed then!
I still think we may support it through the VersionRange constructor but I don't know if that [<version_range>]
syntax is exclusively for requires or if could be used in a different context.
In that case, it may seem strange for users. At least it happens to me when testing!
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.
LGTM
Co-authored-by: Abril Rincón Blanco <[email protected]>
Changelog: Feature: Introducing
in_range
method in Version which allows comparing against version ranges.Docs: conan-io/docs#3996
develop
branch, documenting this one.