From 3937cedb29c215cfc720cf4e108f8e93a32a3184 Mon Sep 17 00:00:00 2001 From: somsomin <97494468+somsomin@users.noreply.github.com> Date: Thu, 24 Apr 2025 00:28:49 -0400 Subject: [PATCH 1/2] Add doc warning for risky plugin names (related to #1694) --- docs/plugindevelopment.rst | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 docs/plugindevelopment.rst 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. From c5f285a3721770ea9c8c5436442a546de0f18d28 Mon Sep 17 00:00:00 2001 From: somsomin <97494468+somsomin@users.noreply.github.com> Date: Fri, 25 Apr 2025 22:13:39 -0400 Subject: [PATCH 2/2] Your commit message --- errbot/plugin_manager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)