-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
Python dependency inference supports multiple resolves for first-party targets #14486
Merged
Conversation
This file contains 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
…t-party targets # Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
Eric-Arellano
force-pushed
the
python-dep-inf
branch
from
March 4, 2022 23:27
f2265ac
to
6635d57
Compare
Eric-Arellano
changed the title
[wip] Python dependency inference supports multiple resolves for first-party targets
Python dependency inference supports multiple resolves for first-party targets
Mar 11, 2022
tdyas
approved these changes
Mar 11, 2022
src/python/pants/backend/codegen/protobuf/python/python_protobuf_module_mapper.py
Outdated
Show resolved
Hide resolved
src/python/pants/backend/codegen/protobuf/python/python_protobuf_module_mapper.py
Outdated
Show resolved
Hide resolved
src/python/pants/backend/codegen/thrift/apache/python/python_thrift_module_mapper.py
Outdated
Show resolved
Hide resolved
stuhood
approved these changes
Mar 11, 2022
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.
Thanks!
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
Eric-Arellano
added a commit
to Eric-Arellano/pants
that referenced
this pull request
Mar 11, 2022
…y targets (pantsbuild#14486) If you have >1 target for the same first-party module, that is now okay with dependency inference as long as they each have a distinct resolve. This is key for `parametrize()` to work properly: ```python python_source( name="foo", source="foo.py", resolve=parametrize("a", "b"), ) ``` Note how codegen targets should have a `python_resolve` field now, per pantsbuild#14693. That allows support for multiple runtime libraries like `thrift` and `protobuf` dependencies. Now Python will only infer deps on codegen targets using the correct resolve for its runtime library. [ci skip-rust] [ci skip-build-wheels]
Eric-Arellano
added a commit
that referenced
this pull request
Mar 12, 2022
…y targets (Cherry-pick of #14486) (#14765) If you have >1 target for the same first-party module, that is now okay with dependency inference as long as they each have a distinct resolve. This is key for `parametrize()` to work properly: ```python python_source( name="foo", source="foo.py", resolve=parametrize("a", "b"), ) ``` Note how codegen targets should have a `python_resolve` field now, per #14693. That allows support for multiple runtime libraries like `thrift` and `protobuf` dependencies. Now Python will only infer deps on codegen targets using the correct resolve for its runtime library. [ci skip-rust] [ci skip-build-wheels]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
If you have >1 target for the same first-party module, that is now okay with dependency inference as long as they each have a distinct resolve. This is key for
parametrize()
to work properly:Note how codegen targets should have a
python_resolve
field now, per #14693. That allows support for multiple runtime libraries likethrift
andprotobuf
dependencies. Now Python will only infer deps on codegen targets using the correct resolve for its runtime library.[ci skip-rust]
[ci skip-build-wheels]