damast.plugins

damast.plugins#

Resolve damast.core.transformations.PipelineElement ‘plugin’ transformers by name, so that e.g. from damast.plugins import MyTransformer works for any transformer discoverable by damast.core.transformations.PluginManager - whether it comes from an installed package’s damast.transformers entry point, or a loose file on DAMAST_PLUGIN_PATH.

Names are resolved lazily on first access (via module __getattr__, see PEP 562): nothing is imported/loaded until a specific name is actually requested, so installed plugin packages that are never referenced here are never imported, and a DAMAST_PLUGIN_PATH set after this module was first imported is still picked up.

If a name is registered by more than one source (two local plugin files, two entry-points, or a local plugin and an entry-point sharing a name), a warning is logged and the first source found wins - local plugin files are checked before entry-points, matching the precedence used by damast.core.transformations.PluginManager.list_plugins().