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