betty.plugin.entry_point module¶
Integrates the plugin API with distribution packages.
- final class betty.plugin.entry_point.EntryPointPluginRepository[source]¶
Bases:
LazyPluginRepositoryBase
[_PluginT
],Generic
[_PluginT
]Discover plugins defined as distribution package entry points.
If you are developing a plugin for an existing plugin type that uses entry points, you’ll have to add that plugin to your package metadata. For example, for a plugin type
whose entry point group is
your-plugin-group
with a plugin class
MyPlugin
in the modulemy_package.my_module
and a plugin ID
my-package-plugin
:
[project.entry-points.'your-plugin-group'] 'my-package-plugin' = 'my_package.my_module:MyPlugin'
SETUP = { 'entry_points': { 'your-plugin-group': [ 'my-package-plugin=my_package.my_module:MyPlugin', ], }, } if __name__ == '__main__': setup(**SETUP)