-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: modernize importlib #11
base: dev
Are you sure you want to change the base?
Conversation
remove the compat layer for old python versions, use stdlib directly
WalkthroughThe pull request modifies the plugin management system in the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
hivemind_plugin_manager/__init__.py (2)
110-110
: Consider handling potential collisions & performance optimization
- Multiple entry points with the same name under the same group will overwrite each other in the dictionary. To preserve all discovered entry points for each name, consider storing them in a list or handling collisions appropriately.
- The code calls
entry_points(group=plug)
for eachplug
individually. If a plugin system grows large, you might want to optimize by callingmetadata.entry_points()
once and reusing the results to avoid repeated lookups.
110-110
: Ensure thread-safety for_errored
find_plugins._errored
is a mutable class-level list. If multiple threads load plugins concurrently, you may face race conditions or concurrency issues when appending to this list. Consider using a thread-safe data structure or implementing appropriate locking.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
hivemind_plugin_manager/__init__.py
(2 hunks)
🔇 Additional comments (1)
hivemind_plugin_manager/__init__.py (1)
5-5
: Great modernization step!Importing
entry_points
directly from the standard library is a cleaner solution now that older Python versions are no longer supported. This simplifies the codebase by removing the previous fallback mechanism.
this will require python 3.10+ , need to restore backwards compat |
remove the compat layer for old python versions, use stdlib directly
Summary by CodeRabbit