##// END OF EJS Templates
update whats new
Matthias Bussonnier -
Show More
@@ -1,730 +1,765 b''
1 1 ============
2 2 7.x Series
3 3 ============
4 4
5 5 IPython 7.10.0
6 6 ==============
7 7
8 8 IPython 7.10 is the first double digit minor release in the last decade, and
9 9 first since the release of IPython 1.0, previous double digit minor release was
10 10 in August 2009.
11 11
12 12 We've been trying to give you regular release on the last Friday of every month
13 13 for a guaranty of rapid access to bug fixes and new features.
14 14
15 15 Unlike the previous first few releases that have seen only a couple of code
16 16 changes, 7.10 bring a number of changes, new features and bugfixes.
17 17
18 18 Stop Support for Python 3.5 – Adopt NEP 29
19 19 ------------------------------------------
20 20
21 21 IPython has decided to follow the informational `NEP 29
22 22 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`_ which layout a clear
23 23 policy as to which version of (C)Python and NumPy are supported.
24 24
25 25 We thus dropped support for Python 3.5, and cleaned up a number of code path
26 26 that were Python-version dependant. If you are on 3.5 or earlier pip should
27 27 automatically give you the latest compatible version of IPython so you do not
28 28 need to pin to a given version.
29 29
30 Support for Prompt Toolkit 3.0
31 ------------------------------
32
33 Prompt Toolkit 3.0 was release a week before IPython 7.10 and introduces a few
34 breaking changes. We believe IPython 7.10 should be compatible with both Prompt
35 Toolkit 2.x and 3.x, though it has not been extensively tested with 3.x so
36 please report any issues.
37
30 38
31 39 Prompt Rendering Performance improvements
32 40 -----------------------------------------
33 41
34 42 Pull Request :ghpull:`11933` introduced an optimisation in the prompt rendering
35 43 logic that should decrease the resource usage of IPython when using the
36 44 _default_ configuration but could potentially introduce a regression of
37 45 functionalities if you are using a custom prompt.
38 46
39 47 We know assume if you haven't changed the default keybindings that the prompt
40 48 **will not change** during the duration of your input – which is for example
41 49 not true when using vi insert mode that switches between `[ins]` and `[nor]`
42 50 for the current mode.
43 51
44 52 If you are experiencing any issue let us know.
45 53
46 54 Code autoformatting
47 55 -------------------
48 56
49 57 The IPython terminal can now auto format your code just before entering a new
50 58 line or executing a command. To do so use the
51 59 ``--TerminalInteractiveShell.autoformatter`` option and set it to ``'black'``;
52 60 if black is installed IPython will use black to format your code when possible.
53 61
54 62 IPython cannot always properly format your code; in particular it will
55 63 auto formatting with *black* will only work if:
56 64
57 65 - Your code does not contains magics or special python syntax.
58 66
59 67 - There is no code after your cursor.
60 68
61 69 The Black API is also still in motion; so this may not work with all versions of
62 70 black.
63 71
64 It should be possible to register custom reformatter, though the API is till in
72 It should be possible to register custom formatter, though the API is till in
65 73 flux.
66 74
67 Arbitrary Mimetypes Handing in Terminal
68 ---------------------------------------
75 Arbitrary Mimetypes Handing in Terminal (Aka inline images in terminal)
76 -----------------------------------------------------------------------
69 77
70 78 When using IPython terminal it is now possible to register function to handle
71 79 arbitrary mimetypes. While rendering non-text based representation was possible in
72 80 many jupyter frontend; it was not possible in terminal IPython, as usually
73 81 terminal are limited to displaying text. As many terminal these days provide
74 82 escape sequences to display non-text; bringing this loved feature to IPython CLI
75 83 made a lot of sens. This functionality will not only allow inline images; but
76 84 allow opening of external program; for example ``mplayer`` to "display" sound
77 85 files.
78 86
79 87 So far only the hooks necessary for this are in place, but no default mime
80 88 renderers added; so inline images will only be available via extensions. We will
81 89 progressively enable these features by default in the next few releases, and
82 90 contribution is welcomed.
83 91
84 92 We welcome any feedback on the API. See :ref:`shell_mimerenderer` for more
85 93 informations.
86 94
87 This is originally based on work form in :ghpull:`10610` from stephanh42
95 This is originally based on work form in :ghpull:`10610` from @stephanh42
88 96 started over two years ago, and still a lot need to be done.
89 97
90 98 MISC
91 99 ----
92 100
93 101 - Completions can define their own ordering :ghpull:`11855`
94 102 - Enable Plotting in the same cell than the one that import matplotlib
95 103 :ghpull:`11916`
96 104 - Allow to store and restore multiple variables at once :ghpull:`11930`
97 105
106 You can see `all pull-requests <https://github.com/ipython/ipython/pulls?q=is%3Apr+milestone%3A7.10+is%3Aclosed>`_ for this release.
107
108 API Changes
109 -----------
110
111 Change of API and exposed objects automatically detected using `frappuccino <https://pypi.org/project/frappuccino/>`_ :
112
113 The following items are new in IPython 7.10:
114 + IPython.terminal.shortcuts.reformat_text_before_cursor
115 + IPython.terminal.prompts.RichPromptDisplayHook.write_format_data
116 + IPython.terminal.interactiveshell.black_reformat_handler
117
118 The following signatures differ between 7.9 and 7.10:
119
120 - IPython.extensions.storemagic.restore_aliases(ip)
121 + IPython.extensions.storemagic.restore_aliases(ip, alias='None')
122
123 Special Thanks
124 --------------
125
126 - @stephanh42 who started the work on inline images in terminal 2 years ago
127 - @augustogoulart who spent a lot of time triaging issues and responding to
128 users.
129 - @con-f-use who is my (@Carreau) first sponsor on GitHub, as a reminder if you
130 like IPython, Jupyter and many other library of the SciPy stack you can
131 donate to numfocus.org non profit
132
98 133 .. _version 790:
99 134
100 135 IPython 7.9.0
101 136 =============
102 137
103 138 IPython 7.9 is a small release with a couple of improvement and bug fixes.
104 139
105 140 - Xterm terminal title should be restored on exit :ghpull:`11910`
106 141 - special variables ``_``,``__``, ``___`` are not set anymore when cache size
107 142 is 0 or less. :ghpull:`11877`
108 143 - Autoreload should have regained some speed by using a new heuristic logic to
109 144 find all objects needing reload. This should avoid large objects traversal
110 145 like pandas dataframes. :ghpull:`11876`
111 146 - Get ready for Python 4. :ghpull:`11874`
112 - `%env` Magic nonw has euristic to hide potentially sensitive values :ghpull:`11896`
147 - `%env` Magic now has heuristic to hide potentially sensitive values :ghpull:`11896`
113 148
114 149 This is a small release despite a number of Pull Request Pending that need to
115 150 be reviewed/worked on. Many of the core developers have been busy outside of
116 151 IPython/Jupyter and we thanks all contributor for their patience; we'll work on
117 these as soon as we have time.
152 these as soon as we have time.
118 153
119 154
120 155 .. _version780:
121 156
122 157 IPython 7.8.0
123 158 =============
124 159
125 160 IPython 7.8.0 contain a few bugfix and 2 new APIs:
126 161
127 162 - Enable changing the font color for LaTeX rendering :ghpull:`11840`
128 163 - and Re-Expose some PDB API (see below)
129 164
130 165 Expose Pdb API
131 166 --------------
132 167
133 168 Expose the built-in ``pdb.Pdb`` API. ``Pdb`` constructor arguments are generically
134 169 exposed, regardless of python version.
135 170 Newly exposed arguments:
136 171
137 172 - ``skip`` - Python 3.1+
138 173 - ``nosiginnt`` - Python 3.2+
139 174 - ``readrc`` - Python 3.6+
140 175
141 176 Try it out::
142 177
143 178 from IPython.terminal.debugger import TerminalPdb
144 179 pdb = TerminalPdb(skip=["skipthismodule"])
145 180
146 181
147 182 See :ghpull:`11840`
148 183
149 184 .. _version770:
150 185
151 186 IPython 7.7.0
152 187 =============
153 188
154 189 IPython 7.7.0 contain multiple bug fixes and documentation updates; Here are a
155 190 few of the outstanding issue fixed:
156 191
157 192 - Fix a bug introduced in 7.6 where the ``%matplotlib`` magic would fail on
158 193 previously acceptable arguments :ghpull:`11814`.
159 194 - Fix the manage location on freebsd :ghpull:`11808`.
160 195 - Fix error message about aliases after ``%reset`` call in ipykernel
161 196 :ghpull:`11806`
162 197 - Fix Duplication completions in emacs :ghpull:`11803`
163 198
164 199 We are planning to adopt `NEP29 <https://github.com/numpy/numpy/pull/14086>`_
165 200 (still currently in draft) which may make this minor version of IPython the
166 201 last one to support Python 3.5 and will make the code base more aggressive
167 202 toward removing compatibility with older versions of Python.
168 203
169 204 GitHub now support to give only "Triage" permissions to users; if you'd like to
170 205 help close stale issues and labels issues please reach to us with your GitHub
171 206 Username and we'll add you to the triage team. It is a great way to start
172 207 contributing and a path toward getting commit rights.
173 208
174 209 .. _version761:
175 210
176 211 IPython 7.6.1
177 212 =============
178 213
179 214 IPython 7.6.1 contain a critical bugfix in the ``%timeit`` magic, which would
180 215 crash on some inputs as a side effect of :ghpull:`11716`. See :ghpull:`11812`
181 216
182 217
183 218 .. _whatsnew760:
184 219
185 220 IPython 7.6.0
186 221 =============
187 222
188 223 IPython 7.6.0 contains a couple of bug fixes and number of small features
189 224 additions as well as some compatibility with the current development version of
190 225 Python 3.8.
191 226
192 227 - Add a ``-l`` option to :magic:`psearch` to list the available search
193 228 types. :ghpull:`11672`
194 229 - Support ``PathLike`` for ``DisplayObject`` and ``Image``. :ghpull:`11764`
195 230 - Configurability of timeout in the test suite for slow platforms.
196 231 :ghpull:`11756`
197 232 - Accept any casing for matplotlib backend. :ghpull:`121748`
198 233 - Properly skip test that requires numpy to be installed :ghpull:`11723`
199 234 - More support for Python 3.8 and positional only arguments (pep570)
200 235 :ghpull:`11720`
201 236 - Unicode names for the completion are loaded lazily on first use which
202 237 should decrease startup time. :ghpull:`11693`
203 238 - Autoreload now update the types of reloaded objects; this for example allow
204 239 pickling of reloaded objects. :ghpull:`11644`
205 240 - Fix a bug where ``%%time`` magic would suppress cell output. :ghpull:`11716`
206 241
207 242
208 243 Prepare migration to pytest (instead of nose) for testing
209 244 ---------------------------------------------------------
210 245
211 246 Most of the work between 7.5 and 7.6 was to prepare the migration from our
212 247 testing framework to pytest. Most of the test suite should now work by simply
213 248 issuing ``pytest`` from the root of the repository.
214 249
215 250 The migration to pytest is just at its beginning. Many of our test still rely
216 251 on IPython-specific plugins for nose using pytest (doctest using IPython syntax
217 252 is one example of this where test appear as "passing", while no code has been
218 253 ran). Many test also need to be updated like ``yield-test`` to be properly
219 254 parametrized tests.
220 255
221 256 Migration to pytest allowed me to discover a number of issues in our test
222 257 suite; which was hiding a number of subtle issues – or not actually running
223 258 some of the tests in our test suite – I have thus corrected many of those; like
224 259 improperly closed resources; or used of deprecated features. I also made use of
225 260 the ``pytest --durations=...`` to find some of our slowest test and speed them
226 261 up (our test suite can now be up to 10% faster). Pytest as also a variety of
227 262 plugins and flags which will make the code quality of IPython and the testing
228 263 experience better.
229 264
230 265 Misc
231 266 ----
232 267
233 268 We skipped the release of 7.6 at the end of May, but will attempt to get back
234 269 on schedule. We are starting to think about making introducing backward
235 270 incompatible change and start the 8.0 series.
236 271
237 272 Special Thanks to Gabriel (@gpotter2 on GitHub), who among other took care many
238 273 of the remaining task for 7.4 and 7.5, like updating the website.
239 274
240 275 .. _whatsnew750:
241 276
242 277 IPython 7.5.0
243 278 =============
244 279
245 280 IPython 7.5.0 consist mostly of bug-fixes, and documentation updates, with one
246 281 minor new feature. The `Audio` display element can now be assigned an element
247 282 id when displayed in browser. See :ghpull:`11670`
248 283
249 284 The major outstanding bug fix correct a change of behavior that was introduce
250 285 in 7.4.0 where some cell magics would not be able to access or modify global
251 286 scope when using the ``@needs_local_scope`` decorator. This was typically
252 287 encountered with the ``%%time`` and ``%%timeit`` magics. See :ghissue:`11659`
253 288 and :ghpull:`11698`.
254 289
255 290 .. _whatsnew740:
256 291
257 292 IPython 7.4.0
258 293 =============
259 294
260 295 Unicode name completions
261 296 ------------------------
262 297
263 298 Previously, we provided completion for a unicode name with its relative symbol.
264 299 With this, now IPython provides complete suggestions to unicode name symbols.
265 300
266 301 As on the PR, if user types ``\LAT<tab>``, IPython provides a list of
267 302 possible completions. In this case, it would be something like::
268 303
269 304 'LATIN CAPITAL LETTER A',
270 305 'LATIN CAPITAL LETTER B',
271 306 'LATIN CAPITAL LETTER C',
272 307 'LATIN CAPITAL LETTER D',
273 308 ....
274 309
275 310 This help to type unicode character that do not have short latex aliases, and
276 311 have long unicode names. for example ``Ν°``, ``\GREEK CAPITAL LETTER HETA``.
277 312
278 313 This feature was contributed by Luciana Marques :ghpull:`11583`.
279 314
280 315 Make audio normalization optional
281 316 ---------------------------------
282 317
283 318 Added 'normalize' argument to `IPython.display.Audio`. This argument applies
284 319 when audio data is given as an array of samples. The default of `normalize=True`
285 320 preserves prior behavior of normalizing the audio to the maximum possible range.
286 321 Setting to `False` disables normalization.
287 322
288 323
289 324 Miscellaneous
290 325 -------------
291 326
292 327 - Fix improper acceptation of ``return`` outside of functions. :ghpull:`11641`.
293 328 - Fixed PyQt 5.11 backwards incompatibility causing sip import failure.
294 329 :ghpull:`11613`.
295 330 - Fix Bug where ``type?`` would crash IPython. :ghpull:`1608`.
296 331 - Allow to apply ``@needs_local_scope`` to cell magics for convenience.
297 332 :ghpull:`11542`.
298 333
299 334 .. _whatsnew730:
300 335
301 336 IPython 7.3.0
302 337 =============
303 338
304 339 .. _whatsnew720:
305 340
306 341 IPython 7.3.0 bring several bug fixes and small improvements that you will
307 342 described bellow.
308 343
309 344 The biggest change to this release is the implementation of the ``%conda`` and
310 345 ``%pip`` magics, that will attempt to install packages in the **current
311 346 environment**. You may still need to restart your interpreter or kernel for the
312 347 change to be taken into account, but it should simplify installation of packages
313 348 into remote environment. Installing using pip/conda from the command line is
314 349 still the prefer method.
315 350
316 351 The ``%pip`` magic was already present, but was only printing a warning; now it
317 352 will actually forward commands to pip.
318 353
319 354 Misc bug fixes and improvements:
320 355
321 356 - Compatibility with Python 3.8.
322 357 - Do not expand shell variable in execution magics, and added the
323 358 ``no_var_expand`` decorator for magic requiring a similar functionality
324 359 :ghpull:`11516`
325 360 - Add ``%pip`` and ``%conda`` magic :ghpull:`11524`
326 361 - Re-initialize posix aliases after a ``%reset`` :ghpull:`11528`
327 362 - Allow the IPython command line to run ``*.ipynb`` files :ghpull:`11529`
328 363
329 364 IPython 7.2.0
330 365 =============
331 366
332 367 IPython 7.2.0 brings minor bugfixes, improvements, and new configuration options:
333 368
334 369 - Fix a bug preventing PySide2 GUI integration from working :ghpull:`11464`
335 370 - Run CI on Mac OS ! :ghpull:`11471`
336 371 - Fix IPython "Demo" mode. :ghpull:`11498`
337 372 - Fix ``%run`` magic with path in name :ghpull:`11499`
338 373 - Fix: add CWD to sys.path *after* stdlib :ghpull:`11502`
339 374 - Better rendering of signatures, especially long ones. :ghpull:`11505`
340 375 - Re-enable jedi by default if it's installed :ghpull:`11506`
341 376 - Add New ``minimal`` exception reporting mode (useful for educational purpose). See :ghpull:`11509`
342 377
343 378
344 379 Added ability to show subclasses when using pinfo and other utilities
345 380 ---------------------------------------------------------------------
346 381
347 382 When using ``?``/``??`` on a class, IPython will now list the first 10 subclasses.
348 383
349 384 Special Thanks to Chris Mentzel of the Moore Foundation for this feature. Chris
350 385 is one of the people who played a critical role in IPython/Jupyter getting
351 386 funding.
352 387
353 388 We are grateful for all the help Chris has given us over the years,
354 389 and we're now proud to have code contributed by Chris in IPython.
355 390
356 391 OSMagics.cd_force_quiet configuration option
357 392 --------------------------------------------
358 393
359 394 You can set this option to force the %cd magic to behave as if ``-q`` was passed:
360 395 ::
361 396
362 397 In [1]: cd /
363 398 /
364 399
365 400 In [2]: %config OSMagics.cd_force_quiet = True
366 401
367 402 In [3]: cd /tmp
368 403
369 404 In [4]:
370 405
371 406 See :ghpull:`11491`
372 407
373 408 In vi editing mode, whether the prompt includes the current vi mode can now be configured
374 409 -----------------------------------------------------------------------------------------
375 410
376 411 Set the ``TerminalInteractiveShell.prompt_includes_vi_mode`` to a boolean value
377 412 (default: True) to control this feature. See :ghpull:`11492`
378 413
379 414 .. _whatsnew710:
380 415
381 416 IPython 7.1.0
382 417 =============
383 418
384 419 IPython 7.1.0 is the first minor release after 7.0.0 and mostly brings fixes to
385 420 new features, internal refactoring, and fixes for regressions that happened during the 6.x->7.x
386 421 transition. It also brings **Compatibility with Python 3.7.1**, as we're
387 422 unwillingly relying on a bug in CPython.
388 423
389 424 New Core Dev:
390 425
391 426 - We welcome Jonathan Slenders to the commiters. Jonathan has done a fantastic
392 427 work on prompt_toolkit, and we'd like to recognise his impact by giving him
393 428 commit rights. :ghissue:`11397`
394 429
395 430 Notable Changes
396 431
397 432 - Major update of "latex to unicode" tab completion map (see below)
398 433
399 434 Notable New Features:
400 435
401 436 - Restore functionality and documentation of the **sphinx directive**, which
402 437 is now stricter (fail on error by daefault), has new configuration options,
403 438 has a brand new documentation page :ref:`ipython_directive` (which needs
404 439 some cleanup). It is also now *tested* so we hope to have less regressions.
405 440 :ghpull:`11402`
406 441
407 442 - ``IPython.display.Video`` now supports ``width`` and ``height`` arguments,
408 443 allowing a custom width and height to be set instead of using the video's
409 444 width and height. :ghpull:`11353`
410 445
411 446 - Warn when using ``HTML('<iframe>')`` instead of ``IFrame`` :ghpull:`11350`
412 447
413 448 - Allow Dynamic switching of editing mode between vi/emacs and show
414 449 normal/input mode in prompt when using vi. :ghpull:`11390`. Use ``%config
415 450 TerminalInteractiveShell.editing_mode = 'vi'`` or ``%config
416 451 TerminalInteractiveShell.editing_mode = 'emacs'`` to dynamically switch
417 452 between modes.
418 453
419 454
420 455 Notable Fixes:
421 456
422 457 - Fix entering of **multi-line blocks in terminal** IPython, and various
423 458 crashes in the new input transformation machinery :ghpull:`11354`,
424 459 :ghpull:`11356`, :ghpull:`11358`. These also fix a **Compatibility bug
425 460 with Python 3.7.1**.
426 461
427 462 - Fix moving through generator stack in ipdb :ghpull:`11266`
428 463
429 464 - %Magic command arguments now support quoting. :ghpull:`11330`
430 465
431 466 - Re-add ``rprint`` and ``rprinte`` aliases. :ghpull:`11331`
432 467
433 468 - Remove implicit dependency on ``ipython_genutils`` :ghpull:`11317`
434 469
435 470 - Make ``nonlocal`` raise ``SyntaxError`` instead of silently failing in async
436 471 mode. :ghpull:`11382`
437 472
438 473 - Fix mishandling of magics and ``= !`` assignment just after a dedent in
439 474 nested code blocks :ghpull:`11418`
440 475
441 476 - Fix instructions for custom shortcuts :ghpull:`11426`
442 477
443 478
444 479 Notable Internals improvements:
445 480
446 481 - Use of ``os.scandir`` (Python 3 only) to speed up some file system operations.
447 482 :ghpull:`11365`
448 483
449 484 - use ``perf_counter`` instead of ``clock`` for more precise
450 485 timing results with ``%time`` :ghpull:`11376`
451 486
452 487 Many thanks to all the contributors and in particular to ``bartskowron`` and
453 488 ``tonyfast`` who handled some pretty complicated bugs in the input machinery. We
454 489 had a number of first time contributors and maybe hacktoberfest participants that
455 490 made significant contributions and helped us free some time to focus on more
456 491 complicated bugs.
457 492
458 493 You
459 494 can see all the closed issues and Merged PR, new features and fixes `here
460 495 <https://github.com/ipython/ipython/issues?utf8=%E2%9C%93&q=+is%3Aclosed+milestone%3A7.1+>`_.
461 496
462 497 Unicode Completion update
463 498 -------------------------
464 499
465 500 In IPython 7.1 the Unicode completion map has been updated and synchronized with
466 501 the Julia language.
467 502
468 503 Added and removed character characters:
469 504
470 505 ``\jmath`` (``Θ·``), ``\\underleftrightarrow`` (U+034D, combining) have been
471 506 added, while ``\\textasciicaron`` have been removed
472 507
473 508 Some sequences have seen their prefix removed:
474 509
475 510 - 6 characters ``\text...<tab>`` should now be inputed with ``\...<tab>`` directly,
476 511 - 45 characters ``\Elz...<tab>`` should now be inputed with ``\...<tab>`` directly,
477 512 - 65 characters ``\B...<tab>`` should now be inputed with ``\...<tab>`` directly,
478 513 - 450 characters ``\m...<tab>`` should now be inputed with ``\...<tab>`` directly,
479 514
480 515 Some sequences have seen their prefix shortened:
481 516
482 517 - 5 characters ``\mitBbb...<tab>`` should now be inputed with ``\bbi...<tab>`` directly,
483 518 - 52 characters ``\mit...<tab>`` should now be inputed with ``\i...<tab>`` directly,
484 519 - 216 characters ``\mbfit...<tab>`` should now be inputed with ``\bi...<tab>`` directly,
485 520 - 222 characters ``\mbf...<tab>`` should now be inputed with ``\b...<tab>`` directly,
486 521
487 522 A couple of characters had their sequence simplified:
488 523
489 524 - ``Γ°``, type ``\dh<tab>``, instead of ``\eth<tab>``
490 525 - ``Δ§``, type ``\hbar<tab>``, instead of ``\Elzxh<tab>``
491 526 - ``ΙΈ``, type ``\ltphi<tab>``, instead of ``\textphi<tab>``
492 527 - ``Ο΄``, type ``\varTheta<tab>``, instead of ``\textTheta<tab>``
493 528 - ``ℇ``, type ``\eulermascheroni<tab>``, instead of ``\Eulerconst<tab>``
494 529 - ``β„Ž``, type ``\planck<tab>``, instead of ``\Planckconst<tab>``
495 530
496 531 - U+0336 (COMBINING LONG STROKE OVERLAY), type ``\strike<tab>``, instead of ``\Elzbar<tab>``.
497 532
498 533 A couple of sequences have been updated:
499 534
500 535 - ``\varepsilon`` now gives ``Ι›`` (GREEK SMALL LETTER EPSILON) instead of ``Ξ΅`` (GREEK LUNATE EPSILON SYMBOL),
501 536 - ``\underbar`` now gives U+0331 (COMBINING MACRON BELOW) instead of U+0332 (COMBINING LOW LINE).
502 537
503 538
504 539 .. _whatsnew700:
505 540
506 541 IPython 7.0.0
507 542 =============
508 543
509 544 Released Thursday September 27th, 2018
510 545
511 546 IPython 7 includes major feature improvements.
512 547 This is also the second major version of IPython to support only
513 548 Python 3 – starting at Python 3.4. Python 2 is still community-supported
514 549 on the bugfix only 5.x branch, but we remind you that Python 2 "end of life"
515 550 is on Jan 1st 2020.
516 551
517 552 We were able to backport bug fixes to the 5.x branch thanks to our backport bot which
518 553 backported more than `70 Pull-Requests
519 554 <https://github.com/ipython/ipython/pulls?page=3&q=is%3Apr+sort%3Aupdated-desc+author%3Aapp%2Fmeeseeksdev++5.x&utf8=%E2%9C%93>`_, but there are still many PRs that required manual work. This is an area of the project where you can easily contribute by looking for `PRs that still need manual backport <https://github.com/ipython/ipython/issues?q=label%3A%22Still+Needs+Manual+Backport%22+is%3Aclosed+sort%3Aupdated-desc>`_
520 555
521 556 The IPython 6.x branch will likely not see any further release unless critical
522 557 bugs are found.
523 558
524 559 Make sure you have pip > 9.0 before upgrading. You should be able to update by running:
525 560
526 561 .. code::
527 562
528 563 pip install ipython --upgrade
529 564
530 565 .. only:: ipydev
531 566
532 567 If you are trying to install or update an ``alpha``, ``beta``, or ``rc``
533 568 version, use pip ``--pre`` flag.
534 569
535 570 .. code::
536 571
537 572 pip install ipython --upgrade --pre
538 573
539 574
540 575 Or, if you have conda installed:
541 576
542 577 .. code::
543 578
544 579 conda install ipython
545 580
546 581
547 582
548 583 Prompt Toolkit 2.0
549 584 ------------------
550 585
551 586 IPython 7.0+ now uses ``prompt_toolkit 2.0``. If you still need to use an earlier
552 587 ``prompt_toolkit`` version, you may need to pin IPython to ``<7.0``.
553 588
554 589 Autowait: Asynchronous REPL
555 590 ---------------------------
556 591
557 592 Staring with IPython 7.0 on Python 3.6+, IPython can automatically ``await``
558 593 top level code. You should not need to access an event loop or runner
559 594 yourself. To learn more, read the :ref:`autoawait` section of our docs, see
560 595 :ghpull:`11265`, or try the following code::
561 596
562 597 Python 3.6.0
563 598 Type 'copyright', 'credits' or 'license' for more information
564 599 IPython 7.0.0 -- An enhanced Interactive Python. Type '?' for help.
565 600
566 601 In [1]: import aiohttp
567 602 ...: result = aiohttp.get('https://api.github.com')
568 603
569 604 In [2]: response = await result
570 605 <pause for a few 100s ms>
571 606
572 607 In [3]: await response.json()
573 608 Out[3]:
574 609 {'authorizations_url': 'https://api.github.com/authorizations',
575 610 'code_search_url': 'https://api.github.com/search/code?q={query}{&page,per_page,sort,order}',
576 611 ...
577 612 }
578 613
579 614 .. note::
580 615
581 616 Async integration is experimental code, behavior may change or be removed
582 617 between Python and IPython versions without warnings.
583 618
584 619 Integration is by default with `asyncio`, but other libraries can be configured --
585 620 like ``curio`` or ``trio`` -- to improve concurrency in the REPL::
586 621
587 622 In [1]: %autoawait trio
588 623
589 624 In [2]: import trio
590 625
591 626 In [3]: async def child(i):
592 627 ...: print(" child %s goes to sleep"%i)
593 628 ...: await trio.sleep(2)
594 629 ...: print(" child %s wakes up"%i)
595 630
596 631 In [4]: print('parent start')
597 632 ...: async with trio.open_nursery() as n:
598 633 ...: for i in range(3):
599 634 ...: n.spawn(child, i)
600 635 ...: print('parent end')
601 636 parent start
602 637 child 2 goes to sleep
603 638 child 0 goes to sleep
604 639 child 1 goes to sleep
605 640 <about 2 seconds pause>
606 641 child 2 wakes up
607 642 child 1 wakes up
608 643 child 0 wakes up
609 644 parent end
610 645
611 646 See :ref:`autoawait` for more information.
612 647
613 648
614 649 Asynchronous code in a Notebook interface or any other frontend using the
615 650 Jupyter Protocol will require further updates to the IPykernel package.
616 651
617 652 Non-Asynchronous code
618 653 ~~~~~~~~~~~~~~~~~~~~~
619 654
620 655 As the internal API of IPython is now asynchronous, IPython needs to run under
621 656 an event loop. In order to allow many workflows, (like using the :magic:`%run`
622 657 magic, or copy-pasting code that explicitly starts/stop event loop), when
623 658 top-level code is detected as not being asynchronous, IPython code is advanced
624 659 via a pseudo-synchronous runner, and may not advance pending tasks.
625 660
626 661 Change to Nested Embed
627 662 ~~~~~~~~~~~~~~~~~~~~~~
628 663
629 664 The introduction of the ability to run async code had some effect on the
630 665 ``IPython.embed()`` API. By default, embed will not allow you to run asynchronous
631 666 code unless an event loop is specified.
632 667
633 668 Effects on Magics
634 669 ~~~~~~~~~~~~~~~~~
635 670
636 671 Some magics will not work with async until they're updated.
637 672 Contributions welcome.
638 673
639 674 Expected Future changes
640 675 ~~~~~~~~~~~~~~~~~~~~~~~
641 676
642 677 We expect more internal but public IPython functions to become ``async``, and
643 678 will likely end up having a persistent event loop while IPython is running.
644 679
645 680 Thanks
646 681 ~~~~~~
647 682
648 683 This release took more than a year in the making.
649 684 The code was rebased a number of
650 685 times; leading to commit authorship that may have been lost in the final
651 686 Pull-Request. Huge thanks to many people for contribution, discussion, code,
652 687 documentation, use-cases: dalejung, danielballan, ellisonbg, fperez, gnestor,
653 688 minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many others.
654 689
655 690
656 691 Autoreload Improvement
657 692 ----------------------
658 693
659 694 The magic :magic:`%autoreload 2 <autoreload>` now captures new methods added to
660 695 classes. Earlier, only methods existing as of the initial import were being
661 696 tracked and updated.
662 697
663 698 This new feature helps dual environment development - Jupyter+IDE - where the
664 699 code gradually moves from notebook cells to package files as it gets
665 700 structured.
666 701
667 702 **Example**: An instance of the class ``MyClass`` will be able to access the
668 703 method ``cube()`` after it is uncommented and the file ``file1.py`` is saved on
669 704 disk.
670 705
671 706
672 707 .. code::
673 708
674 709 # notebook
675 710
676 711 from mymodule import MyClass
677 712 first = MyClass(5)
678 713
679 714 .. code::
680 715
681 716 # mymodule/file1.py
682 717
683 718 class MyClass:
684 719
685 720 def __init__(self, a=10):
686 721 self.a = a
687 722
688 723 def square(self):
689 724 print('compute square')
690 725 return self.a*self.a
691 726
692 727 # def cube(self):
693 728 # print('compute cube')
694 729 # return self.a*self.a*self.a
695 730
696 731
697 732
698 733
699 734 Misc
700 735 ----
701 736
702 737 The autoindent feature that was deprecated in 5.x was re-enabled and
703 738 un-deprecated in :ghpull:`11257`
704 739
705 740 Make :magic:`%run -n -i ... <run>` work correctly. Earlier, if :magic:`%run` was
706 741 passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308`
707 742
708 743
709 744 The :cellmagic:`%%script` (as well as :cellmagic:`%%bash`,
710 745 :cellmagic:`%%ruby`... ) cell magics now raise by default if the return code of
711 746 the given code is non-zero (thus halting execution of further cells in a
712 747 notebook). The behavior can be disable by passing the ``--no-raise-error`` flag.
713 748
714 749
715 750 Deprecations
716 751 ------------
717 752
718 753 A couple of unused functions and methods have been deprecated and will be removed
719 754 in future versions:
720 755
721 756 - ``IPython.utils.io.raw_print_err``
722 757 - ``IPython.utils.io.raw_print``
723 758
724 759
725 760 Backwards incompatible changes
726 761 ------------------------------
727 762
728 763 * The API for transforming input before it is parsed as Python code has been
729 764 completely redesigned: any custom input transformations will need to be
730 765 rewritten. See :doc:`/config/inputtransforms` for details of the new API.
General Comments 0
You need to be logged in to leave comments. Login now