[ANN] ipykernel 6.0 Release

IPykernel 6.0 is the first major release in about two years, that brings a number of improvements, code cleanup, and new
features to IPython.

You should be able to view all closed issues and merged Pull Request for this
milestone on GitHub,
as for any major releases, we advise greater care when updating that for minor
release and welcome any feedback (~50 Pull-requests).

IPykernel 6 should contain all changes of the 5.x series, in addition to the
following non-exhaustive changes.

  • Support for the debugger protocol, when using JupyterLab, RetroLab or any
    frontend supporting the debugger protocol you should have access to the
    debugger functionalities.

  • The control channel on IPykernel 6.0 is run in a separate thread, this may
    change the order in which messages are processed, though this change was necessary
    to accommodate the debugger.

  • We now have a new dependency: matplotlib-inline, this helps to separate the
    circular dependency between IPython/IPykernel and matplotlib.

  • All outputs to stdout/stderr should now be captured, including subprocesses
    and output of compiled libraries (blas, lapack…). In notebook
    server, some outputs that would previously go to the notebooks logs will now
    both head to notebook logs and in notebooks outputs. In terminal frontend
    like Jupyter Console, Emacs or other, this may ends up as duplicated outputs.

  • coroutines are now native (async-def) , instead of using tornado’s

  • OutStreams can now be configured to report istty() == True, while this
    should make some output nicer (for example colored), it is likely to break
    others. Use with care.

You can view the full release notes here


How complex do we reckon it will be for wrapper kernels that extend IPykernel or KernelBase to make use of the debugger stuff?

@JohanMabille or @jtp might have some insight here

There are different scenarii here:

  • Python kernels that extend ipykernel.IPythonKernel: the debugger should work out of the box (assuming debugpy is installed).
  • kernels for other languages that extend ipykernel.IPythonKernel (I don’t know if that makes sense): they should monkey-patch the debugger member to use a debugger suited for the target language.
  • Python kernels that extend KernelBase.Kernel: they must implement the do_debug_request method, but can reuse the Debugger class; therefore the implementation of do_debug_request should be a few lines of boilerplate.
  • Kernels for other languages that extend KernelBase.Kernel: they must implement the do_debug_request method and provide a full implementation of the debugger for the target language.

Notice that we can refactor a bit the Debugger class to make it easier to extend instead of having to reimplement everything.

1 Like

Update from getting 6.0 on conda-forge: we’ve hit some snags with pypy not being able to shut down kernels… which is at least present on jupyter_client, and potentially deeper on nest_asyncio.