-
-
Notifications
You must be signed in to change notification settings - Fork 779
Upgrade pants from 2.15 to 2.16.0a0 #5932
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
Merged
Merged
Conversation
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
96d23e5 to
3be21fe
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This was referenced Mar 14, 2023
3be21fe to
52086e9
Compare
This comment was marked as resolved.
This comment was marked as resolved.
rush-skills
approved these changes
Mar 15, 2023
Also drop the temp stevedore_namespace func in pants-plugins/macros
env() was added in 2.16
Also add some '# pants: no-infer-dep' comments on strings to avoid potential false positive deps. I noticed at least one false positive with the stevedore namespaces, so I marked all of those strings.
…ve some BUILD metadata
befeaac to
340a120
Compare
amanda11
approved these changes
Mar 17, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
pantsbuild
size/XL
PR that changes 500-999 lines. Consider splitting work into several ones that easier to review.
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.
Background
This is another part of introducing pants, as discussed in various TSC meetings.
Related PRs can be found in:
Overview of this PR
I recommend stepping through the commits to review this PR. Ignore the "fix typo in st2actions/BUILD" commit, as it is part of #5931, which should be merged first.
This updates to pants to
2.16.0a0which only requires:Unlike the upgrade to 2.15 (#5899), we do not need to update our pants-plugins because they don't use anything that changed (see the Plugin upgrade guide).
Upgrading to 2.16 gives us access to some new features and allows us to delete some of our BUILD metadata:
module_mappingdefinitions were upstreamed, so we no longer need to define them locally.pants.backend.experimental.python.framework.stevedore: The plugin I wrote to tell pants how to manage including runners and other stevedore plugins when the tests need them to be available.env("ST2_PUBLISH_REPO")inpants-plugins/macros.py(added in pants: Addst2_*_python_distribution()macros topants-plugins/macros.py#5901) so that we can use theST2_PUBLISH_REPOenv var to determine where we want to publish the wheels (eg to use@testpypiinstead of@pypi).python-dump-source-analysisgoal makes debugging dependency inference much easier. And, it was the final piece we needed to be able to use[python-infer].string_importsso that pants can infer python dependencies from strings, not just the actual imports. That made it possible to delete some of our BUILD metadata.[python-infer].ambiguity_resolution = "by_source_root"option made dependency inference a little smarter. This way, when something importstests.base, it will use the closesttests.baseinstead of complaining about all of the different directories that define that. That made it possible to delete even more of the BUILD metadata, as those deps are no longer ambiguous.diffoutput when usinggenerate-lockfiles(does not display when our git deps change, but it helps for everything else). This is what it looked like when I regenerated thest2lockfile (see the screenshots in Print diff report when generating new lockfiles. pantsbuild/pants#17347 as well):In a follow-up I will add support for:
pants.backend.experimental.visibilitywhich gives us access to__dependency_rules__and__dependents_rules__. This is a much more intelligent way to avoid circular imports (eg st2common does not import st2api) than the regex-lint based approach. This needs a few more bug fixes before we can use it.__dependencies_rules__and__dependents_rules__Pants documentation
python-dump-source-analysisgoalpython-infersubsystemstring_importsoptionambiguity_resolutionoption