I have a custom target type `MyTarget` and a custo...
# plugins
d
I have a custom target type
MyTarget
and a custom
FieldSet
type named
MyFieldSet
. Using
FieldSetsPerTargetRequest
and
FieldSetsPerTarget
to convert a list of
MyTarget
to
MyFieldSet
returns an empty collection, but using
MyFieldSet.is_applicable
and
MyFieldSet.create
works just fine. Is this expected?
c
Have you registered your FieldSet properly? Pants uses union memberships to find your field sets of a particular kind, so you need
UnionRule(Base, Member)
present in the rule graph for it to work. https://www.pantsbuild.org/2.21/docs/writing-plugins/the-rules-api/union-rules-advanced https://github.com/pantsbuild/pants/blob/71749c04c7cf3cd9c22aea3e99fded57d5f41ebc/src/python/pants/engine/internals/graph.py#L1747-L1759
d
That's probably the issue. Thank you!
👍 1