Release of IPython 8.0

M Bussonnier
Jupyter Blog
Published in
4 min readJan 12, 2022

--

IPython is a powerful Python REPL that gives you tab completion, better tracebacks, multiline editing, and several useful features on top of pure Python Scripts. It is also the library that powers the Jupyter Kernel via the IPykernel.

Today I am pleased to announce the release of IPython 8.0, which has been long in the making and arrived a bit over three years after the 7.0 release.

I also suggest to read the companion blog post on Quansight-Labs site that goes into some technical details on how we removed some old code.

EDIT: You can also ask questions/comments on the jupyter discourse, or read the discussion on HN

Many new features

This major release comes with many improvements to the existing codebase and several new features. These new features are code reformatting with Black in the CLI, ghost suggestions, and better tracebacks which highlight the error node, thus making complex expressions easier to debug (see below).

Tracebacks now highlight in which AST node the error occurs. In complex code, this helps to quickly narrow down what causes an error. Here we also turn on `xmode verbose` to see values of local variables (xmode verbose is disabled by default for security reasons as it could leak secrets, but is highly recommended)

But really, if you want to read about all the new features in-depth, we recommend you spend some time reading the what’s new and the list of features in 7.x.

Moving forward by shedding weight

While IPython 8.0 has many new features described in the what’s new section, the majority of changes that demanded a bump in major version numbers are removals.

IPython was created more than two decades ago by Fernando Pérez while procrastinating on his graduation. Even if a few lines from this period remain, it was time to remove a large number of deprecated and unused code in the IPython code base and drop old dependencies (like nose) in favor of more recent ones (pytest).

Thanks to NumFOCUS Small Developer Grant, we hired Nikita Kniazev (@Kojoley) to help us with some of the heavy lifting. Nikita did a fantastic job updating our codebase, migrating to pytest, enhancing our coverage, and fixing numerous bugs. I highly recommend contacting them if you need help with C++ and Python projects.

Some of Nikita’s most notable contributions are:

  • IPython is no longer reliant on Nose, which has been unmaintained for many years.
  • Significantly increased IPython coverage.
  • Considerable refactor of areas that were calling into deprecated features.

On top of this, IPython 8.0 also comes with the following capabilities:

  • Remove most of the deprecated functions and parameters that were marked as such between IPython 1.0 and 5.0
  • Bumped the minimal required Python version to 3.8 (following NEP 29). This means that we now use the native Python top-level async instead of crazy hacks. And we can start to use def fun(a,/,b=None): syntax for positional only arguments.

Nikita also went well beyond the scope of work we gave them by suggesting more robust and often simpler code patterns.

In total, this allowed us, despite all the added features, added type annotations and added tests, to decrease the size of the codebase from 37 500 LOC across 348 files to 36 100 across 294 files. We hope that this reduction in the codebase size combined with work on speeding the startup of the CLI will make IPython easier to use and contribute to.

Some advice on how to do that same are on the companion blog post and the Quansight-Labs site.

Moving toward pyproject.toml

Another place in IPython that has seen many changes in the build process. We now use pyproject.tomlto have a declarative build. We still require setuptools and have setup.py files right now, but we are working towards removing/simplifying them soon.

IPython’s wheels and sdist can now be built with `python -m build` instead of invoking setup.py directly.

Our process still needs manual setup of SOURCE_DATE_EPOCH and repacking of the sdist wheel to obtain reproducible builds. We encourage you to get the git repository, build it yourself, and get a byte-for-byte identical artifacts.

Monthly Release and following NEP 29

We strongly believe that predictability is key to adoption and trust in IPython. In particular, in business settings, it is critical to plan ahead while rapidly receiving bug fixes. This is why for IPython 8.0 we’ll continue to do minor monthly releases on the last Friday of each month as long at it’s reasonable and does not impact maintainers life too much.

We’ll still publish a few 7.x releases with critical bug fixes, but starting last Friday of this month, you will start to see stable releases of 8.x.
All releases are announced in this subcategory in discourse, to which you can get subscribed to get notifications.

We also now follow NEP 29, meaning that IPython 8.0 is not only compatible with NumPy 1.19+ and Python 3.8+. But our future Python support schedule is predictably aligned with all other libraries following NEP 29.
We believe the new NEP 29 is critical. It gives the core Scientific Python Ecosystem a clear schedule of available features and the removal of deprecated features.

Looking forward to your contributions

Don’t think IPython is too hard to contribute to or has no missing features. We try to keep a list of beginner-friendly issues, but we really want your feedback and your ideas. In the meantime, have fun with this new release that you can install with :

pip install ipython ipykernel --upgrade

or

conda update ipython ipykernel

(updating ipykernel may not be necessary for you, but we recommend it).

Thanks

Thanks to Tania Allard and Eric Charles for review , Quansight Labs and Quansight (my employer) for all the open-source work I can do. Of course, thanks to all the contributors to the IPython and Jupyter community, and in particular MrMino who recently joined as an IPython core dev..

--

--

French. @ProjectJupyter Dev. Steering Member and Co-Founder. @IPythonDev maintainer. Pythonista. ACM System Software Award 2017. @quansightai