ipywidgets
ipywidgets copied to clipboard
POC: Creation of a Comm Python package
Related discussions:
- https://github.com/jupyter-xeus/xeus-python/issues/342
- https://github.com/jupyter-widgets/ipywidgets/issues/3514
Currently working on a Python comm package on https://github.com/martinRenou/comm for now, but it should probably be moved in the IPython org
This has the benefit of being able to:
- remove the ipykernel dependency in ipywidgets https://github.com/jupyter-widgets/ipywidgets/pull/3533
- remove the ipykernel monkey patch in xeus-python https://github.com/jupyter-xeus/xeus-python/pull/548
- remove the ipykernel package mock in jupyterlite's pyolite
- remove the ipykernel package mock in emscripten-forge
This has the benefit of being able to:
remove the ipykernel dependency in ipywidgets https://github.com/jupyter-widgets/ipywidgets/pull/3533 remove the ipykernel monkey patch in xeus-python https://github.com/jupyter-xeus/xeus-python/pull/548 remove the ipykernel package mock in jupyterlite's pyolite remove the ipykernel package mock in emscripten-forge
Wow. I think it is quite an improvement.
Thanks a lot for your review @maartenbreddels ! I will resolve your comment and get the CI green hopefully :D
@maartenbreddels it was difficult to get green but now it seems good!
Thankfully, the Python 3.7 build requires an old version of ipykernel (latest ipykernel does not support 3.7?) so we have tests against the old versions and new versions.
Would you have time to make it a review @maartenbreddels ?
Thanks for the review! I resolved your comments
Hello. Is there a plan to merge and release this soon? We are seeing deprecation warning from stable version of ipykernel downstream. Thank you!
@martinRenou do you know what caused that change? I'm fine removing the newlines, but maybe good to be aware what is responsible for this change?
Hello. Is there a plan to merge and release this soon?
Yes, I think we should get this released asap, which I could do tomorrow if we manage to get this in.
I'm fine removing the newlines, but maybe good to be aware what is responsible for this change?
Are you talking about the test failure? If yes, this one can be reproduced on master, and this PR fixes it. I have not found what is causing this though, but I suspect an IPython change?
Yes, I think we should get this released asap, which I could do tomorrow if we manage to get this in.
💯
@maartenbreddels all green!
@martinRenou great work, i guess we also need to backport this to 7.x do you want to try the bot?
@meeseeksdev please backport to 7.x
Owee, I'm MrMeeseeks, Look at me.
There seem to be a conflict, please backport manually. Here are approximate instructions:
- Checkout backport branch and update it.
git checkout 7.x
git pull
- Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 785d1598b38f6fb43917489f530d14e28876fc24
- You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #3533: Using the new Comm Python package'
- Push to a named branch:
git push YOURFORK 7.x:auto-backport-of-pr-3533-on-7.x
- Create a PR against branch 7.x, I would have named this PR:
"Backport PR #3533 on branch 7.x (Using the new Comm Python package)"
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 Still Needs Manual Backport label once the PR gets merged.
If these instructions are inaccurate, feel free to suggest an improvement.
If seeing errors like this in pytest:
def _create_comm(*args, **kwargs):
"""Create a Comm.
This method is intended to be replaced, so that it returns your Comm instance.
"""
> raise NotImplementedError("Cannot ")
E NotImplementedError: Cannot
Adding:
import ipykernel.ipkernel # noqa
Is enough to trigger the side-effects to overload that manager.
Seems like it should go in the docs... or even in that unhelpful traceback itself, cuz 99% of the time, i reckon people are testing with ipykernel lying around.