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

Python dependency inference supports multiple resolves for first-party targets #14486

Merged
merged 5 commits into from Mar 11, 2022

Conversation

Eric-Arellano
Copy link
Contributor

@Eric-Arellano Eric-Arellano commented Feb 15, 2022

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_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]

…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 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
@Eric-Arellano Eric-Arellano marked this pull request as ready for review March 11, 2022 17:50
Copy link
Sponsor Member

@stuhood stuhood left a 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 Eric-Arellano merged commit 67d30fa into pantsbuild:main Mar 11, 2022
@Eric-Arellano Eric-Arellano deleted the python-dep-inf branch March 11, 2022 23:27
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants