jolly-midnight-72759
05/30/2020, 2:12 PMpants-plugins/src/python
I create a module called awesome_plugin
. This module would need to have awesome_plugin.register
defined.
Is there a pattern that takes advantage of “auto discovery” of plugins that are in the monorepo as opposed to being loaded via pip via an external repository?hundreds-father-404
06/01/2020, 8:43 PMsrc/python
. pants-plugins/awesome_plugin/register.py
works too. Plugins must be written in Python, so src/python
is redundantjolly-midnight-72759
06/01/2020, 9:20 PMjolly-midnight-72759
06/01/2020, 9:27 PMpants-plugin universe
? For instance if I create a databricks target for my repo and want to share the plugin, seems the best way is to publish it to pypi.
I can't articulate it fully, but it seems like there should be a way to reduce friction to do two things at once with the right pattern (i.e. share the plugin and use it locally).jolly-midnight-72759
06/01/2020, 9:27 PMhundreds-father-404
06/01/2020, 9:32 PMFor instance if I create a databricks target for my repo and want to share the plugin, seems the best way is to publish it to pypi.Yes, that’s the plan. Like how people share Flake8 plugins by releasing a library like
flake8-2020
. Then, users add your plugin to the plugins
option in their pants.toml
.
I’m not sure how well it works yet for a 3rd party plugin author, though, tbh. Pants releases a couple plugins like pantsbuild.pants.contrib.node
, but I don’t think people have done 3rd party plugins in a while.
That’s something we want to change, in part by making V2 plugins much easier to write than V1 plugins and making them more powerful. We’d love to get to a place like Flake8, where you have dozens of plugins you could choose from.