On 10/25/23 01:04, Thomas Ward via Mailman-users wrote:
Running into some nasty issues.
I have a structure like this, installed as a package in the workspace once installed by pip in the venv:
mailman_customizations/ __init__.py hooks.py <-- plugin definition in here as MailmanCustomizations for class name handlers/ __init__.py handlers.py <-- custom handler in here pipelines/ __init__.py pipelines.py <-- custom pipelines which implement the handlers here.
However, whenever I specify this in config with this clause:
[plugin.MailmanCustomizations] class: mailman_customizations.hooks.MailmanCustomizations enabled: no
Change this to
[plugin.mailman_customizations] class: mailman_customizations.hooks.MailmanCustomizations enabled: yes
And I think it should work.
This isn't documented properly (needs an issue : -), but the way plugin system works is that for each component, it will try to import various components from "from <plugin_name>.<component>" and if the name isn't the name of the plugin package, then obvously the import fails.
The "ModuleNotFound" error was coming from the
[plugin.MailmanCustomizations]
line and not from class: mailman_customizations.hooks.MailmanCustomizations
which I think was
causing confusion.
I also _just_ remembered that i had created an example plugin, which can hopefully serve as a basis for plugins.
https://gitlab.com/mailman/example-mailman-plugin/-/tree/master
-- thanks, Abhilash Raj (maxking)