From 283f17e0321b261b6a59f38ffa1da40fadd22be6 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 6fe220671ff973f19c1915b8ec95308123ef4c6d 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)