Reset the PY2/PY3 mode along data dependencies #6441
Labels
P2
We'll consider working on this in future. (Assignee optional)
team-Rules-Python
Native rules for Python
type: bug
The part of the build configuration that chooses the python major version can be either PY2, PY3, or unknown. Currently when it's set, it stays that way for all transitive deps. We should reset it across data deps.
The rationale is that you want to enforce (via any
srcs_version
attrs that are present) that the source files and libraries you depend on have the same version as you, but you don't want to require that of other python binaries that you invoke as a separate process.Implementation wise, it's straightforward to do this for the case of a
py_binary
'sdata
attr. It's not so clear how to do it when you have a src file generated by another type of rule, like agenrule
orsh_binary
. Would you have to attach the transition to all sorts of attributes, or is there a way to attach the transition to a particular entry of thepy_binary
'ssrcs
based on the kind of rule that generates it? (Though conditioning on rule type rather than provider is a code smell too.) TBD.The text was updated successfully, but these errors were encountered: