Implement env/env_inherit semantics for py_venv_binary/py_venv_test #616
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.
These attributes were implemented for
py_binary
andpy_test
,1 but not their venv-based equivalents, where they were present, but not wired-up to anything. The semantics of these properties are established for native rules through the Build Encyclopedia's "Common Definitions";23 Starlark rules aren't required to follow this, but it is usually useful and least surprising for them to do so.Changes are visible to end-users: yes
(*) Technically, this changes the semantics of user-controlled attributes of public symbols. However, these attributes were non-functional previously; users were getting the same behaviour as not setting these properties. This change makes these properties useful in satisfying the clear intent the user communicates when setting these attributes.
feat(venv): implement env/env_inherit semantics for py_venv_binary/py_venv_test
Test plan
Footnotes
https://github.com/aspect-build/rules_py/blob/c29d3d8911136dab2d01469a99a53b7e6cfa2b20/py/private/py_binary.bzl#L131 ↩
https://bazel.build/reference/be/common-definitions#test.env ↩
https://bazel.build/reference/be/common-definitions#test.env_inherit ↩