-
Notifications
You must be signed in to change notification settings - Fork 310
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
extensions: allow extensions in namespace packages #523
extensions: allow extensions in namespace packages #523
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
f866135
to
b3f101a
Compare
Codecov Report
@@ Coverage Diff @@
## master #523 +/- ##
==========================================
+ Coverage 76.30% 76.34% +0.04%
==========================================
Files 110 110
Lines 9814 9835 +21
Branches 1067 1069 +2
==========================================
+ Hits 7489 7509 +20
- Misses 1944 1946 +2
+ Partials 381 380 -1
Continue to review full report at Codecov.
|
Thanks, @oliver-sanders. This is awesome! This was briefly mentioned in the Jupyter Server meeting today. The "committers" around Jupyter Server have been a little low on bandwidth the past couple of weeks, so review has been a little slower than normal. You should start getting some review over the next week. 😎 |
b3f101a
to
fd55fe7
Compare
Rebased and switched to a nicer way of detecting namespace packages by using the |
Thanks, @oliver-sanders. 🚀 I think this change is good as-is, even though we duplicate some importing in the jupyter_server/jupyter_server/extension/manager.py Lines 50 to 55 in f29bb11
In the long term, I believe there is some work to do around extension distribution/packaging/discovery. The |
fd55fe7
to
a43b90c
Compare
a43b90c
to
4a82af5
Compare
|
[update] This PR is hanging on:
|
Hi @oliver-sanders, can you please see yesterday's meeting notes about this topic? Thanks again for your patience on this one! |
@blink1073 sure, no problem, I'm happy to implement this however is desired.
It's not ideal, but I don't think it's a big issue because this implementation is brittle (i.e. will fail if the internals change). So if we ran the CI test battery against the latest dev version of Python (currently
It would appear there is no especially nice solution to this problem so it comes down to picking a nasty method and ensuring that it is well tested. I don't think implementing two nasty methods would be better than implementing one. The failure of the first method (which should never happen) would be silently suppressed which is nasty. The second method (which would never be run unless the first fails which it shouldn't) then becomes dead code and a potential bug in waiting. |
Ok, I’m convinced. 😄 Let’s stick with option 1 (as implemented). We can add Python latest dev version (3.10.x) to our Github actions in a separate PR, perhaps #541. @oliver-sanders, this is great stuff. Thank you for many of your recent contributions. If you’re ever available to make it to our weekly Jupyter Server meetings, we’d love to meet you! |
Cheers, added 3.10-dev in #541, Linux/MacOs tests pass, Windows fails to |
This allows Jupyter extensions to be developed in Python namespace packages.
Related to: #222 (comment)
See PEP420.
Currently Jupyter Server extensions developed in Python namespace packages fall over with some nasty traceback:
Here's an example extension developed in a Python namespace package: https://github.com/oliver-sanders/jupyter-server-namespace-extension-test