hundreds-father-404
03/10/2020, 9:51 PMpython_library
? For example, do we want plugin authors to be able to add a boolean field type_checked
to every python_library
?
Or, do we expect them to develop a new custom type like typed_python_library
?happy-kitchen-89482
03/10/2020, 10:14 PMhundreds-father-404
03/10/2020, 10:16 PMtype_checked
to python_library
, python_tests
, etc without any changes to core Pants. Core Pants will still behave the same way because it doesn’t ever try to consume the new field, but your custom Plugin now has a first-class way to do consume that new fieldwitty-crayon-22786
03/10/2020, 10:19 PMhundreds-father-404
03/10/2020, 10:20 PMthat was one of the reasons behind having a union of the legal fields... so that it can be extended at runtimeRight. This was the part that I was playing devils advocate if we could avoid. Looks like, no
witty-crayon-22786
03/10/2020, 10:21 PM@Tony
, heh. oops!)hundreds-father-404
03/10/2020, 10:34 PMbut explaining “how do i know which fields are legal for a target in my BUILD file” and “how do i make an additional field legal” is i think easier to explain with unions and fields than it is with subclassing... maybe.I think so too. The main point that Tansy made is how difficult it is with Target Adaptors to call
dir(my_adaptor)
and see what all the fields are. We should ensure there’s an ergonomic way to say ~`my_target.all_valid_fields` for the sake of debugging
I think that’s solvablewitty-crayon-22786
03/10/2020, 10:59 PMdir(my_adaptor)
also renders a bunch of stuff that is not relevant to the target