How can I make the python backend (particularly th...
# plugins
p
How can I make the python backend (particularly the package goal) recognize my plugins' targets as resources that should be included in the wheel/sdist (I'm using the generated setup.py)?
2
b
Make your custom target's source field inherit from
ResourceSourceField
🤮
p
Hmm. That's less complex than I was expecting
b
It's an abuse of the types, but 🤷‍♂️
p
Hmm. That works for one which was a
SingleSourceField
the other one is a
FilesGeneratingSourcesField
and switching that to a
ResourcesGeneratingSourcesField
didn't do it. 😢
b
It should've 😮
p
Do I need to go above v2.12.0rc2?
Maybe I need to convert my plugin to a new style generator.
b
Yeah thats probably a good idea? Upgrades are usually a good idea if you can stomach them
p
Doh. I needed to make the Target subclass
ResourcesGeneratorTarget
instead of just
Target
. Now it's working 🙂
b
oh lol
p
That was an easy migration. 😅 I was scared...
b
There's always a workaround
Pants is surprisingly flexible. Even in ways it wasn't meant to be 🙂
1
p
true