albertz / background-zmq-ipython

Background ZMQ IPython/Jupyter kernel
BSD 2-Clause "Simplified" License
17 stars 4 forks source link

Add support for ipykernel 6 #11

Closed Dalbasar closed 2 years ago

Dalbasar commented 2 years ago

In ipykernel 6, the shell_streams argument for the Kernel is deprecated. When a list of shell_streams is provided, only the first one is actually used in ipykernel 6, i.e. the control stream is not setup properly. The shell_stream and control_stream are individual argument for the Kernel in ipykernel 6.

Compatibilty with ipykernel 5 is preserved, but might be dropped later.

Upstream change: https://github.com/ipython/ipykernel/blob/7ed57cb4a03e719074c373029cf9f2e6dfd2c6de/ipykernel/kernelbase.py#L75

Should solve the following issue: https://github.com/albertz/background-zmq-ipython/issues/6

albertz commented 2 years ago

Everything is the same except for shell_stream and control_stream, right?

I would make this a single call, and differentiate via

**(dict(shell_stream=..., control_stream=...) if ... else dict(shell_streams=...))
Dalbasar commented 2 years ago

yes that looks better, thanks for the hint.