Make kernel code compatible with newer versions of ipython #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
First of all, thank you for your work, the kernel you wrote is very small and easy to understand, so I had a good time experimenting with it :)
I have the same issue as you had before, but the newer versions of jupyter/ipykernel aren't compatible with your kernel. So here is the PR to fix it.
I've changed command-line interface, so you can use the same options as with vanilla ipykernel. You don't have to manually copy
kernel.jsonanymore, just runpython -m async_gui_ipython_kernel installinstead.Newer ipykernel versions don't use
priorityin message queues, git-bissect shows this happened at version5.6.0. So I put this restriction insetup.py, but in fact there might be other incompatibilities.While the hack with returning
dispatch(*new_args)instead of scheduling it is still working, I found myself uneasy looking at this for a few reasons:argsand duplicate message processing logic (seems no longer the case in current kernels)set_parentcommented out, so i didn't saw the output and thought it didn't work anymore 🤣Anyway, now it works like this:
process_oneconsumes one message at a time as before (from any queue)To illustrate this, we could imagine the following timeline:
Not sure if the timeline clarifies it enough, but you can thing of
process_oneas of "process one [cluster of messages]" rather than "process one [message]".FWIW, the example widget didn't work for me, so I used this code to test the kernel:
Vanilla kernel hangs, while async-gui kernel lets you click the button and prints "done".
PS. I used some hacks and monkey patching to reduce the amount of code needs to be changed, so the disclaimer in
README.mdis still true.PPS. There is another project (akernel) that does the similar job, but it puts too much restrictions on the code. In my case it didn't worked well.