Skip to content
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

Merged
merged 4 commits into from
Jan 30, 2025

Conversation

perseoGI
Copy link
Contributor

@perseoGI perseoGI commented Jan 29, 2025

Changelog: Feature: Introducing in_range method in Version which allows comparing against version ranges.
Docs: conan-io/docs#3996

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

@perseoGI perseoGI requested a review from memsharded January 29, 2025 13:03
@memsharded memsharded self-assigned this Jan 29, 2025
@perseoGI perseoGI changed the title Added version_in method to Version class Added in_range method to Version class Jan 29, 2025
Comment on lines 202 to 203
if version_range.startswith("[") and version_range.endswith("]"):
version_range = version_range[1:-1]
Copy link
Member

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.

Copy link
Contributor Author

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!

@memsharded memsharded requested a review from jcar87 January 29, 2025 16:48
Copy link
Contributor

@jcar87 jcar87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AbrilRBS AbrilRBS added this to the 2.13.0 milestone Jan 29, 2025
@memsharded memsharded marked this pull request as ready for review January 29, 2025 17:26
Co-authored-by: Abril Rincón Blanco <[email protected]>
@memsharded memsharded merged commit dbcd6fe into conan-io:develop2 Jan 30, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants