damast.plugins

damast.plugins#

Resolve damast.core.transformations.PipelineElement ‘plugin’ transformers per plugin package, so that e.g. from damast.plugins.acme import MyTransformer works for any transformer discoverable by damast.core.transformations.PluginManager - whether it comes from an installed package’s damast.transformers entry point (for a single class, or for a whole module), or a local plugin directory on DAMAST_PLUGIN_PATH.

The plugin package is the top-level package of the module defining the transformer (see damast.core.transformations.PluginManager.plugin_package()): acme for an installed acme.transformers:MyTransformer, or name for a local directory registered as name=path. Scoping names by package means two plugins can provide a transformer of the same name without clashing.

Names are resolved lazily on first access: damast.plugins.<package> is created on import without importing anything, and a transformer is only looked up once it is actually requested - a module entry-point is only imported if nothing else in that package provides the name.