diff --git a/docs/plugindevelopment.rst b/docs/plugindevelopment.rst new file mode 100644 index 000000000..65ceb0184 --- /dev/null +++ b/docs/plugindevelopment.rst @@ -0,0 +1,3 @@ +.. warning:: + + Avoid naming your plugin directory or module lib, test, or utils. These names are common in Python or used internally by some backends (e.g., Slack). Using them may cause your plugin to fail to load due to module resolution conflicts. Prefer unique, descriptive names such as lib_tools or myplugin_utils. diff --git a/errbot/plugin_manager.py b/errbot/plugin_manager.py index fda47bc02..d4dc8f255 100644 --- a/errbot/plugin_manager.py +++ b/errbot/plugin_manager.py @@ -275,7 +275,11 @@ def _load_plugins_generic( feedback: Dict[Path, str], ): self._install_potential_package_dependencies(path, feedback) - plugfiles = path.glob("**/*." + extension) + + plugfiles = [] + for ext in ("plug", "plugin"): + plugfiles.extend(path.glob(f"**/*.{ext}")) + for plugfile in plugfiles: try: plugin_info = PluginInfo.load(plugfile)