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

expose PANTS_VERSION and make it string-comparable #18573

Merged
merged 2 commits into from
Mar 28, 2023

Conversation

tgolsson
Copy link
Contributor

Proposed fix for #18528.

Very "dumb" implementation exposing it as a constant to all BUILD files. Unfortunately packaging.version.Version cannot be compared to strings, so I'm shimming it with a local Version class that allows this. I could do this in a more localized manner as this'll affect all uses of PANTS_SEMVER - but it seems like it'll reduce boilerplate in a lot of places. Happy to change based on opinion!

We could also use an explicit comparator, or expose Version as well:

if pants_version_after("2.13"):

or

if PANTS_VERSION >= Version("2.13")

@tgolsson tgolsson marked this pull request as ready for review March 23, 2023 21:34
Copy link
Member

@kaos kaos left a comment

Choose a reason for hiding this comment

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

🎉

@kaos kaos merged commit 527a066 into pantsbuild:main Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants