<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Jupyter Blog - IPython</title><link href="https://jasongrout.github.io/medium-archive/pelican/" rel="alternate"/><link href="https://jasongrout.github.io/medium-archive/pelican/feeds/tag-ipython.atom.xml" rel="self"/><id>https://jasongrout.github.io/medium-archive/pelican/</id><updated>2022-01-12T16:14:00+00:00</updated><subtitle>The Project Jupyter blog: news, releases, and community stories, archived from blog.jupyter.org.</subtitle><entry><title>Release of IPython 8.0</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2022/release-of-ipython-8-0/" rel="alternate"/><published>2022-01-12T13:37:00+00:00</published><updated>2022-01-12T16:14:00+00:00</updated><author><name>M Bussonnier</name></author><id>tag:jasongrout.github.io,2022-01-12:/medium-archive/pelican/posts/2022/release-of-ipython-8-0/</id><summary type="html">&lt;p&gt;IPython is a powerful Python REPL that gives you tab completion, better tracebacks, multiline editing, and several useful features on top…&lt;/p&gt;
</summary><content type="html">&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;I also suggest to read the &lt;a href="https://labs.quansight.org/blog/2022/01/ipython-8.0-lessons-learned-maintaining-software/"&gt;companion blog post&lt;/a&gt; on Quansight-Labs site that goes into some technical details on how we removed some old code.&lt;/p&gt;
&lt;p&gt;EDIT: You can also ask questions/comments on the jupyter &lt;a href="https://discourse.jupyter.org/t/ipython-8-0-0-out/12554"&gt;discourse&lt;/a&gt;, or &lt;a href="https://news.ycombinator.com/item?id=29906774"&gt;read the discussion on HN&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Many new features&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;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).&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="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)" src="https://jasongrout.github.io/medium-archive/pelican/posts/2022/release-of-ipython-8-0/images/001-1_2_TYKwP_RInA4QVp9UhMhw.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;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 &lt;code&gt;xmode verbose&lt;/code&gt; to see values of local variables (xmode verbose is disabled by default for security reasons as it could leak secrets, but is highly recommended)&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;But really, if you want to read about all the new features in-depth, we recommend you spend some time &lt;a href="https://ipython.readthedocs.io/en/stable/whatsnew/version8.html#ipython-8-0"&gt;reading the what’s new&lt;/a&gt; and the list of features in &lt;code&gt;7.x&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id="moving-forward-by-shedding-weight"&gt;Moving forward by shedding weight&lt;/h3&gt;
&lt;p&gt;While IPython 8.0 has many new features described in &lt;a href="https://ipython.readthedocs.io/en/stable/whatsnew/version8.html#ipython-8-0"&gt;the what’s new section&lt;/a&gt;, the majority of changes that demanded a bump in major version numbers are removals.&lt;/p&gt;
&lt;p&gt;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).&lt;/p&gt;
&lt;p&gt;Thanks to NumFOCUS &lt;a href="https://numfocus.org/programs/small-development-grants"&gt;Small Developer Grant&lt;/a&gt;, we hired &lt;a href="https://github.com/Kojoley"&gt;Nikita Kniazev (@Kojoley)&lt;/a&gt; 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.&lt;/p&gt;
&lt;p&gt;Some of Nikita’s most notable contributions are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;IPython is no longer reliant on Nose, which has been unmaintained for many years.&lt;/li&gt;
&lt;li&gt;Significantly increased IPython coverage.&lt;/li&gt;
&lt;li&gt;Considerable refactor of areas that were calling into deprecated features.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On top of this, IPython 8.0 also comes with the following capabilities:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Remove most of the deprecated functions and parameters that were marked as such between IPython 1.0 and 5.0&lt;/li&gt;
&lt;li&gt;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 &lt;code&gt;def fun(a,/,b=None):&lt;/code&gt; syntax for positional only arguments.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Nikita also went well beyond the scope of work we gave them by suggesting more robust and often simpler code patterns.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Some advice on how to do that same are on the &lt;a href="https://labs.quansight.org/blog/2022/01/ipython-8.0-lessons-learned-maintaining-software/"&gt;companion blog post&lt;/a&gt; and the Quansight-Labs site.&lt;/p&gt;
&lt;h3 id="moving-toward-pyprojecttoml"&gt;Moving toward pyproject.toml&lt;/h3&gt;
&lt;p&gt;Another place in IPython that has seen many changes in the build process. We now use &lt;code&gt;pyproject.toml&lt;/code&gt;to have a declarative build. We still require setuptools and have &lt;code&gt;setup.py&lt;/code&gt; files right now, but we are working towards removing/simplifying them soon.&lt;/p&gt;
&lt;p&gt;IPython’s wheels and sdist can now be built with &lt;code&gt;python -m build&lt;/code&gt; instead of invoking &lt;code&gt;setup.py&lt;/code&gt; directly.&lt;/p&gt;
&lt;p&gt;Our process still needs manual setup of SOURCE_DATE_EPOCH and repacking of the &lt;code&gt;sdist&lt;/code&gt; wheel to obtain &lt;a href="https://reproducible-builds.org/"&gt;reproducible builds&lt;/a&gt;. We encourage you to get the git repository, build it yourself, and get a byte-for-byte identical artifacts.&lt;/p&gt;
&lt;h3 id="monthly-release-and-following-nep-29"&gt;Monthly Release and following NEP 29&lt;/h3&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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.&lt;br&gt;
All releases are announced in &lt;a href="https://discourse.jupyter.org/tags/c/meta/8/announcement"&gt;this subcategory in discourse&lt;/a&gt;, to which you can get subscribed to get notifications.&lt;/p&gt;
&lt;p&gt;We also now follow &lt;a href="https://numpy.org/neps/nep-0029-deprecation_policy.html"&gt;NEP 29&lt;/a&gt;, 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.&lt;br&gt;
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.&lt;/p&gt;
&lt;h3 id="looking-forward-to-your-contributions"&gt;Looking forward to your contributions&lt;/h3&gt;
&lt;p&gt;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 :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install ipython ipykernel --upgrade
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;conda update ipython ipykernel
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;(updating ipykernel may not be necessary for you, but we recommend it).&lt;/p&gt;
&lt;h3 id="thanks"&gt;Thanks&lt;/h3&gt;
&lt;p&gt;Thanks to Tania Allard and Eric Charles for review , Quansight Labs and &lt;a href="https://www.quansight.com/"&gt;Quansight&lt;/a&gt; (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 &lt;a href="https://github.com/MrMino"&gt;MrMino&lt;/a&gt; who recently joined as an IPython core dev…&lt;/p&gt;
</content><category term="IPython"/><category term="releases"/></entry><entry><title>IPython Parallel in 2021</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2021/ipython-parallel-in-2021/" rel="alternate"/><published>2021-11-30T07:55:00+00:00</published><updated>2021-11-30T07:55:00+00:00</updated><author><name>Min RK</name></author><id>tag:jasongrout.github.io,2021-11-30:/medium-archive/pelican/posts/2021/ipython-parallel-in-2021/</id><summary type="html">&lt;p&gt;Updates on IPython Parallel; new features, future direction&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;em&gt;This post describes work funded by Bodo, Inc.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://ipyparallel.readthedocs.io/"&gt;IPython Parallel&lt;/a&gt;’s a bit of an odd duck in the parallel computing space. In a world with &lt;a href="https://dask.org/"&gt;dask&lt;/a&gt;, &lt;a href="https://ray.io/"&gt;ray&lt;/a&gt;, &lt;a href="https://docs.bodo.ai/latest/source/getting_started.html"&gt;bodo&lt;/a&gt;, &lt;a href="https://spark.apache.org/docs/latest/api/python/index.html"&gt;pyspark&lt;/a&gt;, and other parallel computing tools, what is IPython Parallel’s role in 2021?&lt;/p&gt;
&lt;h2 id="context"&gt;Context&lt;/h2&gt;
&lt;p&gt;IPython Parallel began (in 2006!) as a natural extension of the &lt;a href="https://jupyter-client.readthedocs.io/en/stable/messaging.html#general-message-format"&gt;Jupyter messaging protocol&lt;/a&gt;(&lt;em&gt;though it predates the Jupyter name by a few years&lt;/em&gt;): when you have a protocol for &lt;a href="https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop"&gt;REPL&lt;/a&gt;-style remote code execution, what can you do with &lt;em&gt;multiple&lt;/em&gt; remote execution environments? This question led to the development two basic models for parallel execution in IPython Parallel:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;“multiplexed execution” — where you send code explicitly to different workers, and&lt;/li&gt;
&lt;li&gt;“load-balanced execution” — where you tell IPython Parallel what to run, and a scheduler takes care of assigning each task to an available worker.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="what-ipython-parallel-doesnt-do"&gt;What IPython Parallel doesn’t do&lt;/h2&gt;
&lt;p&gt;To IPython, your tasks are black boxes (either Python functions or blocks of Python code as text) and you are in complete control of where and when your tasks run, as well as any dependencies or side effects they may have.&lt;/p&gt;
&lt;p&gt;IPython Parallel specifically doesn’t and won’t do several things that other tools might:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;infer dependencies or relationships between tasks (execution graph)&lt;/li&gt;
&lt;li&gt;manage data distribution or locality&lt;/li&gt;
&lt;li&gt;construct parallel algorithms or represent ‘natively’ parallel distributed data structures, such as distributed arrays or data frames&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Everything is very explicit and implemented at the client-level in IPython Parallel, meaning that while &lt;em&gt;it&lt;/em&gt; doesn’t do these things, &lt;em&gt;you&lt;/em&gt; can. It also means that many of the things that have overhead costs associated with parallel computing (communication, data movement) have particularly high costs in IPython Parallel.&lt;/p&gt;
&lt;p&gt;IPython Parallel doesn’t hide anything from you, for better &lt;em&gt;and&lt;/em&gt; worse.&lt;/p&gt;
&lt;h2 id="what-ipython-parallel-does"&gt;What IPython Parallel does&lt;/h2&gt;
&lt;p&gt;IPython Parallel &lt;strong&gt;makes &lt;em&gt;explicit&lt;/em&gt; parallel computations interactive&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;IPython Parallel is not just parallel Python, it’s parallel &lt;em&gt;IPython&lt;/em&gt;. That means you have all the power of IPython’s inspection, interactivity, magics, and debugging available on all of your distributed workers. This makes it especially well-suited to prototyping and experimentation.&lt;/p&gt;
&lt;p&gt;IPython Parallel also presents standard APIs such as &lt;a href="https://ipyparallel.readthedocs.io/en/8.0.0/examples/Futures.html#Executors"&gt;Python Executors&lt;/a&gt;, compatible with many other implementations, to make it easy to migrate to &lt;em&gt;and from&lt;/em&gt; IPython Parallel, enabling developers to write code that uses a single multicore laptop or a thousand cores on an HPC cluster or cloud.&lt;/p&gt;
&lt;h2 id="ipython-parallel-in-2021"&gt;IPython Parallel in 2021&lt;/h2&gt;
&lt;figure&gt;
&lt;img alt="Interactive progress across parallel engines. Those progress bars are interactive widgets running locally, and on each remote engine!" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/ipython-parallel-in-2021/images/001-1_5W4lCfV_HPwSmFP88niiJg.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Interactive progress across parallel engines. Those progress bars are interactive widgets running locally, &lt;em&gt;and on each remote engine!&lt;/em&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;For a lot of today’s workloads, my default recommendation is: use &lt;a href="https://dask.org/"&gt;dask&lt;/a&gt; or bodo or another modern tool. IPython even makes this easier if you already happen to have an IPython Parallel cluster, you can tell it to “&lt;a href="https://ipyparallel.readthedocs.io/en/8.0.0/examples/dask.html"&gt;become dask&lt;/a&gt;,” and off you go:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;dask_client = rc.become_dask(ncores=1)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;However, where IPython Parallel can shine, is making traditional &lt;a href="https://en.wikipedia.org/wiki/SPMD"&gt;SPMD&lt;/a&gt; (e.g., MPI) workloads interactive, especially for prototyping and debugging.&lt;/p&gt;
&lt;p&gt;If you have an MPI simulation and you wish you could pause it in the middle, poke around and make plots and interact with just one node or all of them with all the interactive tools available to you in Jupyter, IPython Parallel may be the tool for you.&lt;/p&gt;
&lt;h2 id="recent-developments"&gt;Recent developments&lt;/h2&gt;
&lt;p&gt;Because I see the main problem IPython Parallel solves well is adding interactivity to direct parallel execution, the focus of recent developments has been on improving that story, based on feedback from users who are often in traditional HPC environments like SLURM or PBS, or using MPI in the cloud.&lt;/p&gt;
&lt;p&gt;Much of the feedback on challenges over the years have been around:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Scaling to larger numbers of engines (1,–10,000)&lt;/li&gt;
&lt;li&gt;Better feedback and recovery when things go wrong&lt;/li&gt;
&lt;li&gt;Security requirements&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thanks to &lt;a href="https://bodo.ai/"&gt;Bodo&lt;/a&gt;, I’ve been able to spend a lot of time this year addressing several of those issues, now available as IPython Parallel 8.0.&lt;/p&gt;
&lt;p&gt;Last year, Tom-Olav Bøyum developed a broadcast scheduler as part of his &lt;a href="https://www.duo.uio.no/handle/10852/81515"&gt;Master’s thesis&lt;/a&gt;, which vastly improves the efficiency of sending the same task to all engines (the main thing we do in IPP+MPI). This work is now mostly done and landed in IPython Parallel 7. We’ve also addressed longstanding issues with registering large numbers of engines (5–10,000) at once, a common source of failure on HPC clusters.&lt;/p&gt;
&lt;p&gt;One of the most frustrating / challenging things when working with MPI or other parallel computations is dealing with hangs and restarting tasks. Through the new &lt;a href="https://ipyparallel.readthedocs.io/en/8.0.0/examples/Cluster%20API.html"&gt;Cluster API&lt;/a&gt;, IPython Parallel now has one of its most requested features: the ability to send signals to one or all engines, and forcefully restart the cluster if it’s stuck.&lt;/p&gt;
&lt;p&gt;We’ve also improved interactive feedback with progress bars, live streaming output, a newJupyterLab plugin based on dask-labextension, and support for the Jupyter widget protocol, so you can instantiate widgets on engines and interact with them directly from a notebook.&lt;/p&gt;
&lt;p&gt;Security questions have also been raised, because IPython (and Jupyter’s) use of ZeroMQ assumes a ‘trusted network’, typically localhost or BSD sockets for notebooks. Since IPython Parallel usually runs across a network, security can be more of a concern (whereas notebooks typically only use standard HTTPS connections over a network), and the level of security in the Jupyter protocol alone may not be sufficient. In the past, we’ve resorted to tunneling TCP over SSH for more secure network traffic, but still always implicitly trusting localhost.&lt;/p&gt;
&lt;p&gt;IPython Parallel 7.1 enables &lt;a href="https://rfc.zeromq.org/spec/26/"&gt;CurveZMQ&lt;/a&gt; for full authentication, encryption, and &lt;a href="https://en.wikipedia.org/wiki/Forward_secrecy"&gt;forward-secrecy&lt;/a&gt; at the transport level, solving a longstanding security shortcoming of IPython Parallel.&lt;/p&gt;
&lt;h2 id="ipython-parallel-in-the-future"&gt;IPython Parallel in the future&lt;/h2&gt;
&lt;p&gt;Scaling is the biggest challenge for IPython Parallel due to its communication model. However, that scaling is on the order of IPython &lt;em&gt;engines&lt;/em&gt;, which is not the same as the number of cores. You can benefit from this today if your tasks are already multi-threaded, e.g., through OpenMP threads in numpy, or your own Python threads or multiprocess breakdown of tasks.&lt;/p&gt;
&lt;p&gt;Better support of multi-level parallelism, where each “engine” may represent a multicore node, as individual nodes get bigger and bigger would mean moving the bar where IPython Parallel communication is the bottleneck back two orders of magnitude on large machines, because one ‘engine’ could represent 128 cores or more. Good support for 1000 128-core nodes would give IPython Parallel some pretty comfortable headroom for our target use cases, scale-wise.&lt;/p&gt;
&lt;p&gt;Also related to scaling, bringing the BroadcastView to maturity should allow us to completely replace the DirectView scheduler, as it should be able to match or beat it in almost every scenario with some further development. There are some features lacking, especially when it comes to error handling, but those can certainly be addressed in time.&lt;/p&gt;
&lt;p&gt;Finally, I’ll invite you to get involved. Especially if you are interested in prototyping parallel code, or making traditional MPI-style code interactive, check out IPython Parallel 8 and &lt;a href="https://github.com/ipython/ipyparallel/issues"&gt;let us know&lt;/a&gt; how it goes, or contribute your use case as an example.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install --upgrade ipyparallel
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
</content><category term="IPython"/></entry><entry><title>Enabling the JupyterLab debugger with ipykernel</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2021/enabling-the-jupyterlab-debugger-with-ipykernel/" rel="alternate"/><published>2021-05-13T11:45:00+00:00</published><updated>2021-06-02T14:59:00+00:00</updated><author><name>Sylvain Corlay</name></author><id>tag:jasongrout.github.io,2021-05-13:/medium-archive/pelican/posts/2021/enabling-the-jupyterlab-debugger-with-ipykernel/</id><summary type="html">&lt;p&gt;Support for the Jupyter Debugger Protocol just landed in ipykernel&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;em&gt;Support for the Jupyter Debugger Protocol just landed in ipykernel&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;JupyterLab 3.0 includes a visual debugger that allows to interactively set breakpoints, step into functions, and inspect variables with any Jupyter kernel that implements the Jupyter debugger protocol.&lt;/p&gt;
&lt;p&gt;The first two language kernels to implement the new protocol were &lt;a href="https://github.com/jupyter-xeus/xeus-python/"&gt;xeus-python&lt;/a&gt; (a Python kernel) and &lt;a href="https://github.com/jupyter-xeus/xeus-robot/"&gt;xeus-robot&lt;/a&gt; (a kernel for Robot Framework). Unfortunately, the reference Python kernel, &lt;a href="https://github.com/ipython/ipykernel"&gt;&lt;strong&gt;ipykernel&lt;/strong&gt;&lt;/a&gt;, did not support debugging yet, &lt;em&gt;until now&lt;/em&gt;!&lt;/p&gt;
&lt;p&gt;Today, we are pleased to announce that debugging support landed in ipykernel, and will be available in the next major release, ipykernel 6.0. Pre-releases including the ipykernel debugger are available.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Debugging with ipykernel" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/enabling-the-jupyterlab-debugger-with-ipykernel/images/001-1_jSQWLvCYoV-L-kp_lTkRKg.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Debugging with ipykernel&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="what-will-change-with-ipykernel-60"&gt;What will change with ipykernel 6.0?&lt;/h2&gt;
&lt;p&gt;Enabling support for debugging in ipykernel required important changes in the code base regarding the concurrency model of the kernel. The main change is that the processing of messages on the “control channel” now happens in a different thread, allowing for the processing to happen while user code is running.&lt;/p&gt;
&lt;p&gt;Ipykernel 6.0 includes several other updates. Tornado coroutines were dropped in favor of native coroutines. The Matplotlib inline backend was split into a separate package, and ipykernel depends on &lt;a href="https://github.com/microsoft/debugpy"&gt;debugpy&lt;/a&gt;, an implementation of the Debug Adapter Protocol for Python.&lt;/p&gt;
&lt;p&gt;If you are interested in testing out the new features, check out the beta release!&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install ipykernel --pre
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="try-it-now"&gt;Try it now!&lt;/h2&gt;
&lt;p&gt;Thanks to &lt;a href="https://mybinder.org/"&gt;MyBinder&lt;/a&gt;, you can also try it out without the need of installing anything on your computer. Just follow this link:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://mybinder.org/v2/gist/SylvainCorlay/a6405bbdfa9d58a670a67f3a47741bd2/HEAD?urlpath=doc%2Ftree%2Fdebugger.ipynb"&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/enabling-the-jupyterlab-debugger-with-ipykernel/images/002-0_rELNpt0w5qbk_GQn.jpg" alt="" loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="what-about-the-future"&gt;What about the future?&lt;/h2&gt;
&lt;p&gt;A lot of new features are in the works with the JupyterLab debugger.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;JupyterLab 3.1 will include several usability improvements to the debugger.&lt;/li&gt;
&lt;li&gt;It will also add the ability to submit code for execution when stopped at a breakpoint.&lt;/li&gt;
&lt;li&gt;We are working on a richer variable explorer, using Jupyter’s rich display system to enable the rich-rendering of variables in the explorer, to &lt;em&gt;e.g.&lt;/em&gt; render dataframes as tables.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Finally, we also plan on adding debugging support to other language kernels.&lt;/p&gt;
&lt;h2 id="acknowledgements"&gt;Acknowledgements&lt;/h2&gt;
&lt;p&gt;The work of Johan and Sylvain at &lt;a href="https://twitter.com/QuantStack"&gt;QuantStack&lt;/a&gt; on the debugger support in ipykernel was funded by &lt;a href="https://www.twosigma.com/"&gt;Two Sigma&lt;/a&gt;. We are grateful to Min Ragan Kelley and Matthias Bussonnier, who reviewed the pull requests on debugger support.&lt;/p&gt;
&lt;h2 id="about-the-authors"&gt;About the authors&lt;/h2&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/enabling-the-jupyterlab-debugger-with-ipykernel/images/003-1_8_HgQuq5_HXhLXSdfGnhrA.jpeg" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://twitter.com/JohanMabille"&gt;Johan Mabille&lt;/a&gt; is a scientific software developer at QuantStack.&lt;/p&gt;
&lt;p&gt;Johan is very active in the Jupyter ecosystem, as the creator of &lt;a href="https://github.com/jupyter-xeus/xeus"&gt;xeus&lt;/a&gt;, a C++ implementation of the Jupyter protocol, and several language kernels, such as &lt;a href="https://github.com/jupyter-xeus/xeus-python"&gt;xeus-python&lt;/a&gt;, &lt;a href="https://github.com/jupyter-xeus/xeus-cling"&gt;xeus-cling&lt;/a&gt;, and &lt;a href="https://github.com/jupyter-xeus/xeus-robot"&gt;xeus-robot&lt;/a&gt;. Johan also made contributions to the Jupyter widgets ecosystem and to JupyterLab.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/enabling-the-jupyterlab-debugger-with-ipykernel/images/004-1_LpuIpGQIDYMhv5IBthmwcA.jpeg" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://twitter.com/SylvainCorlay"&gt;Sylvain Corlay&lt;/a&gt; is the founder and CEO of QuantStack.&lt;/p&gt;
&lt;p&gt;As an open-source developer, Sylvain is very active in the Jupyter project with contributions in several components of the stack, including widgets, kernels, nbconvert, and others. He is also a steering committee member of the project.&lt;/p&gt;
&lt;p&gt;Sylvain also does volunteer work for the community, as member of board of directors of NumFOCUS, co-organizer of the &lt;a href="https://www.meetup.com/pyData-paris"&gt;PyData Paris Meetup&lt;/a&gt;, and vice-chair of JupyterCon 2020.&lt;/p&gt;
</content><category term="IPython"/><category term="JupyterLab"/><category term="kernels"/></entry><entry><title>Abracadabra! Bringing the magics to xeus-python</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2021/abracadabra-bringing-the-magics-to-xeus-python/" rel="alternate"/><published>2021-02-18T13:30:00+00:00</published><updated>2021-02-18T14:06:00+00:00</updated><author><name>Martin Renou</name></author><id>tag:jasongrout.github.io,2021-02-18:/medium-archive/pelican/posts/2021/abracadabra-bringing-the-magics-to-xeus-python/</id><summary type="html">&lt;p&gt;Last year, we set ourselves to implement a visual debugger for JupyterLab. This endeavor required major developments in the JupyterLab…&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Last year, we set ourselves to implement a &lt;strong&gt;visual debugger for JupyterLab&lt;/strong&gt;. This endeavor required major developments in the JupyterLab front-end, in core-Jupyter protocols, and on the kernel side (the part of the Jupyter infrastructure responsible for executing the code).&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/jupyter-xeus/xeus-python"&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/abracadabra-bringing-the-magics-to-xeus-python/images/001-0_B0kK-zNJr0Suisyv.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For kernel-side development, we decided to start with the &lt;a href="/posts/2019/a-new-python-kernel-for-jupyter/"&gt;&lt;strong&gt;xeus-python&lt;/strong&gt; kernel&lt;/a&gt;, a lightweight implementation of a Jupyter kernel for the Python programming language. Based on &lt;a href="https://github.com/jupyter-xeus/xeus"&gt;&lt;strong&gt;xeus&lt;/strong&gt;&lt;/a&gt;, xeus-python has a flexible concurrency model that was required to &lt;em&gt;e.g.&lt;/em&gt; add breakpoints while executing code.&lt;/p&gt;
&lt;p&gt;Unfortunately, xeus-python did not provide all ipykernel features (magics, Matplotlib support, &lt;em&gt;etc.&lt;/em&gt;). Furthermore, many notebooks depend on IPython, as they import it explicitely or make use of the IPython configuration system.&lt;/p&gt;
&lt;p&gt;Today, we are proud to announce that xeus-python supports 100% of the IPython magics! This was achieved by leveraging the core IPython package. This is getting us closer to feature parity with ipykernel.&lt;/p&gt;
&lt;h2 id="magics"&gt;Magics&lt;/h2&gt;
&lt;p&gt;xeus-python now supports all magics that IPython provides and even user-defined magics!&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Support for builtin IPython magics and user-defined magics" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/abracadabra-bringing-the-magics-to-xeus-python/images/002-1_PTiGVyDsazc_ziz6Bk4EnA.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Support for builtin IPython magics and user-defined magics&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="matplotlib"&gt;Matplotlib&lt;/h2&gt;
&lt;p&gt;Most Matplotlib back-ends are now supported by xeus-python, allowing you to show static plots with the inline back-end or interactive plots with &lt;a href="https://github.com/matplotlib/ipympl"&gt;ipympl&lt;/a&gt; in your Notebook:&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Matplotlib inline back-end and ipympl interactive back-end" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/abracadabra-bringing-the-magics-to-xeus-python/images/003-1_cmnPUKlhHHwUf8PZhNQx2g.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Matplotlib inline back-end and ipympl interactive back-end&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="extending"&gt;Extending&lt;/h2&gt;
&lt;p&gt;IPython has a rich configuration system that you can tweak in order to get an enhanced Notebook experience. Xeus-python now supports any configuration you setup for IPython:&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Automatically import NumPy in the IPython settings" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/abracadabra-bringing-the-magics-to-xeus-python/images/004-1_bB5hiXIbVAlV3kX9KJfLfg.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Automatically import NumPy in the IPython settings&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="visual-debugging"&gt;Visual Debugging&lt;/h2&gt;
&lt;p&gt;The latest JupyterLab version introduced a visual debugger in its interface. xeus-python was the first Jupyter kernel to add support for it!&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Stepping into Python code in JupyterLab with the visual debugger" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/abracadabra-bringing-the-magics-to-xeus-python/images/005-1_efZAtaJQqeirAZoEqbxvdw.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Stepping into Python code in JupyterLab with the visual debugger&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;xeus-python is not the only Jupyter kernel that supports debugging anymore: &lt;a href="https://github.com/jupyter-xeus/xeus-robot"&gt;xeus-robot&lt;/a&gt; is a xeus-based Jupyter kernel for the &lt;a href="https://robotframework.org/"&gt;RobotFramework&lt;/a&gt; language that supports the JupyterLab visual debugger.&lt;/p&gt;
&lt;h2 id="try-it-online"&gt;Try it online&lt;/h2&gt;
&lt;p&gt;Thanks to &lt;a href="https://mybinder.org/"&gt;MyBinder&lt;/a&gt;, you can try it out without the need of installing anything on your computer. Just follow this link:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://mybinder.org/v2/gh/jupyter-xeus/xeus-python/stable?urlpath=/lab/tree/notebooks/xeus-python.ipynb"&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/abracadabra-bringing-the-magics-to-xeus-python/images/006-0_2sBOFFsk_322apCe.jpg" alt="" loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="installation"&gt;Installation&lt;/h2&gt;
&lt;p&gt;You can install the latest xeus-python version using mamba or conda:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mamba install xeus-python -c conda-forge
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Or&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;conda install xeus-python -c conda-forge
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can also compile it yourself, instructions can be found in the repository:&lt;br&gt;
&lt;a href="https://github.com/jupyter-xeus/xeus-python"&gt;https://github.com/jupyter-xeus/xeus-python&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="acknowledgments"&gt;Acknowledgments&lt;/h2&gt;
&lt;p&gt;My work on &lt;a href="https://github.com/QuantStack/xeus"&gt;xeus&lt;/a&gt; and &lt;a href="https://github.com/QuantStack/xeus-python"&gt;xeus-python&lt;/a&gt; at &lt;a href="https://twitter.com/QuantStack"&gt;&lt;strong&gt;QuantStack&lt;/strong&gt;&lt;/a&gt; was funded by &lt;a href="https://www.techatbloomberg.com/"&gt;&lt;strong&gt;Bloomberg&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="about-the-author"&gt;About the Author&lt;/h2&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/abracadabra-bringing-the-magics-to-xeus-python/images/007-0_5XdymjYwzZe-hvy8.jpg" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;My name is &lt;a href="https://twitter.com/martinRenou"&gt;Martin Renou&lt;/a&gt;, I am a Scientific Software Engineer at &lt;a href="https://quantstack.net/"&gt;&lt;strong&gt;QuantStack&lt;/strong&gt;&lt;/a&gt;. Before joining QuantStack, I studied at the aerospace engineering school &lt;a href="https://www.isae-supaero.fr/en"&gt;SUPAERO&lt;/a&gt; in Toulouse, France. I also worked at Logilab in Paris, France and Enthought in Cambridge, UK. As an open-source developer at QuantStack, I work on a variety of projects, from &lt;a href="https://github.com/QuantStack/xtensor"&gt;xtensor&lt;/a&gt; and &lt;a href="https://github.com/QuantStack/xeus-python/"&gt;xeus-python&lt;/a&gt; in C++ to &lt;a href="https://github.com/jupyter-widgets/ipyleaflet"&gt;ipyleaflet&lt;/a&gt; and &lt;a href="https://github.com/bqplot/bqplot"&gt;bqplot&lt;/a&gt; in Python and JavaScript/TypeScript.&lt;/p&gt;
</content><category term="IPython"/><category term="kernels"/><category term="xeus"/></entry><entry><title>IPython 7.0, Async REPL</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2018/ipython-7-0-async-repl/" rel="alternate"/><published>2018-09-27T17:41:00+00:00</published><updated>2018-09-27T17:41:00+00:00</updated><author><name>M Bussonnier</name></author><id>tag:jasongrout.github.io,2018-09-27:/medium-archive/pelican/posts/2018/ipython-7-0-async-repl/</id><summary type="html">&lt;p&gt;Today we are pleased to announce the release of IPython 7.0, the powerful Python interactive shell that goes above and beyond the default…&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Today we are pleased to announce the release of &lt;a href="https://ipython.readthedocs.io/"&gt;IPython 7.0, the powerful Python interactive shell&lt;/a&gt; that goes above and beyond the default Python REPL with advanced tab completion, syntactic coloration, and more. It’s the jupyter kernel for python used by millions of users, hopefully including you. This is the second major release of IPython since we stopped support for Python 2.&lt;/p&gt;
&lt;p&gt;Not having to support Python 2 allowed us to make full use of new Python 3 features and bring never before seen capability in a Python Console. We are still encouraging library authors and users to look at the &lt;a href="https://python3statement.org/"&gt;Python 3 Statement&lt;/a&gt; to learn about the end of life of Python 2 and how to stop support for Python 2 &lt;strong&gt;without breaking installation for Python 2 end users&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;As developers and maintainers of IPython, it was a large gain of time to be able to only develop for a single version of python. Avoiding the use of conditional imports, being able to rely on type annotations, and make use of the newly available Python APIs were some of the advantages that made us more productive. Especially as most of the work on IPython is done by volunteers who work on nights and weekends, with only a couple of minutes here and there, this often made the difference between a patch reaching completion, or the contributor moving on to other pastures.&lt;/p&gt;
&lt;p&gt;One of the core features we focused on for this release is the ability to (ab)use the &lt;em&gt;async&lt;/em&gt; and &lt;em&gt;await&lt;/em&gt; syntax available in Python 3.5+. There are of course many other improvements in this release you can read about in the &lt;a href="https://ipython.readthedocs.io/en/stable/whatsnew/index.html"&gt;what’s new&lt;/a&gt;.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Demo of awaiting coroutine in IPython 7.0" src="https://jasongrout.github.io/medium-archive/pelican/posts/2018/ipython-7-0-async-repl/images/001-1_b4zaYTEIjve8x2-BlaPmNQ.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Demo of awaiting coroutine in IPython 7.0&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;TL;DR: You can now use &lt;em&gt;async&lt;/em&gt;/&lt;em&gt;await&lt;/em&gt; at the top level in the IPython terminal and in the notebook, it should — in most of the cases — “just work”. Update IPython to version 7+, IPykernel to version 5+, and you’re off to the races.&lt;/p&gt;
&lt;p&gt;See how to &lt;strong&gt;install IPython by reading the “&lt;/strong&gt;&lt;a href="https://ipython.readthedocs.io/en/stable/whatsnew/index.html"&gt;&lt;strong&gt;what’s new&lt;/strong&gt;&lt;/a&gt;”.&lt;/p&gt;
&lt;p&gt;The recipes are currently building on conda-forge and should be available soon. For the time being you can install it via pip:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$ pip install ipython ipykernel --upgrade&lt;/code&gt;&lt;/p&gt;
&lt;h3 id="a-primer-on-concurrency"&gt;A Primer on concurrency&lt;/h3&gt;
&lt;p&gt;You may have heard about &lt;em&gt;async&lt;/em&gt;/&lt;em&gt;await&lt;/em&gt;, threads, concurrency, preemptive scheduling and cooperative scheduling without really understanding what all this is about. If you are not familiar will all the above terms, all the hype may be confusing so let’s talk about concurrency in a really high level way.&lt;/p&gt;
&lt;p&gt;Typically when your computer needs to execute many tasks, it will switch between them really fast, so from the human point of view it looks like everything is being processed at the same time. There are two main ways of doing so under the hood: &lt;em&gt;Preemptive&lt;/em&gt; Scheduling, and &lt;em&gt;Cooperative&lt;/em&gt; Scheduling.&lt;/p&gt;
&lt;p&gt;With preemptive scheduling changing tasks can happen &lt;strong&gt;at any time&lt;/strong&gt;. For example, while writing this blog post, I could stop in the middle of a word to start writing an email, which will itself be interrupted to check Gitter/Slack, before coming back, writing 5 words and stopping to get dinner.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="TL;DR: Concurrency (from Geek And Poke, 2009)" src="https://jasongrout.github.io/medium-archive/pelican/posts/2018/ipython-7-0-async-repl/images/002-1_Ewlg0l4stoFZ_fQUtKffNg.jpeg" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;TL;DR: Concurrency (from &lt;a href="http://geek-and-poke.com/geekandpoke/2012/9/3/simply-explained.html"&gt;Geek And Poke&lt;/a&gt;, 2009)&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;With &lt;em&gt;cooperative&lt;/em&gt; scheduling, the task switches can happen &lt;strong&gt;only at agreed spots&lt;/strong&gt;. The term co-operative comes from the fact that tasks need to co-operate for the whole process to function. If a task decides to never take a break to let you to do something else, the illusion of many tasks being completed at once disappears.&lt;/p&gt;
&lt;p&gt;Each approach has its own advantages and drawbacks, and we will not focus on these. Let’s just say that with co-operative scheduling &lt;em&gt;async&lt;/em&gt;/&lt;em&gt;await&lt;/em&gt; let you mark the areas where interruption is allowed to occur.&lt;/p&gt;
&lt;p&gt;Moreover, &lt;em&gt;async&lt;/em&gt;/&lt;em&gt;await&lt;/em&gt; syntax allows cooperative scheduling in Python in a way that lets you write code that &lt;em&gt;looks&lt;/em&gt; synchronous (without task switches), while actually being able to be interrupted, from the point of view of the computer. It also keeps the programmers from having to worry about global state changing under their feet, as this can occur &lt;em&gt;only&lt;/em&gt; at the proximity of &lt;code&gt;await&lt;/code&gt; keywords.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;When going to a restaurant, social conventions (and common sense) tell us when and how these interactions can or cannot be interrupted, but programming languages need markers when using cooperative scheduling. These are &lt;/code&gt;async&lt;code&gt;and&lt;/code&gt;await&lt;code&gt;keywords in Python.&lt;/code&gt;Async&lt;code&gt;marks a function that *may* be interrupted,&lt;/code&gt;await&lt;code&gt;is required to call async-functions (aka&lt;/code&gt;coroutine`) and marks a point were task can be switched.&lt;/p&gt;
&lt;p&gt;If you want to learn more we strongly recommend reading the &lt;a href="https://trio.readthedocs.io/en/latest/tutorial.html"&gt;Trio Tutorial Primer on async programming&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="async-in-the-python-world"&gt;&lt;strong&gt;Async in the Python world&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;In the current Python ecosystem, packages tend to standardize around &lt;a href="https://docs.python.org/3/library/asyncio.html"&gt;AsyncIO&lt;/a&gt;, provided in the Python standard library. AsyncIO can sometimes be judged as &lt;a href="https://whatisjasongoldstein.com/writing/im-too-stupid-for-asyncio/"&gt;complex&lt;/a&gt; even by &lt;a href="http://lucumr.pocoo.org/2016/10/30/i-dont-understand-asyncio/"&gt;well known developers&lt;/a&gt;; this is in part due to the necessity of supporting other older asynchronous projects like &lt;a href="https://twistedmatrix.com/trac/"&gt;twisted&lt;/a&gt; or &lt;a href="http://www.tornadoweb.org/en/stable/"&gt;tornado&lt;/a&gt;, but it’s also what makes a lots of its power: One event loop to rule them all.&lt;/p&gt;
&lt;p&gt;Running a single async task requires you to learn about AsyncIO, write a non negligible amount of boilerplate code in order to fetch a single result. This can be especially cumbersome when doing interactive exploration, and likely will keep users from experimenting with AsyncIO code.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="How to run a single async task in Python repl without async integration." src="https://jasongrout.github.io/medium-archive/pelican/posts/2018/ipython-7-0-async-repl/images/003-1_9PXwxCxpLs4BGcR0koHOww.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;How to run a single async task in Python repl without async integration.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;As Raymond Hettinger would says (slamming hand on podium): “There must be a better way”.&lt;/p&gt;
&lt;h2 id="ipython-asyncio-integration"&gt;IPython AsyncIO Integration&lt;/h2&gt;
&lt;p&gt;Thanks to a multiple month effort (actually this work started close to &lt;a href="https://github.com/ipython/ipython/pull/10390"&gt;2 years ago&lt;/a&gt;), and the work of many talented people, you can now directly await code in the REPL and IPython will do “the right thing”.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Awaiting AsyncIO code should now automagically work." src="https://jasongrout.github.io/medium-archive/pelican/posts/2018/ipython-7-0-async-repl/images/004-1_I3tXhrFw1SJYMmm3nghj0Q.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Awaiting AsyncIO code should now automagically work.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;With the new integration, you don’t have to import or learn about asyncio, deal with the loop yourself, or wrap your task in its own function. You are now able to just focus on the business logic and move along.&lt;/p&gt;
&lt;p&gt;The only thing you need to remember is: &lt;em&gt;&lt;strong&gt;If it is an async function you need to await it.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;We hope that this will free users to experiment and play with asynchronous programming. Of course this will not magically make your code faster, or run in parallel, simply easier to write and reason about.&lt;/p&gt;
&lt;h2 id="other-async-libraries-aka-curio-and-trio-integration"&gt;Other Async Libraries (aka: curio and trio integration)&lt;/h2&gt;
&lt;p&gt;The addition of &lt;code&gt;async&lt;/code&gt; and &lt;code&gt;await&lt;/code&gt; keyword in Python did not only simplify the use of asynchronous programing and the standardization around &lt;code&gt;asyncio&lt;/code&gt;; it also allowed experimentation with new paradigms for asynchronous libraries. David Beazley created &lt;a href="https://github.com/dabeaz/curio"&gt;Curio&lt;/a&gt;, and Nathaniel Smith &lt;a href="https://trio.readthedocs.io/en/latest/"&gt;Trio&lt;/a&gt;, which both explore new ways to write asynchronous programs and explore how &lt;code&gt;async&lt;/code&gt;, &lt;code&gt;await&lt;/code&gt; and &lt;em&gt;coroutines&lt;/em&gt; could be used when starting from a blank slate. The Trio &lt;a href="https://trio.readthedocs.io/en/latest/"&gt;documentation introduction&lt;/a&gt; and which problems it attempt to solve [&lt;a href="https://vorpus.org/blog/some-thoughts-on-asynchronous-api-design-in-a-post-asyncawait-world/"&gt;1&lt;/a&gt;, &lt;a href="https://vorpus.org/blog/announcing-trio/"&gt;2&lt;/a&gt;, &lt;a href="https://vorpus.org/blog/control-c-handling-in-python-and-trio/"&gt;3&lt;/a&gt;, &lt;a href="https://vorpus.org/blog/timeouts-and-cancellation-for-humans/"&gt;4&lt;/a&gt;, &lt;a href="https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/"&gt;5&lt;/a&gt;, &lt;a href="https://vorpus.org/blog/companion-post-for-my-pycon-2018-talk-on-async-concurrency-using-trio/"&gt;6&lt;/a&gt;] are highly recommended reading with varying level of technicality.&lt;/p&gt;
&lt;p&gt;Interactive uses of libraries is key to getting insight and intuition on how a system works, intuition is critical to rapid prototyping, development and creation of higher levels of abstraction. It was natural for us to build support for Curio, Trio, (and potentially new other async libraries) into IPython.&lt;/p&gt;
&lt;p&gt;You can setup IPython to run async code via Curio, or Trio and experiment or write production code using these libraries. To do so use the &lt;code&gt;%autoawait&lt;/code&gt; magic, and tell it which library to use.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Defining an asynchronous function and spawning multiple concurrent task in IPython using Trio." src="https://jasongrout.github.io/medium-archive/pelican/posts/2018/ipython-7-0-async-repl/images/005-1_LBoQBdKymSQYv_k1Yb1jAg.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Defining an asynchronous function and spawning multiple concurrent task in IPython using Trio.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;As you can see code looks really natural, and it is easy to forget that the above snippet is usually a syntax error in Python or older version of IPython. The astute reader and IPython expert will have suggested to use the &lt;em&gt;%%time&lt;/em&gt; cell magic instead of doing it manually, though a couple of magics still need updates to properly handle async code. We look forward to your contribution on this front, and are excited to see what you can come up with.&lt;/p&gt;
&lt;h2 id="async-in-notebooks-and-other-jupyter-clients"&gt;Async in Notebooks (and other Jupyter Clients)&lt;/h2&gt;
&lt;p&gt;If you are a Jupyter user, you most likely use a Notebook interface, and interact with IPython via the ipykernel package.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Using AsyncIO in nteract desktop works out of the box with newer IPython and IPykernel" src="https://jasongrout.github.io/medium-archive/pelican/posts/2018/ipython-7-0-async-repl/images/006-1_aJEDRVPyMtyaiDQGXsx6-w.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Using AsyncIO in &lt;a href="https://nteract.io/"&gt;nteract desktop&lt;/a&gt; works out of the box with newer IPython and IPykernel&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;We’ve been working hard on making &lt;em&gt;async&lt;/em&gt; code work in a notebook when using ipykernel. While most of the heavy lifting was done in IPython, the work in IPykernel was non-negligible, and required the accommodation of a number of use cases, which are not working. You now have to &lt;strong&gt;update&lt;/strong&gt; both &lt;strong&gt;IPython&lt;/strong&gt; to 7.0+ &lt;strong&gt;and ipykernel&lt;/strong&gt; to version 5.0+ for async to be available. If you are using pip: &lt;code&gt;$ pip install IPython ipykernel --update&lt;/code&gt;. As for conda, the packages should be available on &lt;a href="https://conda-forge.org/"&gt;conda-forge&lt;/a&gt; soon. With these new releases, &lt;code&gt;async&lt;/code&gt; will work with all the frontends that support the Jupyter Protocol, including the classic Notebook, JupyterLab, Hydrogen, nteract desktop, and &lt;a href="https://blog.nteract.io/nteract-on-jupyter-53cc2c38290d"&gt;nteract web&lt;/a&gt;. The default code will run in the existing asyncio/tornado loop that runs the kernel. Integration with Trio and Curio is still available, but tasks will not be interleaved with the asyncio one — at least not yet. We welcome work on this front.&lt;/p&gt;
&lt;p&gt;Submitting background tasks still requires you to access the asyncio event loop, and we are still be looking for contributions on this front as well, to make it even easier to run async code.&lt;/p&gt;
&lt;p&gt;There are still some question on how to handle nested asyncio eventloop. It is indeed usually impossible to run nested eventloop, in the case of &lt;code&gt;asyncio&lt;/code&gt;, trying to do so raises a &lt;code&gt;RuntimeError&lt;/code&gt; the kernel already ran in and asyncio eventloop, calling directly or indirectly &lt;code&gt;loop.run_until_complete&lt;/code&gt; and alike is not possible. There are discussions to use libraries like &lt;code&gt;nest_asyncio&lt;/code&gt; as pointed out on &lt;a href="https://github.com/jupyter/notebook/issues/3397#issuecomment-419386811"&gt;this comment&lt;/a&gt;, but until those are more battle tested we do not want to commit a default solution in the core of IPython and let the ecosystem develop.&lt;/p&gt;
&lt;h2 id="future-improvements"&gt;Future improvements&lt;/h2&gt;
&lt;p&gt;As far as we know, this is the first Async-aware Python REPL, and libraries like Trio/Curio are still young, thus there are still a number of use-cases we have not yet even thought about! We are encouraging you to come forward to talk about your use cases, what you tried and what did not work. There is also a number of new features to implement (making magics work with &lt;code&gt;async&lt;/code&gt;, tab completion, background tasks) on which we would welcome new contributors.&lt;/p&gt;
</content><category term="IPython"/><category term="releases"/></entry><entry><title>Release of IPython 5.5 and 6.2</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2017/release-of-ipython-5-5-and-6-2/" rel="alternate"/><published>2017-09-15T18:42:00+00:00</published><updated>2017-09-15T18:42:00+00:00</updated><author><name>M Bussonnier</name></author><id>tag:jasongrout.github.io,2017-09-15:/medium-archive/pelican/posts/2017/release-of-ipython-5-5-and-6-2/</id><summary type="html">&lt;p&gt;Four month after releasing IPython 6.1 and 5.4, and a couple of hours after the release of the notebook 5.1, we are happy to announce the…&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Four month after releasing IPython 6.1 and 5.4, and a couple of hours after the release of the notebook 5.1, we are happy to announce the release of IPython 6.2 (Python 3 only), and it’s cousin IPython 5.5 still compatible with Python 2.7.&lt;/p&gt;
&lt;p&gt;You can update now by using:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install --upgrade ipython
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you have a recent enough version of pip you will get the latest compatible version of IPython regardless of the version of Python you are running.&lt;/p&gt;
&lt;p&gt;The conda packages are on their way; once available you will be able to update with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;conda install ipython
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="new-features"&gt;New Features&lt;/h2&gt;
&lt;p&gt;As IPython 6.2 and 5.5 are minor releases you will only find a small number of new features. When API additions were done on IPython 6.2 they were backported on 5.5 to simplify the maintenance of code compatible both with Python 2.7 and 3+. You can find the full list of new features in the &lt;a href="http://ipython.readthedocs.io/en/stable/whatsnew/version6.html"&gt;changelog&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As a quick teaser, IPython 6.2 can now:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show function signature in the terminal while completing.&lt;/li&gt;
&lt;li&gt;Assignments can trigger the display mechanism&lt;/li&gt;
&lt;li&gt;IPdb can be called recursively&lt;/li&gt;
&lt;li&gt;Support for system-wide configuration&lt;/li&gt;
&lt;li&gt;Built-in support for Progress Bar.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Head &lt;a href="http://ipython.readthedocs.io/en/stable/whatsnew/version6.html#ipython-6-2"&gt;there&lt;/a&gt; for more complete description.&lt;/p&gt;
&lt;h2 id="slowing-down-backports-to-5x"&gt;Slowing down backports to 5.x&lt;/h2&gt;
&lt;p&gt;As stated on our &lt;a href="https://github.com/jupyter/roadmap/blob/master/accepted/migration-to-python-3-only.md"&gt;roadmap&lt;/a&gt;, we’ll keep releasing a 5.x for some time, though starting at end of year. However, we will decrease our active involvement in fixing bugs affecting the 5.x branch. We will still accept PRs, and backport if you nicely ask us. Releases will happen occasionally if fixes are available, but we will be sunsetting the Python 2 support slowly.&lt;/p&gt;
&lt;p&gt;If you are interested in further maintenance of the 5.x branch, we would love help with that work. Feel free to contact us on GitHub.&lt;/p&gt;
&lt;h2 id="whats-next"&gt;What’s next ?&lt;/h2&gt;
&lt;p&gt;We are going to start thinking about IPython 7, and start to embrace more of the Python 3 only features. Slowing down backports should allow us to be more confident that changes will not affect the automatic application of patches on old branches. Trimming down old legacy code may also help to regain some speed on interpreter startup, and should lead to plenty of opportunities for new contributors to join.&lt;/p&gt;
&lt;p&gt;We will also try to simplify our documentation, and make often requested sections easier to find.&lt;/p&gt;
&lt;p&gt;If you are looking for a project to contribute to – code, documentation, example, design, helping others, feel free to contact us so we can guide you through the process.&lt;/p&gt;
&lt;p&gt;Enjoy this new release, and hope to see you around the mailing list and bug tracker!&lt;/p&gt;
</content><category term="IPython"/><category term="releases"/></entry><entry><title>Release of IPython 5.4, 6.1, and rlipython.</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2017/release-of-ipython-5-4-6-1-and-rlipython-2/" rel="alternate"/><published>2017-05-31T22:47:00+00:00</published><updated>2017-05-31T22:47:00+00:00</updated><author><name>Matthias Bussonnier</name></author><id>tag:jasongrout.github.io,2017-05-31:/medium-archive/pelican/posts/2017/release-of-ipython-5-4-6-1-and-rlipython-2/</id><summary type="html">&lt;p&gt;Slightly over a month ago we released IPython 6.0 : the first version of IPython to be compatible only with Python 3. The reception of IPython 6.0 was great, and the codebase way more maintainable. So while 6.0 was mostly focused on internal refactoring and working upstream to&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Slightly over a month ago we &lt;a href="/posts/2017/release-of-ipython-6-0/"&gt;released IPython 6.0&lt;/a&gt; : the first version of IPython to be compatible only with Python 3. The reception of IPython 6.0 was great, and the codebase way more maintainable. So while 6.0 was mostly focused on internal refactoring and working upstream to make the release of a Python 3 only version possible, the next releases can focus on bug fixes and new features. Today we not only have the new release of IPython 6.1, but IPython 5.4 as well (the LTS branch targeting Python 2.7). Read on for more information! As usual, you can upgrade using pip and the 🔥 Conda Forge 🔥 builder is warming up: IPython 5.4, and 6.1 should be available via these channels soon.&lt;/p&gt;
&lt;h2 id="ipython-54-and-61-major-new-features"&gt;IPython 5.4 (and 6.1) major new features&lt;/h2&gt;
&lt;p&gt;IPython 5.x is the LTS branch which is still compatible with Python 2. The IPython team ♥️ Python 2 users so we continue to make fixes to our 5.x branch. You can install it today by making sure you have pip 9 or above:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;pip&lt;span class="w"&gt; &lt;/span&gt;--version
pip&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;9&lt;/span&gt;.0.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then upgrade IPython:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;ipython&lt;span class="w"&gt; &lt;/span&gt;--upgrade
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you do not have pip 9 and are using Python 2, pip may download IPython 6, which will not work on your system. If you are on Python 3, see the next section to upgrade to IPython 6.1 but read on in this section for the new features.&lt;/p&gt;
&lt;p&gt;IPython 5.4 got a number of new features that went into 6.0, plus a number of API improvements from 6.1 allowing the underlying library to target both 5.4+ (Python 2+3) and 6.1+ (Python 3) without having conditional branches. This should make the transition easier for users and developers&lt;/p&gt;
&lt;p&gt;You can see the what’s new for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://ipython.readthedocs.io/en/stable/whatsnew/version5.html"&gt;IPython 5.x&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://ipython.readthedocs.io/en/stable/whatsnew/version6.html"&gt;IPython 6.x&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="terminalipythonappinteractive_shell_class"&gt;&lt;code&gt;TerminalIPythonApp.interactive_shell_class&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;In 6.0 and 5.4 IPython gained a new &lt;code&gt;c.TerminalIPythonApp.interactive_shell_class&lt;/code&gt; option, to customize the class used to start the terminal frontend. This should enable you to use custom interfaces, such as reviving the former readline interface which is now a separate package. See the next section for more.&lt;/p&gt;
&lt;h3 id="define-_repr_mimebundle_"&gt;Define &lt;code&gt;_repr_mimebundle_&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;In IPython 6.1+ and 5.4+ object can now define &lt;code&gt;_repr_mimebundle_&lt;/code&gt; in place of multiple &lt;code&gt;_repr_*_&lt;/code&gt; methods and return a dictionary of MIME types and MIME data for rich display. IPython provides &lt;code&gt;_ipython_display_&lt;/code&gt; but this mechanism was complex and difficult to use for frontends with different architectures, such as &lt;a href="https://nteract.io"&gt;nteract&lt;/a&gt; and &lt;a href="https://atom.io/packages/hydrogen"&gt;hydrogen&lt;/a&gt;. This new &lt;code&gt;_repr_mimebundlde_&lt;/code&gt; methods are thus simpler for both backend and frontends developers to implement, and are already handled in projects like &lt;a href="https://nteract.io"&gt;nteract&lt;/a&gt;. Our own &lt;a href="https://github.com/jupyterlab/jupyterlab"&gt;JupyterLab&lt;/a&gt;, the next-generation evolution of the Jupyter Notebook, takes full advantage of these capabilities to expose rich and flexible data display capabilities that work not only in notebook documents, but across all of JupyterLab.&lt;/p&gt;
&lt;p&gt;This new model will simplify things for client implementations and will facilitate the publication of custom mimetypes (GeoJson, Plotly, DataFrames, etc.). See the &lt;a href="http://nbviewer.jupyter.org/github/ipython/ipython/blob/6.x/examples/IPython%20Kernel/Custom%20Display%20Logic.ipynb"&gt;&lt;code&gt;Custom Display Logic&lt;/code&gt;&lt;/a&gt; example notebook for examples and technical details.&lt;/p&gt;
&lt;h3 id="execution-heuristics"&gt;Execution Heuristics&lt;/h3&gt;
&lt;p&gt;In IPython 5.4+ and 6.1 +, the heuristic for execution in the command line interface is now more biased toward executing for single statement. Use &lt;code&gt;Ctrl-O&lt;/code&gt; to force the insertion of a new line. The execution semantics of &lt;code&gt;Enter&lt;/code&gt; were still debated, so if you like to configure that you can define your own function which decides what to do.&lt;/p&gt;
&lt;h3 id="display-ids"&gt;Display IDs&lt;/h3&gt;
&lt;p&gt;IPython 5.4 and 6.1+ implement display ids, which can be used to update a displayed object. This should provide simple patterns to implement common cases of dynamic display updates (see &lt;a href="http://nbviewer.jupyter.org/github/ipython/ipython/blob/6.x/examples/IPython%20Kernel/Updating%20Displays.ipynb"&gt;&lt;code&gt;Updating Displays.ipynb&lt;/code&gt;&lt;/a&gt; notebook). It will also simplify the implementation of some types of interactive user interface elements, such as progress-bars. Display objects with IDs can be updated from other cells or frontends.&lt;/p&gt;
&lt;h3 id="the-display-function-is-now-always-available"&gt;The display function is now always available&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;display()&lt;/code&gt; function is now available by default in the IPython session, without users having to import anything. &lt;code&gt;display()&lt;/code&gt; is the &amp;quot;moral equivalent” of &lt;code&gt;print()&lt;/code&gt;, but takes advantage of the rich display capabilities of Jupyter (and defaults to printing a string for objects lacking rich representations). By making &lt;code&gt;display()&lt;/code&gt; appear, in practice, as if it was built-in, we hope to encourage library authors to provide their objects with rich and informative representations that users can now more conveniently access, whether at the IPython REPL or in any of the richer clients in the Jupyter ecosystem (JupyterLab, classic Notebook, nteract, etc.). Note that this automatic import of &lt;code&gt;display()&lt;/code&gt; is only done in the live IPython kernel; scripts and libraries that rely on display and may be run outside of IPython still need to import it using &lt;code&gt;from IPython.display import display&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="rlipython"&gt;Rlipython&lt;/h2&gt;
&lt;p&gt;Many users were pleased with the transition from readline to &lt;a href="http://ipython.readthedocs.io/en/stable/whatsnew/version5.html#ipython-5-0"&gt;&lt;code&gt;prompt_toolkit&lt;/code&gt; for IPython 5.0&lt;/a&gt;, this gave IPython multiline editing, nice completion and highlighting as you type. Still some users are missing the old readline interface (for its reactiveness an custom keybindings) though are still using IPython 4.x series.&lt;/p&gt;
&lt;p&gt;While prompt toolkit is still the default interface, you can now use the new configuration option &lt;code&gt;c.TerminalIPythonApp.interactive_shell_class&lt;/code&gt; .With this you can now replace the Prompt_Toolkit interface. For one of your liking.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://pypi.org/project/rlipython/"&gt;Rlipython&lt;/a&gt; is one of these alternative interface that resurect readline and is lighter, and more responsive on some system than default IPython. Using it still give you most of the new features of IPython 5.x or 6.x ! This should also please many of our users who use vi keybinding in terminals as this should respect &lt;code&gt;.inputrc&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To try rlipython, install it with pip,&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;rlipython
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And follow the &lt;a href="https://pypi.org/project/rlipython/"&gt;instructions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We look forward to your contribution and please give lots of 💖 by to &lt;a href="https://twitter.com/ivanov/status/864918036628869124"&gt;@ivanov (tweet)&lt;/a&gt; for making this possible.&lt;/p&gt;
&lt;h2 id="ipython-61-and-python-3-only-features"&gt;IPython 6.1 and Python 3 only features&lt;/h2&gt;
&lt;p&gt;IPython 6.1 is the first minor release of our Python 3 only branch, it is the branch that get the most work, and start to use great new features such as type annotations, async/await [more to be added]. You can install it today please upgrade pip to pip 9 if you can, then upgrade IPython:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;ipython&lt;span class="w"&gt; &lt;/span&gt;--upgrade
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You’ll get &lt;strong&gt;all the new features in 5.4&lt;/strong&gt;, some of which are already in IPython 6.0, plus a number of additional enhancements:&lt;/p&gt;
&lt;p&gt;You can read more on the what’s new for IPython 6 &lt;a href="http://ipython.readthedocs.io/en/stable/whatsnew/version6.html"&gt;what’s new&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In this release, we had a number of bug fixes and improvements from developers at &lt;a href="https://www.twosigma.com/"&gt;TwoSigma&lt;/a&gt;, who participated in an internal open-source hackathon for Jupyter/IPython in May. Hackathon attendees tackled some long standing, hard to debug issues, and feature requests. Among these:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Quotes in a filename are always escaped during tab-completion on non-Windows, which should make many of our windows users happy. As none of the core devs use windows this one needed someone to simply use some elbow grease!&lt;/li&gt;
&lt;li&gt;Variables now shadow magics in autocompletion which make autocompletion of things like &lt;code&gt;matplotlib&lt;/code&gt; simpler and less surprising. - Magic aliases can now have parameters.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;??&lt;/code&gt; /&lt;code&gt;pinfo2&lt;/code&gt; machinery will show docstrings if source can’t be retrieved.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The completer also got a number of small improvements, and is smarter in many cases. For example, it understands the arguments to the &lt;code&gt;%config&lt;/code&gt; and &lt;code&gt;%colors&lt;/code&gt; magics. Long methods and &lt;code&gt;snake_case&lt;/code&gt; function names can now be completed from abbreviations. For example, if &lt;code&gt;foo_bar_kitten&lt;/code&gt; is an existing object, &lt;code&gt;f_b&amp;lt;tab&amp;gt;&lt;/code&gt; will find it as a possible completion.&lt;/p&gt;
&lt;p&gt;Look out for a blog post from TwoSigma.&lt;/p&gt;
&lt;p&gt;Only a small number of improvements are describe here, and we encourage you to read the full change logs if you want to know more.&lt;/p&gt;
&lt;p&gt;We hope that all these releases will make you more productive. We welcome your contributions, and questions. Feel free to open issues on GitHub, we’ll do our best to respond.&lt;/p&gt;
</content><category term="IPython"/><category term="releases"/></entry><entry><title>Release of IPython 6.0</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2017/release-of-ipython-6-0/" rel="alternate"/><published>2017-04-19T22:37:00+00:00</published><updated>2017-04-19T22:47:00+00:00</updated><author><name>Matthias Bussonnier</name></author><id>tag:jasongrout.github.io,2017-04-19:/medium-archive/pelican/posts/2017/release-of-ipython-6-0/</id><summary type="html">&lt;p&gt;It is with great pleasure that today we released IPython 6.0 — almost a year after the 5.0 version. Users on Python 3.3 and above can get this latest version with all its new features by asking your package manager to upgrade IPython. If you are using pip:&lt;/p&gt;
</summary><content type="html">&lt;p&gt;It is with great pleasure that today we released IPython 6.0 — almost a year after the 5.0 version.&lt;br&gt;
Users on Python 3.3 and above can get this latest version with all its &lt;a href="http://ipython.readthedocs.io/en/stable/whatsnew/version6.html"&gt;new features&lt;/a&gt; by asking your package manager to upgrade IPython. If you are using pip:&lt;/p&gt;
&lt;p&gt;Ensure you have pip 9+:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip --version
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;if not upgrade pip:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install pip --upgrade
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then upgrade IPython.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install ipython --upgrade
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;or if you have conda:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;conda update ipython
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It might take a few hours/days for the various conda channels to be updated.&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://ipython.readthedocs.io/en/stable/whatsnew/version6.html"&gt;What’s New&lt;/a&gt; page has an extensive description of the changes, which includes new, modified and deprecated features.&lt;/p&gt;
&lt;h2 id="highlighted-feature-jedi-completion"&gt;Highlighted feature: Jedi completion&lt;/h2&gt;
&lt;p&gt;One of the biggest changes is integration with &lt;a href="https://jedi.readthedocs.io/en/stable/"&gt;Jedi&lt;/a&gt;, which provides completions using static analysis, and can display completion types. This will provide a foundation for a richer tab completion experience (e.g., it allows extracting and displaying function signatures in the completer). As of now, these features are available only for command line users, but work is underway in &lt;a href="https://github.com/ipython/ipykernel/pull/222"&gt;IPykernel&lt;/a&gt; and in various frontends (like &lt;a href="https://github.com/nteract/nteract/pull/1650"&gt;nteract&lt;/a&gt;) to make use of these features.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2017/release-of-ipython-6-0/images/001-jedi_type_inference_60.webp" alt="Jedi integration" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;h1 id="sunsetting-python-2-support"&gt;Sunsetting Python 2 support&lt;/h1&gt;
&lt;p&gt;As we &lt;a href="/posts/2016/release-of-ipython-5-0/"&gt;announced&lt;/a&gt; last year when we released IPython 5.0, IPython 6 and above require Python 3. The 5.x branch is still maintained and will be regularly released, so Python 2 users will still see updates, but new features in IPython 6.x will not be backported.&lt;/p&gt;
&lt;p&gt;We have worked to make installing IPython on Python 2 and 3 as seamless as possible, but you may still encounter errors. If you do, please check the [readme](&lt;a href="https://github.com/ipython/ipython/blob/master/README.rst#ipython-requires-python-version-3-or-above"&gt;https://github.com/ipython/ipython/blob/master/README.rst&lt;/a&gt; and if you still have a problem, &lt;a href="https://github.com/ipython/ipython/issues"&gt;open an issue&lt;/a&gt; on Github.&lt;/p&gt;
&lt;p&gt;If you want to hear more about the process of creating a seamless Python 2 sunset and are planning on attending PyCon 2017, we encourage you to attend our talk “&lt;a href="https://us.pycon.org/2017/schedule/presentation/319/"&gt;Ending Py2/Py3 compatibility in a user friendly manner&lt;/a&gt;” on Saturday, May 20, 2017 at 15:15–16:00 PDT.&lt;/p&gt;
&lt;h2 id="make-sure-you-have-pip-9-or-above"&gt;Make sure you have Pip 9 or above&lt;/h2&gt;
&lt;p&gt;For most end users the only thing you should pay attention is to have &lt;strong&gt;pip version 9, or above&lt;/strong&gt;. To check your pip version, run:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip --version
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you have a version of pip older than 9.0.1, you should upgrade pip to its latest version &lt;strong&gt;before&lt;/strong&gt; upgrading ipython ****:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install pip --upgrade
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Pip 9+ will install the latest compatible version of IPython – that is to say IPython 5.x if you are on Python 2, and IPython 6.x if you are on Python 3. Make sure this is the case for &lt;strong&gt;all your Python environments&lt;/strong&gt;, and build scripts. Users of &lt;strong&gt;Ubuntu Trusty 14.04 LTS&lt;/strong&gt; should be aware that the default pip is too old and will not install the correct version of IPython. Don’t forget to upgrade pip in your various install script, continuous integration settings and docker images.&lt;/p&gt;
&lt;h2 id="the-python-3-statement"&gt;The Python 3 statement&lt;/h2&gt;
&lt;p&gt;We care deeply about the seamless coexistence of Python 2 and Python 3 software. This is one of the reasons we started this transition with a new release that is only available for Python 3, while still maintaining the 5.x release series, which is compatible with Python 2. If you want to read more about these reasons you can find more information at the &lt;a href="http://www.python3statement.org"&gt;python 3 statement&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As expected, we discovered many challenges and pitfalls as we moved from a single source to a Python3-only source. In the course of overcoming these obstacles, we learned a great deal. We have documented the the risks and errors you can encounter (and their solutions) at the &lt;a href="http://www.python3statement.org/practicalities/"&gt;practicalities section&lt;/a&gt; of the python 3 statement.&lt;/p&gt;
&lt;p&gt;If you are a library maintainer planning to stop support for an older version of Python (even a minor version), and you want to limit the frustration faced by users who use your library on the older version of Python, we could use your help! If you want to add to the resources available for trouble-shooting this transition, please join the conversation on our &lt;a href="https://github.com/python3statement/python3statement.github.io"&gt;GitHub repository&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="migrating-to-python3-only-source"&gt;Migrating to Python3-only source&lt;/h2&gt;
&lt;p&gt;The migration of the IPython source code to be Python3-only was not an easy task, and was – as far as we can tell – unexplored territory. But we’ve bitten the bullet and hopefully anticipated most of the problems that can arise. With this, we hope to make the transition easier for other projects who want to follow our lead.&lt;/p&gt;
&lt;p&gt;First, let’s speak about our personal experience writing Python3-only source code.&lt;/p&gt;
&lt;p&gt;The size of the IPython codebase has decreased by about 1500 lines of Python code relative to the last release. Of course, that’s not &lt;em&gt;solely&lt;/em&gt; due to the removal of Python 2 support, but a non-negligible amount &lt;em&gt;is&lt;/em&gt;. And this reduction is even more remarkable in light of completely new features that required adding hundreds of lines of code. A large number of conditionals are gone, making the code more straightforward, easier to read, and simpler to maintain. Across the codebase we saw improvements in code compactness just from removing utility functions that existed only to provide identical behavior across Python 2 and Python 3. Even then, parts of the codebase remain affected by “Python 2 code”, so the potential gains are even greater. We will continue our quest to remove things as we go, and, as usual, contributions are welcome.&lt;/p&gt;
&lt;p&gt;This change eases the burden on contributors to IPython. Contributors can can spend less time thinking “what about Python 2”, or rewriting a pull request because the Python 2 test suite fails. At the same time, our tests now complete more quickly on continuous integration services because they need to run on fewer versions of Python.&lt;/p&gt;
&lt;p&gt;A couple of new APIs are using type annotations, Python3-only syntax which, properly used, make the code clearer and easier to refactor, and allow the documentation to focus on usage / reason than to describe the types of the function. We can also make use of nifty Python 3 features like keyword-only arguments, which is definitely appreciated when designing APIs.&lt;/p&gt;
&lt;p&gt;From a developer point of view we are extremely pleased with having the possibility to write Python3-only code, and are looking forward to even more improvements like &lt;a href="https://docs.python.org/3/library/pathlib.html"&gt;pathlib&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="keeping-a-python-2-stable-branch"&gt;Keeping a Python 2 stable branch&lt;/h2&gt;
&lt;p&gt;Keeping a Python 2 stable branch, and making the install experience as seamless as possible for Python 2 users was a key point in our decision to migrate to requiring Python 3. One of our first questions was how could we make sure that Python 2 users using &lt;code&gt;pip install&lt;/code&gt; would get the latest 5.x version of IPython still compatible with their system (and &lt;em&gt;not&lt;/em&gt; the latest &amp;gt;6.x version that would &lt;em&gt;not&lt;/em&gt; be compatible)? This lead us to a number of upstream patches (&lt;strong&gt;we’re giving a talk at PyCon, come see us&lt;/strong&gt;) and a number of guides as to how to make the transitions as a seamless as possible. We patched &lt;a href="https://github.com/pypa/pip/pull/3877"&gt;pip&lt;/a&gt;, &lt;a href="https://github.com/pypa/pypi-legacy/pull/506"&gt;pypi-legacy&lt;/a&gt;, &lt;a href="https://github.com/pypa/warehouse/pull/1448"&gt;warehouse&lt;/a&gt; (we had to learn postgres for that one), amended peps and made use of recent improvements in setuptools to allow Python users to peacefully coexist. The only thing the user should need to do is to make sure to use &lt;code&gt;pip 9+&lt;/code&gt; , and to use &lt;code&gt;pip install .&lt;/code&gt; and &lt;code&gt;pip install -e .&lt;/code&gt; instead of invoking &lt;code&gt;setup.py&lt;/code&gt; directly.&lt;/p&gt;
&lt;h2 id="migrating-more-code-to-python3-only"&gt;Migrating more code to Python3-only&lt;/h2&gt;
&lt;p&gt;IPython is the first of the Python packages we maintain which has been migrated from Python 2+3 compatibility to requiring Python 3. Some of our more recent projects (like JupyterHub) have required Python 3 from their beginnings. We expect more Jupyter &amp;amp; IPython projects will move to requiring Python 3 in the future.&lt;/p&gt;
&lt;p&gt;As the Jupyter protocol is language agnostic, it is perfectly possible to run Python 2 code in a Python 2 kernel using a Notebook Server running on Python 3. Especially since JupyterHub already requires Python 3, we envisage that the single-user notebook server will follow suit soon.&lt;/p&gt;
&lt;h1 id="conclusion"&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;We hope you will enjoy this release. It will be the base for some awesome features, like async/await REPL. We hope our work in the packaging ecosystem will minimise the inevitable teething difficulties from our first release to require Python 3. We look forward for your feedback.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://news.ycombinator.com/item?id=14152454"&gt;HN&lt;/a&gt; and &lt;a href="https://www.reddit.com/r/Python/comments/66dq42/ipython_60_released_stop_python_2_support/"&gt;reddit&lt;/a&gt;&lt;/p&gt;
</content><category term="IPython"/><category term="releases"/></entry><entry><title>The Continued Existence of the Emacs IPython Notebook</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2017/the-continued-existence-of-the-emacs-ipython-notebook/" rel="alternate"/><published>2017-02-23T22:26:00+00:00</published><updated>2017-08-28T18:20:00+00:00</updated><author><name>Project Jupyter</name></author><id>tag:jasongrout.github.io,2017-02-23:/medium-archive/pelican/posts/2017/the-continued-existence-of-the-emacs-ipython-notebook/</id><summary type="html">&lt;p&gt;This is a guest post by John, who initially sent it to our mailing list; we believe that it’s an interesting story, so we wanted to share it on …&lt;/p&gt;
</summary><content type="html">&lt;p&gt;This is a guest post by John, who initially sent it to &lt;a href="https://groups.google.com/forum/?utm_medium=email&amp;amp;utm_source=footer#!msg/jupyter/TEbi0N4WTJo/I5MuImn-CgAJ"&gt;our mailing list&lt;/a&gt;; we believe that it’s an interesting story, so we wanted to share it on here on the blog.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;All,&lt;/p&gt;
&lt;p&gt;After the recent, exciting announcement of the eminent &lt;a href="https://conferences.oreilly.com/jupyter/jup-ny"&gt;JupyterCon&lt;/a&gt;, I was somewhat saddened to see no mention of the EIN, or the Emacs IPython Notebook, as an available client to the Jupyter notebook server. Drama queen that I am, I quickly wrote a note to Fernando, who patiently and kindly explained that not many were aware that this project still existed and that perhaps an announcement or note to the main Jupyter list might be warranted. Hence the following, brief history. I also promise to try to not be a drama queen.&lt;/p&gt;
&lt;p&gt;Some of you may remember, from back when the Jupyter project was still known as the &lt;a href="http://ipython.org/ipython-doc/rel-0.12/interactive/htmlnotebook.html"&gt;IPython notebook&lt;/a&gt;, a talented and prolific coder of the name Takafumi Arakaki, or &lt;a href="https://github.com/tkf"&gt;tkf&lt;/a&gt;, who created an alternative client to the notebook server’s default web browser interface.&lt;/p&gt;
&lt;p&gt;This client, which he called the Emacs IPython Notebook (you can still find his project &lt;a href="https://github.com/tkf/emacs-ipython-notebook"&gt;on GitHub&lt;/a&gt;), or EIN, provided a complete IPython notebook experience in the venerable Emacs editor. Not only was EIN nearly &lt;a href="https://github.com/tkf/emacs-ipython-notebook/wiki/Screenshots"&gt;feature complete&lt;/a&gt; when compared to the browser interface it also provided some useful features for the Python programmer, like allowing one to &lt;a href="https://github.com/tkf/emacs-ipython-notebook/wiki/Screenshots#connected-buffer"&gt;connect&lt;/a&gt; Python buffers to a notebook and using &lt;a href="https://jedi.readthedocs.io/"&gt;jedi&lt;/a&gt; for autocompletion in the notebook buffer.&lt;/p&gt;
&lt;p&gt;Around March/April of 2014, just as IPython was advancing towards 1.0 and making big changes in the notebook/contents API and the kernel communication protocol, tkf mysteriously stopped pushing commits to his github repository.&lt;/p&gt;
&lt;p&gt;I did not know tkf other than from a couple brief conversations. I sincerely hope tkf’s story has a happy end (he does appear to still push the occasional &lt;a href="https://github.com/tkf/comparatist"&gt;commit&lt;/a&gt;); he is clearly a talented programmer and without him this impressive piece of software would not exist.&lt;/p&gt;
&lt;p&gt;This is the point where yours truly enters the story. I had discovered the IPython notebook the previous year and had found it an exteremly useful for analyzing the performance of catalytic process units in the refining industry and for working with Python in general, but being a long-time Emacs user I had somewhat bounced of the web interface. Discovering EIN was a godsend, and it quickly became a mainstay in my set of analytic tools.&lt;/p&gt;
&lt;p&gt;Unfortunately the changes in going to v1.0 of the IPython notebook broke EIN, and with tkf apparently out of the picture there did not seem much hope in EIN staying compatible. Considering that I am a father of two with a full-time job that has absolutely nothing to do with programming (and yet I am a long-time Emacs user — it’s complicated, don’t ask), I can only describe what happened next as an act of complete insanity: I decided to fork tkf’s code, dig in and try to keep up with the changes in ipython.&lt;/p&gt;
&lt;p&gt;Truthfully, no one was more surprised than I when I was actually able to keep ein working with versions 1.0 and, soon after, 2.0 of IPython. In fact that compatibility, in theory, is still in the code. One, again in theory, should be able to fire up a 1.x or 2.x version of the IPython notebook and connect to it using my fork of EIN. I say in theory, though, as I haven’t touched that part of the code in some time and it undoubtedly has suffered some bit rot in the intervening years.&lt;/p&gt;
&lt;p&gt;The rest of the story is less interesting. Eventually I managed to convince GitHub and MELPA to treat my repository as the official version of ein. There was some short-lived talk of renaming my fork to ‘zwei’, but the consensus was that things were confusing enough with the change in ownership and to keep the name as ein.&lt;/p&gt;
&lt;p&gt;Currently one can download ein through either &lt;a href="http://melpa.org/#/ein"&gt;MELPA&lt;/a&gt; or &lt;a href="https://github.com/dimitri/el-get"&gt;el-get&lt;/a&gt;, and someone has even been kind enough to create a spacemacs &lt;a href="http://spacemacs.org/layers/+lang/ipython-notebook/README.html"&gt;layer&lt;/a&gt; with convenient VIM keybindings for the heathens.&lt;/p&gt;
&lt;p&gt;At the moment EIN supports the recent incarnations of Jupyter notebook, v4.3.1, token authentication, _xsrf cookies and all. By the time you read this I may even have pushed some commits that allow one to start and automatically log in to a jupyter notebook server all from Emacs without having to drop into the terminal.&lt;/p&gt;
&lt;p&gt;In all, EIN continues to be a viable alternative to the web browser client. It is not 100% feature complete, though, as it notably does not support widgets and quite possibly never will.&lt;/p&gt;
&lt;p&gt;I haven’t kept close track of who is using EIN, but as of this writing it has 341 stars on github and 28,175 downloads from MELPA. I know EIN is being used in at least a couple businesses and from what I have heard it tends to be more popular among those with a programming background — scientists and engineers tend to prefer the web client which is not surprising since Emacs is not so much a text editor as it is a Way of (Un)Life.&lt;/p&gt;
&lt;p&gt;I encourage anyone who is interested in trying out ein to install it via MELPA or from the Spacemacs ipython-notebook layer. For slightly more information see the &lt;a href="http://millejoh.github.io/emacs-ipython-notebook/#quick-try"&gt;Quick Try&lt;/a&gt; and &lt;a href="http://millejoh.github.io/emacs-ipython-notebook/#usage"&gt;Usage&lt;/a&gt; sections in the &lt;a href="http://millejoh.github.io/emacs-ipython-notebook/"&gt;documentation&lt;/a&gt;. The information there is not perfect but it is hopefully good enough to get you started with the tool. If you run into trouble do not hesitate to open an &lt;a href="https://github.com/millejoh/emacs-ipython-notebook/issues"&gt;issue&lt;/a&gt; on GitHub; this is a hobby project but I get a lot of joy working with this code and will do my best to support it.&lt;/p&gt;
&lt;p&gt;If you have made it this far then my sincere thanks for staying patient through my ramblings. As a parting thought I want to express my sincere thanks to Takafumi Arakaki, wherever he may be, and to the &lt;a href="http://jupyter.org/about.html"&gt;Jupyter&lt;/a&gt; team for their fantastic work in creating this amazing piece of software.&lt;/p&gt;
&lt;p&gt;John Miller&lt;/p&gt;
</content><category term="IPython"/><category term="Jupyter Notebook"/></entry><entry><title>Release of IPython 5.0</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2016/release-of-ipython-5-0/" rel="alternate"/><published>2016-07-08T06:56:00+00:00</published><updated>2017-08-28T18:20:00+00:00</updated><author><name>Project Jupyter</name></author><id>tag:jasongrout.github.io,2016-07-08:/medium-archive/pelican/posts/2016/release-of-ipython-5-0/</id><summary type="html">&lt;p&gt;IPython 5.0-LTS is out! We are pleased to announce the release of IPython 5.0 LTS (or Long Term Support). IPython is the Python kernel for Jupyter and the interactive Python …&lt;/p&gt;
</summary><content type="html">&lt;h2 id="ipython-50-lts-is-out"&gt;IPython 5.0-LTS is out!&lt;/h2&gt;
&lt;p&gt;We are pleased to announce the release of &lt;a href="https://pypi.python.org/pypi/ipython/5.0.0"&gt;&lt;strong&gt;IPython 5.0 LTS&lt;/strong&gt;&lt;/a&gt; (or Long Term Support). &lt;a href="http://ipython.org"&gt;IPython&lt;/a&gt; is the Python kernel for Jupyter and the interactive Python shell; it provides a rich set of features for fluid interactive computation in Python at the terminal, in the Jupyter Notebook and across all other clients that support the Jupyter architecture.&lt;/p&gt;
&lt;p&gt;This release has some exciting new features and lots of new development &lt;strong&gt;(227 commits by 27 contributors over 191 PRs)&lt;/strong&gt;. Most importantly, there have been significant improvements to the classic IPython command line interface.&lt;/p&gt;
&lt;p&gt;As usual you can try this new release with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install ipython --upgrade
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The package should also be available through conda and other package managers in the next few days.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; IPython is now developed under the umbrella of the broader Project Jupyter, but like other components of Jupyter, with its own independent schedule. Therefore, this release does not impact the Jupyter Notebook, Qt Console, nbconvert, or other packages that were formerly part of IPython.&lt;/p&gt;
&lt;h3 id="a-brand-new-terminal-interface"&gt;A brand new terminal interface&lt;/h3&gt;
&lt;p&gt;Decoupling IPython from the Jupyter Notebook package has allowed the core team to focus on improving the command line interface independently of the notebook. The awkward dependencies on pyreadline for Windows and gnureadline for Mac prompted Thomas Kluyver to replace the old machinery with a brand new pure-python readline replacement: &lt;code&gt;prompt_toolkit&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;prompt_toolkit&lt;/code&gt; package is an amazing library from &lt;a href="https://github.com/jonathanslenders"&gt;Jonathan Slenders&lt;/a&gt; and recently reached version 1.0. Going beyond readline, &lt;code&gt;prompt_toolkit&lt;/code&gt; provides many advanced features for editing text in the terminal that significantly improve the user experience. Since it is a cross-platform library, all our users on Linux/Unix, macOS and Windows benefit from these improvements. Thanks to &lt;code&gt;prompt_toolkit&lt;/code&gt;, IPython now supports:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Syntax highlighting as you type&lt;/li&gt;
&lt;li&gt;Real multi-line editing (up and down arrow keys move between lines)&lt;/li&gt;
&lt;li&gt;Multi-line paste without breaking indentation or immediately executing code&lt;/li&gt;
&lt;li&gt;Better code completion interface (we plan to improve that more)&lt;/li&gt;
&lt;li&gt;Optional mouse support&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2016/release-of-ipython-5-0/images/g001-Screen-Shot-2016-07-07-at-11-28-25-1.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;We’re not using all of the features of &lt;code&gt;prompt_toolkit&lt;/code&gt; yet, but after working with it for a few weeks, it already feels strange to go back to older versions of IPython without these improvements. We are hopeful that you will enjoy them. We’re extremely grateful to Jonathan Slenders, who has been super responsive with all our questions and feature requests!&lt;/p&gt;
&lt;p&gt;You can get a more detailed list of changes to expect by reading the &lt;a href="http://ipython.readthedocs.io/en/stable/whatsnew/version5.html"&gt;“What’s new in IPython 5.0”&lt;/a&gt; document.&lt;/p&gt;
&lt;h3 id="jupyter-console"&gt;Jupyter Console&lt;/h3&gt;
&lt;p&gt;The &lt;a href="https://pypi.python.org/pypi/jupyter_console"&gt;Jupyter Console&lt;/a&gt; provides the interactive client-side experience of IPython at the terminal, but with the ability to connect to &lt;em&gt;any&lt;/em&gt; Jupyter kernel instead of only to IPython. This lets you test any Jupyter Kernel you may have installed at the terminal, without needing to fire up a full-blown Notebook for it. The Jupyter console gained also most of the functionality described above and also makes use of &lt;code&gt;prompt_toolkit&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;A few days ago we released Jupyter Console 5.0 as well, which brings compatibility with IPython 5. If you are a Jupyter Console user you will need to upgrade as well.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;jupyter_console&lt;span class="w"&gt; &lt;/span&gt;--upgrade
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id="long-term-support-lts"&gt;Long Term Support (LTS)&lt;/h3&gt;
&lt;p&gt;You might have picked this up from the title of this blog post: IPython 5.x will be the first release series to get Long Term Support (hence the LTS name).&lt;/p&gt;
&lt;p&gt;With IPython, we usually only offer support for a single major release at a time; once a new major release comes out, previous major releases stop getting bug fixes. For the 5.x series releases we are making an exception to that rule: until the end of 2017 the core team will do its best to provide fixes for critical bugs in the 5.x release series. Beyond that, we will deprioritise this work, but we will continue to accept pull requests from the community to fix bugs through 2018 and 2019, and make releases when necessary.&lt;/p&gt;
&lt;p&gt;We hope that this will help organisations that need long term support for IPython version 5.x.&lt;/p&gt;
&lt;h3 id="end-of-support-for-python-2"&gt;End of support for Python 2&lt;/h3&gt;
&lt;p&gt;IPython has been compatible with Python 3 for several years, since Thomas Kluyver ported the codebase to be Python 3 compatible &lt;a href="https://github.com/ipython/ipython/pull/663"&gt;using 2to3&lt;/a&gt; in 2011, and we moved to a single-source codebase for Python 2 and 3 &lt;a href="https://github.com/ipython/ipython/pull/4438"&gt;in 2013&lt;/a&gt;. The day to day development of IPython is now completely done using Python 3, and we’re starting to accidentally break Python 2 compatibility until tests or users flag it. We’re also keen to use many of the new Python 3 features, such as type annotation, &lt;code&gt;yield from&lt;/code&gt;, &lt;code&gt;asyncio&lt;/code&gt;, &lt;code&gt;async def&lt;/code&gt;, &lt;code&gt;await&lt;/code&gt; and other improvements the language and its standard library have gained in recent years.&lt;/p&gt;
&lt;p&gt;We have therefore &lt;a href="https://github.com/jupyter/roadmap#last-ipython-version-compatible-with-python-2-and-lts"&gt;decided&lt;/a&gt; that IPython 5.x will be the last major version to support Python 2.&lt;/p&gt;
&lt;p&gt;This is, of course, why we are planning to support IPython 5.x for much longer than usual. We recognise that many people still use Python 2, and they will be able to continue with a supported version of IPython for several years, and transition at a time that suits them. Beyond the end of 2017 we are willing to provide minor bug fix releases in the 5.x with community contributed patches. Most importantly, no new features will be added to a Python 2 supported IPython beyond the upcoming 5.0 release.&lt;/p&gt;
&lt;p&gt;Thus, the next major version of IPython, &lt;strong&gt;IPython 6.x will require Python 3&lt;/strong&gt;. It will start to make use of new syntax, and shed the compatibility layer we have in place.&lt;/p&gt;
&lt;p&gt;If you are a Python 2 user, be reassured, we will make sure that upgrading does not unexpectedly install IPython 6.x and break your system. You can decide to stay for a longer period of time on IPython 5.x LTS and decide to leapfrog a few IPython versions once you migrate to Python 3, though we recommend keeping up to date with the latest stable versions as they are released, and of course to migrate to Python 3 when possible.&lt;/p&gt;
&lt;p&gt;IPython is the first IPython/Jupyter project to drop support for Python 2, but you can expect other components of IPython/Jupyter to follow. Since its inception, JupyterHub for example as always been Python 3 only.&lt;/p&gt;
&lt;p&gt;It is important to note that users will always be able to use a Python 2 kernel with the Jupyter Notebook, even when all of our projects have transitioned to Python 3: as part of our LTS commitment, we will make any necessary updates to the IPython kernel so it can continue to work in a Jupyter Notebook for the duration of our LTS support.&lt;/p&gt;
&lt;h2 id="help-us-with-the-python-3-transition"&gt;Help us with the Python 3 transition&lt;/h2&gt;
&lt;p&gt;We understand that migrating to Python 3 can be difficult for various reasons, and that planning ahead is often necessary. For this reason we are helping to gather a non-exhaustive list of projects that have decided to drop support for Python 2 in or before 2020, when support for Python 2.7 itself ends. Projects such as &lt;a href="http://matplotlib.org/"&gt;Matplotlib&lt;/a&gt; and &lt;a href="http://www.sympy.org/"&gt;SymPy&lt;/a&gt; plan to drop support in the next few years, while a few projects like &lt;a href="http://scikit-bio.org/"&gt;Scikit-Bio&lt;/a&gt; are already ahead of us, and should be Python 3 only soon.&lt;/p&gt;
&lt;p&gt;Thus we decided to sign the &lt;a href="https://python3statement.github.io"&gt;Python3 Statement&lt;/a&gt; that lists projects that are taking this step, as well as — when possible — provide a planned release schedule for which versions will still be Python 2 compatible, and which versions will be Python 2 only.&lt;/p&gt;
&lt;p&gt;If you’d like to add your project to this page, or you know a project that’s thinking about the Python 3 transition, please get in touch there. We believe that giving enough information to Python users as early as possible will help ease the transition.&lt;/p&gt;
&lt;h2 id="see-you-at-scipy"&gt;See you at SciPy!&lt;/h2&gt;
&lt;p&gt;Some of us will be at &lt;a href="http://scipy2016.scipy.org/"&gt;SciPy&lt;/a&gt; this year in Austin. We’ll be happy to meet with you, and hopefully run sprints on IPython and Jupyter projects. We hope to see you there.&lt;/p&gt;
&lt;p&gt;[Update] Friday July 8, 11 Pacific&lt;/p&gt;
&lt;p&gt;&lt;a href="https://news.ycombinator.com/item?id=12054165"&gt;Hackernews&lt;/a&gt; and &lt;a href="https://www.reddit.com/r/Python/comments/4rsy7t/release_of_ipython_50/"&gt;Reddit&lt;/a&gt; threads&lt;/p&gt;
</content><category term="IPython"/><category term="releases"/></entry><entry><title>Jupyter Ascending</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2015/jupyter-ascending/" rel="alternate"/><published>2015-08-12T05:48:00+00:00</published><updated>2017-08-28T18:20:00+00:00</updated><author><name>Project Jupyter</name></author><id>tag:jasongrout.github.io,2015-08-12:/medium-archive/pelican/posts/2015/jupyter-ascending/</id><summary type="html">&lt;p&gt;Today is an exciting day! We have just finished releasing IPython 4.0, the last piece of the first release of Jupyter and IPython after The Big Split™. The quick way to get …&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Today is an exciting day! We have just finished releasing IPython 4.0, the last piece of the first release of Jupyter and IPython after &lt;a href="/posts/2015/the-big-split/"&gt;The Big Split™&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The quick way to get Jupyter upgraded is:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install --upgrade jupyter
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you are using conda or canopy, we hope to have packages on those distros soon.&lt;/p&gt;
&lt;p&gt;This means that when you do&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;pip&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;--upgrade ipython[all]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You will get jupyter instead.&lt;/p&gt;
&lt;h3 id="refresher-on-the-big-splittm"&gt;Refresher on The Big Split™&lt;/h3&gt;
&lt;p&gt;IPython 3 was the last major monolithic release of IPython containing all of the language-agnostic code, such as the notebook, which is moving under the new name &lt;em&gt;Jupyter&lt;/em&gt;. As part of that process, we have created several discrete packages for each component — &lt;code&gt;nbformat&lt;/code&gt; for the notebook format, &lt;code&gt;nbconvert&lt;/code&gt; for the notebook conversion machinery, &lt;code&gt;notebook&lt;/code&gt; for the HTML notebook application, etc.&lt;/p&gt;
&lt;p&gt;You can get each of these components independently, e.g. with&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install --upgrade notebook
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;which will not include the pieces that the notebook doesn’t depend on (e.g. &lt;code&gt;qtconsole&lt;/code&gt;). Or you can get the whole thing with the &lt;code&gt;jupyter&lt;/code&gt; metapackage, which will pull in everything that was part of IPython 3 (with the exception of IPython parallel, now called &lt;code&gt;ipyparallel&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Since all of these packages were part of IPython 3, they are all starting out at 4.0. They won’t be updated in coordination with each other as their APIs and release schedules will be allowed to advance at their own respective paces.&lt;/p&gt;
&lt;p&gt;There are import shims in the IPython repo for backward-compatibility, so any code that imports &lt;code&gt;IPython.nbformat&lt;/code&gt;, for instance, should continue to work with a warning about the new home of the package:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;IPython.nbformat&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;read&lt;/span&gt;
&lt;span class="o"&gt;/.../&lt;/span&gt;&lt;span class="n"&gt;site&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;packages&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;IPython&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nbformat&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ShimWarning&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;The&lt;/span&gt; &lt;span class="err"&gt;`&lt;/span&gt;&lt;span class="n"&gt;IPython&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nbformat&lt;/span&gt;&lt;span class="err"&gt;`&lt;/span&gt; &lt;span class="n"&gt;package&lt;/span&gt; &lt;span class="n"&gt;has&lt;/span&gt; &lt;span class="n"&gt;been&lt;/span&gt; &lt;span class="n"&gt;deprecated&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;You&lt;/span&gt; &lt;span class="n"&gt;should&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;nbformat&lt;/span&gt; &lt;span class="n"&gt;instead&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you have any code that imported from the old subpackage that worked on 3.x but doesn’t on 4.x, please &lt;a href="https://github.com/ipython/ipython/issues"&gt;let us know&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This split also means that&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install ipython
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;gets you a much smaller install, since it only includes the terminal IPython interface, which some people have been asking for for a long time.&lt;/p&gt;
&lt;h3 id="configuration"&gt;Configuration&lt;/h3&gt;
&lt;p&gt;Many of the ipython subcommands are now jupyter subcommands, e.g.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;ipython notebook
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;is now&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;jupyter notebook
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The configuration files for these jupyter commands are now in your &lt;code&gt;~/.jupyter&lt;/code&gt; directory instead of &lt;code&gt;~/.ipython/profile_default&lt;/code&gt;. Jupyter should automatically migrate your notebook and qtconsole config to the new location if they exist.&lt;/p&gt;
&lt;p&gt;See the &lt;a href="https://jupyter.readthedocs.org/en/latest/config.html"&gt;Jupyter config docs&lt;/a&gt; for more info.&lt;/p&gt;
&lt;h3 id="docs"&gt;Docs&lt;/h3&gt;
&lt;p&gt;See the new &lt;a href="https://jupyter.readthedocs.org/en/latest/"&gt;Jupyter docs&lt;/a&gt; for more information about Jupyter, its components, and installation.&lt;/p&gt;
&lt;h3 id="issues"&gt;Issues&lt;/h3&gt;
&lt;p&gt;Please let us know &lt;a href="https://groups.google.com/forum/#!forum/jupyter"&gt;on the mailing list&lt;/a&gt; if you have issues with the new install, or open an Issue on GitHub for the repo that is misbehaving. There’s a lot of reorganization, and we thank you for your patience during this transition.&lt;/p&gt;
&lt;h3 id="thanks"&gt;Thanks&lt;/h3&gt;
&lt;p&gt;Thanks to everyone who helped with the Big Split! Here’s to a bright future for IPython and Jupyter.&lt;/p&gt;
</content><category term="IPython"/><category term="releases"/></entry><entry><title>IPython 3.2 released</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2015/ipython-3-2-released/" rel="alternate"/><published>2015-06-23T01:11:00+00:00</published><updated>2017-08-28T19:19:00+00:00</updated><author><name>Project Jupyter</name></author><id>tag:jasongrout.github.io,2015-06-23:/medium-archive/pelican/posts/2015/ipython-3-2-released/</id><summary type="html">&lt;p&gt;Hello Jovyans, We just release a few hours a ago a new minor version of IPython. Please upgrade your IPython notebook installation to 3.2 as soon as possible. There are important …&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2015/ipython-3-2-released/images/001-1_T_nQFZEcSVoZtiCf20B2rA.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;Hello Jovyans,&lt;/p&gt;
&lt;p&gt;We just release a few hours a ago a new minor version of IPython. Please upgrade your IPython notebook installation to 3.2 as soon as possible. There are important security patches in this release. Users are strongly encouraged to upgrade immediately.&lt;/p&gt;
&lt;p&gt;Highlights:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A security improvement that sets the secure attribute of the login cookie to prevent them from being sent over http&lt;/li&gt;
&lt;li&gt;Revert the face color of matplotlib axes in the inline backend to not be transparent&lt;/li&gt;
&lt;li&gt;Enable mathjax safe mode by default&lt;/li&gt;
&lt;li&gt;Fix XSS vulnerability in JSON error messages&lt;/li&gt;
&lt;li&gt;Various widget-related fixes&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can get the latest via pip using &lt;code&gt;pip install --upgrade ipython[notebook]&lt;/code&gt;. Use &lt;code&gt;conda update ipython&lt;/code&gt; if you are using Anaconda.&lt;/p&gt;
&lt;p&gt;A CVE has been requested for the XSS vulnerability on the OSS Security mailing list &lt;a href="http://permalink.gmane.org/gmane.comp.security.oss.general/17131"&gt;http://permalink.gmane.org/gmane.comp.security.oss.general/17131&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;[edit] CVE are tracked under numbers CVE-2015–4706 and CVE-2015–4707 [/edit]&lt;/p&gt;
&lt;p&gt;Thank you to Ahmad Khan of IBM for reporting the XSS vulnerability and Jason Grout for setting MathJax safe mode.&lt;/p&gt;
</content><category term="IPython"/><category term="releases"/></entry><entry><title>The Big Split™</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2015/the-big-split/" rel="alternate"/><published>2015-04-16T02:39:00+00:00</published><updated>2017-08-28T19:01:00+00:00</updated><author><name>Project Jupyter</name></author><id>tag:jasongrout.github.io,2015-04-16:/medium-archive/pelican/posts/2015/the-big-split/</id><summary type="html">&lt;p&gt;IPython has grown a great deal over the years. As of 3.0, IPython includes: an interactive shell a REPL protocol a notebook document fromat a notebook document conversion tool a …&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2015/the-big-split/images/001-1__W3NigoFNZBZVhvtU5UjHQ.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;IPython has &lt;a href="http://blog.fperez.org/2012/01/ipython-notebook-historical.html"&gt;grown a great deal&lt;/a&gt; over the years. As of 3.0, IPython includes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;an interactive shell&lt;/li&gt;
&lt;li&gt;a REPL protocol&lt;/li&gt;
&lt;li&gt;a notebook document fromat&lt;/li&gt;
&lt;li&gt;a notebook document conversion tool&lt;/li&gt;
&lt;li&gt;a web-based notebook authoring tool&lt;/li&gt;
&lt;li&gt;tools for building interactive UI (widgets)&lt;/li&gt;
&lt;li&gt;interactive parallel Python based on the above REPL protocol&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While all of these are part of the same story of tools for the lifecycle of a computational idea, they are increasingly becoming distinct projects that happen to live in a single repo. One significant part of the development is that pieces like the notebook and protocol are not even specific to Python, so it doesn’t make sense anymore that they reside in a project called Interactive Python. This is the impetus for &lt;a href="https://jupyter.org"&gt;Project Jupyter&lt;/a&gt;, &lt;a href="https://www.youtube.com/watch?t=258&amp;amp;v=JDrhn0-r9Eg"&gt;announced&lt;/a&gt; at SciPy 2014, which is the new home of language-agnostic projects that began as part of IPython, such as the notebook.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;If anyone has been confused by what Jupyter is&lt;/strong&gt;&lt;a href="#fn1"&gt;&lt;strong&gt;[1]&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;, it’s the exact same code that lived in IPython, developed by the same people, just in a new home under a new name.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;As IPython has matured, the interfaces between these different components have stabilized:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the notebook format&lt;/li&gt;
&lt;li&gt;the REPL protocol&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There has been growing tension in the project as we work to stabilize some APIs, such as the notebook format and message protocol, while we also start work on highly unstable experimental projects, such as the interactive widgets. The tension comes from the divergent maturity of these components, and associated appropriate release cycle of the different pieces. It simply no longer makes sense to release all of these pieces at the same time.&lt;/p&gt;
&lt;p&gt;We think the maturity of these APIs has reached the point that we can reasonably separate development of the different components, and rely on these interfaces to communicate between the projects. That should allow the projects to have their own release cycles, with more frequent bugfix releases, and grow their own developer and user communities.&lt;/p&gt;
&lt;p&gt;This means that IPython 3.0 will be the last monolithic major release containing all of these projects. IPython 4.0 will primarily consist of splitting IPython into these subprojects.&lt;/p&gt;
&lt;p&gt;Many of these pieces (REPL protocol, notebook-related tools) are language-agnostic, and not appropriately called IPython anymore.&lt;/p&gt;
&lt;h3 id="what-it-will-mean"&gt;What it &lt;em&gt;will&lt;/em&gt; mean&lt;/h3&gt;
&lt;p&gt;Once this is done and we’ve made the 4.0 releases of everything, each project will have its own package. To get the notebook, you would:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install notebook
jupyter notebook
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And nbconvert:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install nbconvert
jupyter nbconvert
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;etc.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;This is not true yet, and these commands won’t work until we have made stable releases of these packages.&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id="what-it-means-now-moar-repoz"&gt;What it means now: moar repoz&lt;/h3&gt;
&lt;p&gt;Splitting IPython means creating new repos for each of the subprojects, which we did last week. We created eleven new repos (!), which you can find on the &lt;a href="https://github.com/ipython"&gt;ipython&lt;/a&gt; and &lt;a href="https://github.com/jupyter"&gt;jupyter&lt;/a&gt; GitHub organizations.&lt;/p&gt;
&lt;p&gt;Since we haven’t made a release of any of these packages, it’s a pain to get up and running with all of these, since you need to clone each one from master. The only way to automatically resolve dependencies to GitHub repos is with the deprecated, discouraged, and disabled-by-default &lt;a href="https://github.com/pypa/pip/pull/1519"&gt;dependency_links&lt;/a&gt;. This means you need to explicitly clone and install each of the dependencies in order, which you can do with a &lt;a href="https://gist.github.com/minrk/2b74fb7465a3702e2ce4"&gt;requirements.txt&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;curl -O https://gist.githubusercontent.com/minrk/2b74fb7465a3702e2ce4/raw/requirements.txt
pip install -r requirements.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;We’ve put a requirements.txt in each repo with the git URLs of the unreleased dependencies, so for any given repo, you should be able to get working on master with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;git clone https://github.com/jupyter/notebook
cd notebook
pip install -r requirements.txt -e .
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As we start releasing the dependencies, we’ll trim down these requirements files as they become unnecessary.&lt;/p&gt;
&lt;h3 id="updated-imports"&gt;Updated Imports&lt;/h3&gt;
&lt;p&gt;For the most part, each of the new packages was an IPython subpackage, relocated to a new top-level package. This means your import should only need to replace the &lt;code&gt;IPython.subpackage&lt;/code&gt; part with its new jupyter name and you should be set. We’ve also added shims to IPython, so that imports that worked in 3.0 ought to keep working even after the next release, with a warning pointing to the new location.&lt;/p&gt;
&lt;p&gt;If you want to live in The Future™, here are most of the updated imports, after the move:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;IPython.utils.traitlets ⇒ &lt;a href="https://github.com/ipython/traitlets"&gt;traitlets&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;IPython.config ⇒ traitlets.config&lt;/li&gt;
&lt;li&gt;IPython.html ⇒ &lt;a href="https://github.com/jupyter/notebook"&gt;notebook&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;IPython.nbconvert ⇒ &lt;a href="https://github.com/jupyter/nbconvert"&gt;nbconvert&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;IPython.nbformat -&amp;gt; &lt;a href="https://github.com/jupyter/nbformat"&gt;nbformat&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;IPython.parallel ⇒ &lt;a href="https://github.com/ipython/ipyparallel"&gt;ipyparallel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;IPython.qt ⇒ &lt;a href="https://github.com/jupyter/qtconsole"&gt;qtconsole&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;IPython.terminal.console ⇒ &lt;a href="https://github.com/jupyter/jupyter_console"&gt;jupyter_console&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;IPython.kernel has split in a slightly more complex way. For the most part, it’s split into these two packages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;IPython.kernel ⇒ &lt;a href="https://github.com/jupyter/jupyter_client"&gt;jupyter_client&lt;/a&gt;, &lt;a href="https://github.com/ipython/ipykernel"&gt;ipykernel&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The client code is now in jupyter_client, so if you were importing kernel managers, clients, or specs, they would come from jupyter_client. This includes &lt;code&gt;IPython.kernel.zmq.session&lt;/code&gt;, which has moved to &lt;code&gt;jupyter_client.session&lt;/code&gt;. IPython’s kernel-side code is in ipykernel.&lt;/p&gt;
&lt;p&gt;The kernel.zmq subpackage is also removed, so anything in &lt;code&gt;IPython.kernel.zmq&lt;/code&gt; will be top-level in &lt;code&gt;ipykernel&lt;/code&gt; or &lt;code&gt;jupyter_client&lt;/code&gt;, for example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;IPython.kernel.zmq.session&lt;/code&gt; ⇒ &lt;code&gt;jupyter_client.session&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;IPython.kernel.zmq.kernelapp&lt;/code&gt; ⇒ &lt;code&gt;ipykernel.kernelapp&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="how-we-did-the-split"&gt;How we did the split&lt;/h3&gt;
&lt;p&gt;We did most of the split in two stages. The first stage was to split out the subpackages, still within the main &lt;a href="https://github.com/ipython/ipython"&gt;ipython/ipython&lt;/a&gt; repo (referred to as IPython Prime to avoid ambiguity). We did these mostly one at a time. For example, we moved IPython/html to notebook. We also added shims, so that anything that tried to import from IPython.html woud see a warning, but still work.&lt;/p&gt;
&lt;p&gt;This allowed us to keep IPython master working (for &lt;code&gt;pip install -e&lt;/code&gt; development installs, but not regular installs), and the tests running on Travis, to verify that we weren’t breaking the universe.&lt;/p&gt;
&lt;h3 id="phase-ii"&gt;Phase II&lt;/h3&gt;
&lt;p&gt;Once all of the new packages were separated within the IPython Prime repo, the time to perform the actual split had arrived. IPython’s git repo isn’t huge, but it is over 50MB. Since simply copying the repo and removing unused files would preserve the history of all of IPython in every repo, that would mean that each repo would also start at over 50MB. We didn’t want to increase the size of a clone of IPython/Jupyter past 500MB, but we also didn’t want to lose all of the history on the migrated files. To accomplish that, we used a combination of &lt;code&gt;git filter-branch&lt;/code&gt; and &lt;code&gt;bfg&lt;/code&gt; to prune the history of the relocated files. We put together &lt;a href="https://github.com/minrk/git-filter-branch-utils"&gt;a few scripts&lt;/a&gt; that run filter-branch to exclude the history of any files not in a specified whitelist, following history across renames as best we can, using &lt;code&gt;git log --follow&lt;/code&gt;. Since we are not running filter-branch on the original IPython repo, we felt comfortable being relatively aggressive with the cleaning, as all the true history is preserved in IPython Prime.&lt;/p&gt;
&lt;p&gt;IPython’s build, release, and docs machinery is old and has grown many gnarly bits over time, much of which is irrelevant to the new packages, so these were not included in most of the new packages.&lt;/p&gt;
&lt;p&gt;We split the packages in dependency order, so each new package only depended on other packages already split. After making each new repo, we would get it back to working order by adding basic &lt;a href="http://setup.py"&gt;setup.py&lt;/a&gt;, readme, license files, and .travis.yml. We would then update the contents of the new package to stop using the shim imports, which would be measured by the shim warnings. Once the tests were passing in the new repo, the package would be removed from the IPython repo. This process was repeated until the IPython repo contained only the shims.&lt;/p&gt;
&lt;h3 id="dont-look-at-me-im-genutils"&gt;Don’t look at me, I’m genutils&lt;/h3&gt;
&lt;p&gt;Part of what made the split possible to do in such a short time was ackowledging that there were a few common utilities that we use everywhere that we couldn’t decouple in a reasonable amount of time. During Phase I, we found a few imports of utilities that made sense while everything was in one repo, but were really unnecessary. These were handled by moving utilities into new packages, or duplicating small amounts of utility code to avoid the dependency.&lt;/p&gt;
&lt;p&gt;The rest that we couldn’t split has been dumped into an ipython_genutils package, &lt;em&gt;which should not be used by anyone for anything&lt;/em&gt;. This is a package that shouldn’t exist, has zero public APIs, and should be monotonically decreasing in functionality. The plan is to never add code to this repo, and to slowly move the functionality to downstream repos, or new standalone packages. Hopefully we can accomplish this relatively soon, and the genutils package can go away.&lt;/p&gt;
&lt;h3 id="still-to-do"&gt;Still to do&lt;/h3&gt;
&lt;p&gt;There is actually one split left to do: we are going to split the html widgets out of &lt;code&gt;notebook&lt;/code&gt; into &lt;code&gt;ipywidgets&lt;/code&gt; as a standalone package, but we need to figure out some detangling first, specifically what the installation process for projects with kernel-side and client-side components. In the long term, we want to split ipython_widgets (Python-side) and jupyter_widgets (client-side js), but the messaging interface between them is still an active research project, and they cannot feasibly be decoupled at this point.&lt;/p&gt;
&lt;p&gt;We still have some work to do migrating issues, and getting docs put together on the new repos. We have &lt;a href="https://github.com/minrk/migrate-issues"&gt;some scripts&lt;/a&gt; for the issue migration, and &lt;a href="https://github.com/ipython/ipyparallel/pull/3"&gt;some&lt;/a&gt; &lt;a href="https://github.com/jupyter/nbconvert/pull/1"&gt;PyCon&lt;/a&gt; &lt;a href="https://github.com/jupyter/notebook/pull/11"&gt;sprinters&lt;/a&gt; have been helping get the docs back on their feet (thanks!). We are also going to need a lot of new docs on installation and usage. We also need to write some basic configuration migration for the new Jupyter locations of files, no longer in the .ipython directory.&lt;/p&gt;
&lt;h3 id="conclusion"&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;We’re going to do our best to make this a smooth transition. One thing you can help with that is to report issues on the new repos. If you have a problem in the notebook, please report it at &lt;code&gt;notebook&lt;/code&gt; instead of on IPython Prime. The same goes for the other repos.&lt;/p&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li&gt;I saw “Jupyter is like IPython, but language agnostic” immediately after the announcement, which is a great illustration of why the project needs to not have Python in the name anymore, since it was &lt;em&gt;already&lt;/em&gt; language agnostic at the time. &lt;a href="#fnref1"&gt;↩︎&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
</content><category term="IPython"/></entry></feed>