-
Notifications
You must be signed in to change notification settings - Fork 327
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 get_loader returning None when load_jupyter_server_extension is not found (#1193)Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> #1193
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
Codecov ReportBase: 79.14% // Head: 80.41% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1193 +/- ##
==========================================
+ Coverage 79.14% 80.41% +1.27%
==========================================
Files 68 68
Lines 8117 8119 +2
Branches 1584 1583 -1
==========================================
+ Hits 6424 6529 +105
+ Misses 1280 1175 -105
- Partials 413 415 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Thanks @cmd-ntrf! It looks like one test needs to be updated:
|
get_loader was never raising ExtensionLoadingError because it would fallback to check if load_jupyter_server_extension is present and if it was not, it would raise an AttributeError.
for more information, see https://pre-commit.ci
While fixing the tests, I realized |
The link failure is unrelated but the lint failure is: |
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.
Thank you!
I originally stumbled on this issue while using jupyter-server 1.23.5, so this patch should probably be backported to 1.x. |
@meeseeksdev please backport to 1.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
…rver_extension is not found (#1193) (#1199)Co-authored-by: Steven Silvester <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Backport #1193 to 1.x * bump isort dep * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix check links job name --------- Co-authored-by: Steven Silvester <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Description
The function
extension.utils.get_loader
returnsNone
instead of raising an exception when an extension does not define_load_jupyter_server_extension
norload_jupyter_server_extension
.Reproduce
load_jupyter_server_extension
nor_load_jupyter_server_extension
, for example jupyterlab-nvdashboardThe following exception appears in the log:
Expected behavior
The user should get an AttributeError exception instead of a TypeError, making it clear that
_load_jupyter_server_extension
is missing for the extension being loaded.Context
The problem was introduced by PR #742, when a default value of
None
was configured ifgettattr
could not findload_jupyter_server_extension
. The change was made to satisfy Flake8.Fix implemented in this PR
Remove the default value for
gettatr
in get_loader and set the comment# noqa B009
to keep Flake8 satisfied.