Skip to content

Commit f47ee12

Browse files
committed
get rid of env_inherit
1 parent 2c683c4 commit f47ee12

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

python/private/attributes.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,11 @@ environment when the test is executed by bazel test.
487487
"@platforms//os:watchos",
488488
],
489489
),
490+
"_windows_constraints": lambda: attrb.LabelList(
491+
default = [
492+
"@platforms//os:windows",
493+
],
494+
),
490495
})
491496

492497
# Attributes specific to Python test-equivalent executable rules. Such rules may

python/private/common.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,8 @@ def maybe_add_test_execution_info(providers, ctx):
490490
# TODO(b/176993122): Remove when bazel automatically knows to run on darwin.
491491
if target_platform_has_any_constraint(ctx, ctx.attr._apple_constraints):
492492
providers.append(_testing.ExecutionInfo({"requires-darwin": ""}))
493+
if target_platform_has_any_constraint(ctx, ctx.attr._windows_constraints):
494+
providers.append(RunEnvironmentInfo(inherited_environment = ["PATH"]))
493495

494496
_BOOL_TYPE = type(True)
495497

tests/integration/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ rules_python_integration_test(
9696
env = {
9797
"RULES_PYTHON_BZLMOD_DEBUG": "1",
9898
},
99-
env_inherit = ["PATH"],
10099
)
101100

102101
rules_python_integration_test(

0 commit comments

Comments
 (0)