hundreds-father-404
08/19/2020, 11:59 PMclass CustomPythonBinaryDependencies(Dependencies):
exclude_transitively = ["bad_target"]
class CustomPythonBinary(Target):
alias = "custom_python_binary"
core_fields = (*(FrozenOrderedSet(PythonBinary.core_fields) - {Dependencies}), CustomPythonBinaryDependencies)
Then, anytime the BUILD file uses custom_python_binary
, those hardcoded excluded targets would be ignored. Other than that, it behaves identically to a normal python_binary
target.
But that’s really really special-cased, and not at all obvious where that would fit into the docs. It also might not be generic enough. It requires you to put a list of hardcoded addresses in a target definition, rather than being able to tweak in a decentralized way in a BUILD file.