Skip to content

Commit abdf560

Browse files
dwsrickeylev
andauthored
fix(rules): copy_propagating_kwargs() now also copies target_compatible_with (#2788)
This routine already copies `compatible_with`, which is little used, but does not copy `target_compatible_with`, which is broadly used. This seems like an oversight. I noticed this discrepancy when working on a system that assumes that any `tags` or `target_compatible_with` parameters supplied to a macro will propagate to all rules created by that macro. In rules_python, this already works for `tags`, but not for `target_compatible_with`. It would be great to get this accepted upstream, so that I can stop patching rules_python. --------- Co-authored-by: Richard Levasseur <richardlev@gmail.com>
1 parent 183d297 commit abdf560

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ Unreleased changes template.
100100
* (toolchains) Ensure temporary `.pyc` and `.pyo` files are also excluded from the interpreters repository files.
101101
* (pypi) Run interpreter version call in isolated mode, to ensure it's not affected by userland environment variables, such as `PYTHONPATH`.
102102
* (packaging) An empty `requires_file` is treated as if it were omitted, resulting in a valid `METADATA` file.
103+
* (rules) py_wheel and sphinxdocs rules now propagate `target_compatible_with` to all targets they create.
104+
[PR #2788](https://github.com/bazel-contrib/rules_python/pull/2788).
103105

104106
{#v0-0-0-added}
105107
### Added

python/private/util.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def copy_propagating_kwargs(from_kwargs, into_kwargs = None):
4242
into_kwargs = {}
4343

4444
# Include tags because people generally expect tags to propagate.
45-
for attr in ("testonly", "tags", "compatible_with", "restricted_to"):
45+
for attr in ("testonly", "tags", "compatible_with", "restricted_to", "target_compatible_with"):
4646
if attr in from_kwargs and attr not in into_kwargs:
4747
into_kwargs[attr] = from_kwargs[attr]
4848
return into_kwargs

0 commit comments

Comments
 (0)