-
Notifications
You must be signed in to change notification settings - Fork 732
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
updated use of entry_points according to importlib version >3.6.0 #11417
Conversation
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.
Just one tweak to make it backwards compatible!
kolibri/plugins/utils/__init__.py
Outdated
@@ -481,7 +481,7 @@ def check_plugin_config_file_location(version): | |||
def iterate_plugins(): | |||
# Use to dedupe plugins | |||
plugin_ids = set() | |||
for entry_point in entry_points().get("kolibri.plugins", []): | |||
for entry_point in entry_points().select(group="kolibri.plugins"): |
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.
Sorry, the task was insufficiently clear here - this needs to be done in a way that detects whether the output of entry points has a select
method - in that case select should be used, otherwise the existing get
should be used (this is why you are seeing test failures on earlier versions of Python).
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.
Correct as usual. I apologise my thoughts are very constrained for now when it comes to contributing to big projects please bear with me 😅
Build Artifacts
|
The python unit tests seem like they're failing for a different reason I tested locally with the old version (2.1.1) and the new version (6.8.0) and both worked |
Yes, these test failures are not because of the changes here, but rather because of tests that are not properly mocking calls to a remote server. |
Co-authored-by: Richard Tibbles <[email protected]>
Yes, thank you for pointing it out. Committed the changes :) |
There's one last piece of feedback from the linter:
|
Thanks for your work here @im-NL! |
…arningequality#11417) * updated use of entry_points according to importlib version >3.6.0 * added backwards compatibility for importlib * Update __init__.py Co-authored-by: Richard Tibbles <[email protected]> * use isInstance() for type --------- Co-authored-by: Richard Tibbles <[email protected]>
…arningequality#11417) * updated use of entry_points according to importlib version >3.6.0 * added backwards compatibility for importlib * Update __init__.py Co-authored-by: Richard Tibbles <[email protected]> * use isInstance() for type --------- Co-authored-by: Richard Tibbles <[email protected]>
Summary
#11316 task 5.
Reviewer guidance
--upgrade
flag while installing the libraries. I have not changed the library version inrequirements/base.txt
either. Requesting further guidance on what to do.Testing checklist
PR process
Reviewer checklist
yarn
andpip
)