##// END OF EJS Templates
Backport PR #13685: what's new 7.34
Matthias Bussonnier -
Show More
@@ -1,1795 +1,1804 b''
1 1 ============
2 2 7.x Series
3 3 ============
4 4
5 .. _version 7.34:
6
7 IPython 7.34
8 ============
9
10 This version contains a single fix: fix uncaught BdbQuit exceptions on ipdb
11 exit :ghpull:`13668`
12
13
5 14 .. _version 7.33:
6 15
7 16 IPython 7.33
8 17 ============
9 18
10 19 - Allow IPython hooks to receive current cell ids when frontend support it. See
11 20 :ghpull:`13600`
12 21
13 22 - ``?`` does not trigger the insertion of a new cell anymore as most frontend
14 23 allow proper multiline edition. :ghpull:`13625`
15 24
16 25
17 26 .. _version 7.32:
18 27
19 28 IPython 7.32
20 29 ============
21 30
22 31
23 32
24 33 Autoload magic lazily
25 34 ---------------------
26 35
27 36 The ability to configure magics to be lazily loaded has been added to IPython.
28 37 See the ``ipython --help-all`` section on ``MagicsManager.lazy_magic``.
29 38 One can now use::
30 39
31 40 c.MagicsManager.lazy_magics = {
32 41 "my_magic": "slow.to.import",
33 42 "my_other_magic": "also.slow",
34 43 }
35 44
36 45 And on first use of ``%my_magic``, or corresponding cell magic, or other line magic,
37 46 the corresponding ``load_ext`` will be called just before trying to invoke the magic.
38 47
39 48 Misc
40 49 ----
41 50
42 51 - Update sphinxify for Docrepr 0.2.0 :ghpull:`13503`.
43 52 - Set co_name for cells run line by line (to fix debugging with Python 3.10)
44 53 :ghpull:`13535`
45 54
46 55
47 56 Many thanks to all the contributors to this release. You can find all individual
48 57 contributions to this milestone `on github
49 58 <https://github.com/ipython/ipython/milestone/99>`__.
50 59
51 60 Thanks as well to the `D. E. Shaw group <https://deshaw.com/>`__ for sponsoring
52 61 work on IPython and related libraries.
53 62
54 63 .. _version 7.31.1:
55 64
56 65 IPython 7.31.1 (CVE-2022-21699)
57 66 ===============================
58 67
59 68 Fixed CVE-2022-21699, see IPython 8.0.1 release notes for informations.
60 69
61 70 .. _version 7.31:
62 71
63 72 IPython 7.31
64 73 ============
65 74
66 75 IPython 7.31 brings a couple of backports and fixes from the 8.0 branches,
67 76 it is likely one of the last releases of the 7.x series, as 8.0 will probably be released
68 77 between this release and what would have been 7.32.
69 78
70 79 Please test 8.0 beta/rc releases in addition to this release.
71 80
72 81 This Releases:
73 82 - Backport some fixes for Python 3.10 (:ghpull:`13412`)
74 83 - use full-alpha transparency on dvipng rendered LaTeX (:ghpull:`13372`)
75 84
76 85 Many thanks to all the contributors to this release. You can find all individual
77 86 contributions to this milestone `on github
78 87 <https://github.com/ipython/ipython/milestone/95>`__.
79 88
80 89 Thanks as well to the `D. E. Shaw group <https://deshaw.com/>`__ for sponsoring
81 90 work on IPython and related libraries.
82 91
83 92
84 93 .. _version 7.30:
85 94
86 95 IPython 7.30
87 96 ============
88 97
89 98 IPython 7.30 fixes a couple of bugs introduce in previous releases (in
90 99 particular with respect to path handling), and introduce a few features and
91 100 improvements:
92 101
93 102 Notably we will highlight :ghpull:`13267` "Document that ``%run`` can execute
94 103 notebooks and ipy scripts.", which is the first commit of Fernando PΓ©rez since
95 104 mid 2016 (IPython 5.1). If you are new to IPython, Fernando created IPython in
96 105 2001. The other most recent contribution of Fernando to IPython itself was
97 106 May 2018, by reviewing and merging PRs. I want to note that Fernando is still
98 107 active but mostly as a mentor and leader of the whole Jupyter organisation, but
99 108 we're still happy to see him contribute code !
100 109
101 110 :ghpull:`13290` "Use sphinxify (if available) in object_inspect_mime path"
102 111 should allow richer Repr of docstrings when using jupyterlab inspector.
103 112
104 113 :ghpull:`13311` make the debugger use ``ThreadPoolExecutor`` for debugger cmdloop.
105 114 This should fix some issues/infinite loop, but let us know if you come across
106 115 any regressions. In particular this fixes issues with `kmaork/madbg <https://github.com/kmaork/madbg>`_,
107 116 a remote debugger for IPython.
108 117
109 118 Note that this is likely the ante-penultimate release of IPython 7.x as a stable
110 119 branch, as I hope to release IPython 8.0 as well as IPython 7.31 next
111 120 month/early 2022.
112 121
113 122 IPython 8.0 will drop support for Python 3.7, removed nose as a dependency, and
114 123 7.x will only get critical bug fixes with 8.x becoming the new stable. This will
115 124 not be possible without `NumFOCUS Small Development Grants
116 125 <https://numfocus.org/programs/small-development-grants>`_ Which allowed us to
117 126 hire `Nikita Kniazev <https://github.com/Kojoley>`_ who provide Python and C++
118 127 help and contracting work.
119 128
120 129
121 130 Many thanks to all the contributors to this release. You can find all individual
122 131 contributions to this milestone `on github
123 132 <https://github.com/ipython/ipython/milestone/94?closed=1>`__.
124 133
125 134 Thanks as well to the `D. E. Shaw group <https://deshaw.com/>`__ for sponsoring
126 135 work on IPython and related libraries.
127 136
128 137
129 138 .. _version 7.29:
130 139
131 140 IPython 7.29
132 141 ============
133 142
134 143
135 144 IPython 7.29 brings a couple of new functionalities to IPython and a number of bugfixes.
136 145 It is one of the largest recent release, relatively speaking, with close to 15 Pull Requests.
137 146
138 147
139 148 - fix an issue where base64 was returned instead of bytes when showing figures :ghpull:`13162`
140 149 - fix compatibility with PyQt6, PySide 6 :ghpull:`13172`. This may be of
141 150 interest if you are running on Apple Silicon as only qt6.2+ is natively
142 151 compatible.
143 152 - fix matplotlib qtagg eventloop :ghpull:`13179`
144 153 - Multiple docs fixes, typos, ... etc.
145 154 - Debugger will now exit by default on SigInt :ghpull:`13218`, this will be
146 155 useful in notebook/lab if you forgot to exit the debugger. "Interrupt Kernel"
147 156 will now exist the debugger.
148 157
149 158 It give Pdb the ability to skip code in decorators. If functions contain a
150 159 special value names ``__debuggerskip__ = True|False``, the function will not be
151 160 stepped into, and Pdb will step into lower frames only if the value is set to
152 161 ``False``. The exact behavior is still likely to have corner cases and will be
153 162 refined in subsequent releases. Feedback welcome. See the debugger module
154 163 documentation for more info. Thanks to the `D. E. Shaw
155 164 group <https://deshaw.com/>`__ for funding this feature.
156 165
157 166 The main branch of IPython is receiving a number of changes as we received a
158 167 `NumFOCUS SDG <https://numfocus.org/programs/small-development-grants>`__
159 168 ($4800), to help us finish replacing ``nose`` by ``pytest``, and make IPython
160 169 future proof with an 8.0 release.
161 170
162 171
163 172 Many thanks to all the contributors to this release. You can find all individual
164 173 contributions to this milestone `on github
165 174 <https://github.com/ipython/ipython/milestone/93>`__.
166 175
167 176 Thanks as well to the `D. E. Shaw group <https://deshaw.com/>`__ for sponsoring
168 177 work on IPython and related libraries.
169 178
170 179
171 180 .. _version 7.28:
172 181
173 182 IPython 7.28
174 183 ============
175 184
176 185
177 186 IPython 7.28 is again a minor release that mostly bring bugfixes, and couple of
178 187 improvement. Many thanks to MrMino, who again did all the work this month, and
179 188 made a number of documentation improvements.
180 189
181 190 Here is a non-exhaustive list of changes,
182 191
183 192 Fixes:
184 193
185 194 - async with doesn't allow newlines :ghpull:`13090`
186 195 - Dynamically changing to vi mode via %config magic) :ghpull:`13091`
187 196
188 197 Virtualenv handling fixes:
189 198
190 199 - init_virtualenv now uses Pathlib :ghpull:`12548`
191 200 - Fix Improper path comparison of virtualenv directories :ghpull:`13140`
192 201 - Fix virtual environment user warning for lower case pathes :ghpull:`13094`
193 202 - Adapt to all sorts of drive names for cygwin :ghpull:`13153`
194 203
195 204 New Features:
196 205
197 206 - enable autoplay in embed YouTube player :ghpull:`13133`
198 207
199 208 Documentation:
200 209
201 210 - Fix formatting for the core.interactiveshell documentation :ghpull:`13118`
202 211 - Fix broken ipyparallel's refs :ghpull:`13138`
203 212 - Improve formatting of %time documentation :ghpull:`13125`
204 213 - Reword the YouTubeVideo autoplay WN :ghpull:`13147`
205 214
206 215
207 216 Highlighted features
208 217 --------------------
209 218
210 219
211 220 ``YouTubeVideo`` autoplay and the ability to add extra attributes to ``IFrame``
212 221 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
213 222
214 223 You can add any extra attributes to the ``<iframe>`` tag using the new
215 224 ``extras`` argument in the ``IFrame`` class. For example::
216 225
217 226 In [1]: from IPython.display import IFrame
218 227
219 228 In [2]: IFrame(src="src", width=300, height=300, extras=['loading="eager"'])
220 229
221 230 The above cells will result in the following HTML code being displayed in a
222 231 notebook::
223 232
224 233 <iframe
225 234 width="300"
226 235 height="300"
227 236 src="src"
228 237 frameborder="0"
229 238 allowfullscreen
230 239 loading="eager"
231 240 ></iframe>
232 241
233 242 Related to the above, the ``YouTubeVideo`` class now takes an
234 243 ``allow_autoplay`` flag, which sets up the iframe of the embedded YouTube video
235 244 such that it allows autoplay.
236 245
237 246 .. note::
238 247 Whether this works depends on the autoplay policy of the browser rendering
239 248 the HTML allowing it. It also could get blocked by some browser extensions.
240 249
241 250 Try it out!
242 251 ::
243 252
244 253 In [1]: from IPython.display import YouTubeVideo
245 254
246 255 In [2]: YouTubeVideo("dQw4w9WgXcQ", allow_autoplay=True)
247 256
248 257
249 258
250 259 Thanks
251 260 ------
252 261
253 262 Many thanks to all the contributors to this release. You can find all individual
254 263 contributions to this milestone `on github
255 264 <https://github.com/ipython/ipython/milestone/92>`__.
256 265
257 266 Thanks as well to the `D. E. Shaw group <https://deshaw.com/>`__ for sponsoring
258 267 work on IPython and related libraries.
259 268
260 269
261 270 .. _version 7.27:
262 271
263 272 IPython 7.27
264 273 ============
265 274
266 275 IPython 7.27 is a minor release that fixes a couple of issues and compatibility.
267 276
268 277 - Add support for GTK4 :ghpull:`131011`
269 278 - Add support for Qt6 :ghpull:`13085`
270 279 - Fix an issue with pip magic on windows :ghpull:`13093`
271 280
272 281 Thanks
273 282 ------
274 283
275 284 Many thanks to all the contributors to this release. You can find all individual
276 285 contributions to this milestone `on github
277 286 <https://github.com/ipython/ipython/milestone/91>`__.
278 287
279 288 Thanks as well to the `D. E. Shaw group <https://deshaw.com/>`__ for sponsoring
280 289 work on IPython and related libraries.
281 290
282 291 .. _version 7.26:
283 292
284 293 IPython 7.26
285 294 ============
286 295
287 296 IPython 7.26 is a minor release that fixes a couple of issues, updates in API
288 297 and Copyright/Licenses issues around various part of the codebase.
289 298
290 299 We'll highlight `this issue <https://github.com/ipython/ipython/issues/13039>`
291 300 pointing out we were including and refereeing to code from Stack Overflow which
292 301 was CC-BY-SA, hence incompatible with the BSD license of IPython. This lead us
293 302 to a rewriting of the corresponding logic which in our case was done in a more
294 303 efficient way (in our case we were searching string prefixes instead of full
295 304 strings).
296 305
297 306 You will notice also a number of documentation improvements and cleanup.
298 307
299 308 Of particular interest are the following Pull-requests:
300 309
301 310
302 311 - The IPython directive now uses Sphinx logging for warnings. :ghpull:`13030`.
303 312 - Add expiry days option to pastebin magic and change http protocol to https.
304 313 :ghpull:`13056`
305 314 - Make Ipython.utils.timing work with jupyterlite :ghpull:`13050`.
306 315
307 316 Pastebin magic expiry days option
308 317 ---------------------------------
309 318
310 319 The Pastebin magic now has ``-e`` option to determine
311 320 the number of days for paste expiration. For example
312 321 the paste that created with ``%pastebin -e 20 1`` magic will
313 322 be available for next 20 days.
314 323
315 324
316 325
317 326
318 327
319 328 Thanks
320 329 ------
321 330
322 331 Many thanks to all the contributors to this release and in particular MrMino who
323 332 is doing most of the work those days. You can find all individual contributions
324 333 to this milestone `on github <https://github.com/ipython/ipython/milestone/90>`__.
325 334
326 335 Thanks as well to the `D. E. Shaw group <https://deshaw.com/>`__ for sponsoring
327 336 work on IPython and related libraries.
328 337
329 338
330 339 .. _version 7.25:
331 340
332 341 IPython 7.25
333 342 ============
334 343
335 344 IPython 7.25 is a minor release that contains a single bugfix, which is highly
336 345 recommended for all users of ipdb, ipython debugger %debug magic and similar.
337 346
338 347 Issuing commands like ``where`` from within the debugger would reset the
339 348 local variables changes made by the user. It is interesting to look at the root
340 349 cause of the issue as accessing an attribute (``frame.f_locals``) would trigger
341 350 this side effects.
342 351
343 352 Thanks in particular to the patience from the reporters at D.E. Shaw for their
344 353 initial bug report that was due to a similar coding oversight in an extension,
345 354 and who took time to debug and narrow down the problem.
346 355
347 356 Thanks
348 357 ------
349 358
350 359 Many thanks to all the contributors to this release you can find all individual
351 360 contributions to this milestone `on github <https://github.com/ipython/ipython/milestone/89>`__.
352 361
353 362 Thanks as well to the `D. E. Shaw group <https://deshaw.com/>`__ for sponsoring
354 363 work on IPython and related libraries.
355 364
356 365
357 366 .. _version 7.24:
358 367
359 368 IPython 7.24
360 369 ============
361 370
362 371 Third release of IPython for 2021, mostly containing bug fixes. A couple of not
363 372 typical updates:
364 373
365 374 Misc
366 375 ----
367 376
368 377
369 378 - Fix an issue where ``%recall`` would both succeeded and print an error message
370 379 it failed. :ghpull:`12952`
371 380 - Drop support for NumPy 1.16 – practically has no effect beyond indicating in
372 381 package metadata that we do not support it. :ghpull:`12937`
373 382
374 383 Debugger improvements
375 384 ---------------------
376 385
377 386 The debugger (and ``%debug`` magic) have been improved and can skip or hide frames
378 387 originating from files that are not writable to the user, as these are less
379 388 likely to be the source of errors, or be part of system files this can be a useful
380 389 addition when debugging long errors.
381 390
382 391 In addition to the global ``skip_hidden True|False`` command, the debugger has
383 392 gained finer grained control of predicates as to whether to a frame should be
384 393 considered hidden. So far 3 predicates are available :
385 394
386 395 - ``tbhide``: frames containing the local variable ``__tracebackhide__`` set to
387 396 True.
388 397 - ``readonly``: frames originating from readonly files, set to False.
389 398 - ``ipython_internal``: frames that are likely to be from IPython internal
390 399 code, set to True.
391 400
392 401 You can toggle individual predicates during a session with
393 402
394 403 .. code-block::
395 404
396 405 ipdb> skip_predicates readonly True
397 406
398 407 Read-only files will now be considered hidden frames.
399 408
400 409
401 410 You can call ``skip_predicates`` without arguments to see the states of current
402 411 predicates:
403 412
404 413 .. code-block::
405 414
406 415 ipdb> skip_predicates
407 416 current predicates:
408 417 tbhide : True
409 418 readonly : False
410 419 ipython_internal : True
411 420
412 421 If all predicates are set to ``False``, ``skip_hidden`` will practically have
413 422 no effect. We attempt to warn you when all predicates are False.
414 423
415 424 Note that the ``readonly`` predicate may increase disk access as we check for
416 425 file access permission for all frames on many command invocation, but is usually
417 426 cached by operating systems. Let us know if you encounter any issues.
418 427
419 428 As the IPython debugger does not use the traitlets infrastructure for
420 429 configuration, by editing your ``.pdbrc`` files and appending commands you would
421 430 like to be executed just before entering the interactive prompt. For example:
422 431
423 432
424 433 .. code::
425 434
426 435 # file : ~/.pdbrc
427 436 skip_predicates readonly True
428 437 skip_predicates tbhide False
429 438
430 439 Will hide read only frames by default and show frames marked with
431 440 ``__tracebackhide__``.
432 441
433 442
434 443
435 444
436 445 Thanks
437 446 ------
438 447
439 448 Many thanks to all the contributors to this release you can find all individual
440 449 contributions to this milestone `on github <https://github.com/ipython/ipython/milestone/87>`__.
441 450
442 451 Thanks as well to the `D. E. Shaw group <https://deshaw.com/>`__ for sponsoring
443 452 work on IPython and related libraries, in particular above mentioned
444 453 improvements to the debugger.
445 454
446 455
447 456
448 457
449 458 .. _version 7.23:
450 459
451 460 IPython 7.23 and 7.23.1
452 461 =======================
453 462
454 463
455 464 Third release of IPython for 2021, mostly containing bug fixes. A couple of not
456 465 typical updates:
457 466
458 467 - We moved to GitHub actions away from Travis-CI, the transition may not be
459 468 100% complete (not testing on nightly anymore), but as we ran out of
460 469 Travis-Ci hours on the IPython organisation that was a necessary step.
461 470 :ghpull:`12900`.
462 471
463 472 - We have a new dependency: ``matplotlib-inline``, which try to extract
464 473 matplotlib inline backend specific behavior. It is available on PyPI and
465 474 conda-forge thus should not be a problem to upgrade to this version. If you
466 475 are a package maintainer that might be an extra dependency to package first.
467 476 :ghpull:`12817` (IPython 7.23.1 fix a typo that made this change fail)
468 477
469 478 In the addition/new feature category, ``display()`` now have a ``clear=True``
470 479 option to clear the display if any further outputs arrives, allowing users to
471 480 avoid having to use ``clear_output()`` directly. :ghpull:`12823`.
472 481
473 482 In bug fixes category, this release fix an issue when printing tracebacks
474 483 containing Unicode characters :ghpull:`12758`.
475 484
476 485 In code cleanup category :ghpull:`12932` remove usage of some deprecated
477 486 functionality for compatibility with Python 3.10.
478 487
479 488
480 489
481 490 Thanks
482 491 ------
483 492
484 493 Many thanks to all the contributors to this release you can find all individual
485 494 contributions to this milestone `on github <https://github.com/ipython/ipython/milestone/86>`__.
486 495 In particular MrMino for responding to almost all new issues, and triaging many
487 496 of the old ones, as well as takluyver, minrk, willingc for reacting quikly when
488 497 we ran out of CI Hours.
489 498
490 499 Thanks as well to organisations, QuantStack (martinRenou and SylvainCorlay) for
491 500 extracting matplotlib inline backend into its own package, and the `D. E. Shaw group
492 501 <https://deshaw.com/>`__ for sponsoring work on IPython and related libraries.
493 502
494 503
495 504 .. _version 7.22:
496 505
497 506 IPython 7.22
498 507 ============
499 508
500 509 Second release of IPython for 2021, mostly containing bug fixes. Here is a quick
501 510 rundown of the few changes.
502 511
503 512 - Fix some ``sys.excepthook`` shenanigan when embedding with qt, recommended if
504 513 you – for example – use `napari <https://napari.org>`__. :ghpull:`12842`.
505 514 - Fix bug when using the new ipdb ``%context`` magic :ghpull:`12844`
506 515 - Couples of deprecation cleanup :ghpull:`12868`
507 516 - Update for new dpast.com api if you use the ``%pastbin`` magic. :ghpull:`12712`
508 517 - Remove support for numpy before 1.16. :ghpull:`12836`
509 518
510 519
511 520 Thanks
512 521 ------
513 522
514 523 We have a new team member that you should see more often on the IPython
515 524 repository, BΕ‚aΕΌej Michalik (@MrMino) have been doing regular contributions to
516 525 IPython, and spent time replying to many issues and guiding new users to the
517 526 codebase; they now have triage permissions to the IPython repository and we'll
518 527 work toward giving them more permission in the future.
519 528
520 529 Many thanks to all the contributors to this release you can find all individual
521 530 contributions to this milestone `on github <https://github.com/ipython/ipython/milestone/84>`__.
522 531
523 532 Thanks as well to organisations, QuantStack for working on debugger
524 533 compatibility for Xeus_python, and the `D. E. Shaw group
525 534 <https://deshaw.com/>`__ for sponsoring work on IPython and related libraries.
526 535
527 536 .. _version 721:
528 537
529 538 IPython 7.21
530 539 ============
531 540
532 541 IPython 7.21 is the first release we have back on schedule of one release every
533 542 month; it contains a number of minor fixes and improvements, notably, the new
534 543 context command for ipdb
535 544
536 545
537 546 New "context" command in ipdb
538 547 -----------------------------
539 548
540 549 It is now possible to change the number of lines shown in the backtrace
541 550 information in ipdb using "context" command. :ghpull:`12826`
542 551
543 552 (thanks @MrMino, there are other improvement from them on master).
544 553
545 554 Other notable changes in IPython 7.21
546 555 -------------------------------------
547 556
548 557 - Fix some issues on new osx-arm64 :ghpull:`12804`, :ghpull:`12807`.
549 558 - Compatibility with Xeus-Python for debugger protocol, :ghpull:`12809`
550 559 - Misc docs fixes for compatibility and uniformity with Numpydoc.
551 560 :ghpull:`12824`
552 561
553 562
554 563 Thanks
555 564 ------
556 565
557 566 Many thanks to all the contributors to this release you can find all individual
558 567 contribution to this milestone `on github <https://github.com/ipython/ipython/milestone/83>`__.
559 568
560 569
561 570 .. _version 720:
562 571
563 572 IPython 7.20
564 573 ============
565 574
566 575 IPython 7.20 is the accumulation of 3 month of work on IPython, spacing between
567 576 IPython release have been increased from the usual once a month for various
568 577 reason.
569 578
570 579 - Mainly as I'm too busy and the effectively sole maintainer, and
571 580 - Second because not much changes happened before mid December.
572 581
573 582 The main driver for this release was the new version of Jedi 0.18 breaking API;
574 583 which was taken care of in the master branch early in 2020 but not in 7.x as I
575 584 though that by now 8.0 would be out.
576 585
577 586 The inclusion of a resolver in pip did not help and actually made things worse.
578 587 If usually I would have simply pinned Jedi to ``<0.18``; this is not a solution
579 588 anymore as now pip is free to install Jedi 0.18, and downgrade IPython.
580 589
581 590 I'll do my best to keep the regular release, but as the 8.0-dev branch and 7.x
582 591 are starting to diverge this is becoming difficult in particular with my limited
583 592 time, so if you have any cycles to spare I'll appreciate your help to respond to
584 593 issues and pushing 8.0 forward.
585 594
586 595 Here are thus some of the changes for IPython 7.20.
587 596
588 597 - Support for PyQt5 >= 5.11 :ghpull:`12715`
589 598 - ``%reset`` remove imports more agressively :ghpull:`12718`
590 599 - fix the ``%conda`` magic :ghpull:`12739`
591 600 - compatibility with Jedi 0.18, and bump minimum Jedi version. :ghpull:`12793`
592 601
593 602
594 603 .. _version 719:
595 604
596 605 IPython 7.19
597 606 ============
598 607
599 608 IPython 7.19 accumulative two month of works, bug fixes and improvements, there
600 609 was exceptionally no release last month.
601 610
602 611 - Fix to restore the ability to specify more than one extension using command
603 612 line flags when using traitlets 5.0 :ghpull:`12543`
604 613 - Docs docs formatting that make the install commands work on zsh
605 614 :ghpull:`12587`
606 615 - Always display the last frame in tracebacks even if hidden with
607 616 ``__tracebackhide__`` :ghpull:`12601`
608 617 - Avoid an issue where a callback can be registered multiple times.
609 618 :ghpull:`12625`
610 619 - Avoid an issue in debugger mode where frames changes could be lost.
611 620 :ghpull:`12627`
612 621
613 622 - Never hide the frames that invoke a debugger, even if marked as hidden by
614 623 ``__tracebackhide__`` :ghpull:`12631`
615 624 - Fix calling the debugger in a recursive manner :ghpull:`12659`
616 625
617 626
618 627 A number of code changes have landed on master and we are getting close to
619 628 enough new features and codebase improvement that a 8.0 start to make sens.
620 629 For downstream packages, please start working on migrating downstream testing
621 630 away from iptest and using pytest, as nose will not work on Python 3.10 and we
622 631 will likely start removing it as a dependency for testing.
623 632
624 633 .. _version 718:
625 634
626 635 IPython 7.18
627 636 ============
628 637
629 638 IPython 7.18 is a minor release that mostly contains bugfixes.
630 639
631 640 - ``CRLF`` is now handled by magics my default; solving some issues due to copy
632 641 pasting on windows. :ghpull:`12475`
633 642
634 643 - Requiring pexpect ``>=4.3`` as we are Python 3.7+ only and earlier version of
635 644 pexpect will be incompatible. :ghpull:`12510`
636 645
637 646 - Minimum jedi version is now 0.16. :ghpull:`12488`
638 647
639 648
640 649
641 650 .. _version 717:
642 651
643 652 IPython 7.17
644 653 ============
645 654
646 655 IPython 7.17 brings a couple of new improvements to API and a couple of user
647 656 facing changes to make the terminal experience more user friendly.
648 657
649 658 :ghpull:`12407` introduces the ability to pass extra argument to the IPython
650 659 debugger class; this is to help a new project from ``kmaork``
651 660 (https://github.com/kmaork/madbg) to feature a fully remote debugger.
652 661
653 662 :ghpull:`12410` finally remove support for 3.6, while the codebase is still
654 663 technically compatible; IPython will not install on Python 3.6.
655 664
656 665 lots of work on the debugger and hidden frames from ``@impact27`` in
657 666 :ghpull:`12437`, :ghpull:`12445`, :ghpull:`12460` and in particular
658 667 :ghpull:`12453` which make the debug magic more robust at handling spaces.
659 668
660 669 Biggest API addition is code transformation which is done before code execution;
661 670 IPython allows a number of hooks to catch non-valid Python syntax (magic, prompt
662 671 stripping...etc). Transformers are usually called many time; typically:
663 672
664 673 - When trying to figure out whether the code is complete and valid (should we
665 674 insert a new line or execute ?)
666 675 - During actual code execution pass before giving the code to Python's
667 676 ``exec``.
668 677
669 678 This lead to issues when transformer might have had side effects; or do external
670 679 queries. Starting with IPython 7.17 you can expect your transformer to be called
671 680 less time.
672 681
673 682 Input transformers are now called only once in the execution path of
674 683 `InteractiveShell`, allowing to register transformer that potentially have side
675 684 effects (note that this is not recommended). Internal methods `should_run_async`, and
676 685 `run_cell_async` now take a recommended optional `transformed_cell`, and
677 686 `preprocessing_exc_tuple` parameters that will become mandatory at some point in
678 687 the future; that is to say cells need to be explicitly transformed to be valid
679 688 Python syntax ahead of trying to run them. :ghpull:`12440`;
680 689
681 690 ``input_transformers`` can now also have an attribute ``has_side_effects`` set
682 691 to `True`, when this attribute is present; this will prevent the transformers
683 692 from being ran when IPython is trying to guess whether the user input is
684 693 complete. Note that this may means you will need to explicitly execute in some
685 694 case where your transformations are now not ran; but will not affect users with
686 695 no custom extensions.
687 696
688 697
689 698 API Changes
690 699 -----------
691 700
692 701 Change of API and exposed objects automatically detected using `frappuccino
693 702 <https://pypi.org/project/frappuccino/>`_
694 703
695 704
696 705 The following items are new since 7.16.0::
697 706
698 707 + IPython.core.interactiveshell.InteractiveShell.get_local_scope(self, stack_depth)
699 708
700 709 The following signatures differ since 7.16.0::
701 710
702 711 - IPython.core.interactiveshell.InteractiveShell.run_cell_async(self, raw_cell, store_history=False, silent=False, shell_futures=True)
703 712 + IPython.core.interactiveshell.InteractiveShell.run_cell_async(self, raw_cell, store_history=False, silent=False, shell_futures=True, *, transformed_cell=None, preprocessing_exc_tuple=None)
704 713
705 714 - IPython.core.interactiveshell.InteractiveShell.should_run_async(self, raw_cell)
706 715 + IPython.core.interactiveshell.InteractiveShell.should_run_async(self, raw_cell, *, transformed_cell=None, preprocessing_exc_tuple=None)
707 716
708 717 - IPython.terminal.debugger.TerminalPdb.pt_init(self)
709 718 + IPython.terminal.debugger.TerminalPdb.pt_init(self, pt_session_options=None)
710 719
711 720 This method was added::
712 721
713 722 + IPython.core.interactiveshell.InteractiveShell.get_local_scope
714 723
715 724 Which is now also present on subclasses::
716 725
717 726 + IPython.terminal.embed.InteractiveShellEmbed.get_local_scope
718 727 + IPython.terminal.interactiveshell.TerminalInteractiveShell.get_local_scope
719 728
720 729
721 730 .. _version 716:
722 731
723 732 IPython 7.16.1, 7.16.2
724 733 ======================
725 734
726 735 IPython 7.16.1 was release immediately after 7.16.0 to fix a conda packaging issue.
727 736 The source is identical to 7.16.0 but the file permissions in the tar are different.
728 737
729 738 IPython 7.16.2 pins jedi dependency to "<=0.17.2" which should prevent some
730 739 issues for users still on python 3.6. This may not be sufficient as pip may
731 740 still allow to downgrade IPython.
732 741
733 742 Compatibility with Jedi > 0.17.2 was not added as this would have meant bumping
734 743 the minimal version to >0.16.
735 744
736 745 IPython 7.16
737 746 ============
738 747
739 748
740 749 The default traceback mode will now skip frames that are marked with
741 750 ``__tracebackhide__ = True`` and show how many traceback frames have been
742 751 skipped. This can be toggled by using :magic:`xmode` with the ``--show`` or
743 752 ``--hide`` attribute. It will have no effect on non verbose traceback modes.
744 753
745 754 The ipython debugger also now understands ``__tracebackhide__`` as well and will
746 755 skip hidden frames when displaying. Movement up and down the stack will skip the
747 756 hidden frames and will show how many frames were hidden. Internal IPython frames
748 757 are also now hidden by default. The behavior can be changed with the
749 758 ``skip_hidden`` while in the debugger, command and accepts "yes", "no", "true"
750 759 and "false" case insensitive parameters.
751 760
752 761
753 762 Misc Noticeable changes:
754 763 ------------------------
755 764
756 765 - Exceptions are now (re)raised when running notebooks via the :magic:`%run`, helping to catch issues in workflows and
757 766 pipelines. :ghpull:`12301`
758 767 - Fix inputhook for qt 5.15.0 :ghpull:`12355`
759 768 - Fix wx inputhook :ghpull:`12375`
760 769 - Add handling for malformed pathext env var (Windows) :ghpull:`12367`
761 770 - use $SHELL in system_piped :ghpull:`12360` for uniform behavior with
762 771 ipykernel.
763 772
764 773 Reproducible Build
765 774 ------------------
766 775
767 776 IPython 7.15 reproducible build did not work, so we try again this month
768 777 :ghpull:`12358`.
769 778
770 779
771 780 API Changes
772 781 -----------
773 782
774 783 Change of API and exposed objects automatically detected using `frappuccino
775 784 <https://pypi.org/project/frappuccino/>`_ (still in beta):
776 785
777 786
778 787 The following items are new and mostly related to understanding ``__tracebackhide__``::
779 788
780 789 + IPython.core.debugger.Pdb.do_down(self, arg)
781 790 + IPython.core.debugger.Pdb.do_skip_hidden(self, arg)
782 791 + IPython.core.debugger.Pdb.do_up(self, arg)
783 792 + IPython.core.debugger.Pdb.hidden_frames(self, stack)
784 793 + IPython.core.debugger.Pdb.stop_here(self, frame)
785 794
786 795
787 796 The following items have been removed::
788 797
789 798 - IPython.core.debugger.Pdb.new_do_down
790 799 - IPython.core.debugger.Pdb.new_do_up
791 800
792 801 Those were implementation details.
793 802
794 803
795 804 .. _version 715:
796 805
797 806 IPython 7.15
798 807 ============
799 808
800 809 IPython 7.15 brings a number of bug fixes and user facing improvements.
801 810
802 811 Misc Noticeable changes:
803 812 ------------------------
804 813
805 814 - Long completion name have better elision in terminal :ghpull:`12284`
806 815 - I've started to test on Python 3.9 :ghpull:`12307` and fix some errors.
807 816 - Hi DPI scaling of figures when using qt eventloop :ghpull:`12314`
808 817 - Document the ability to have systemwide configuration for IPython.
809 818 :ghpull:`12328`
810 819 - Fix issues with input autoformatting :ghpull:`12336`
811 820 - ``IPython.core.debugger.Pdb`` is now interruptible (:ghpull:`12168`, in 7.14
812 821 but forgotten in release notes)
813 822 - Video HTML attributes (:ghpull:`12212`, in 7.14 but forgotten in release
814 823 notes)
815 824
816 825 Reproducible Build
817 826 ------------------
818 827
819 828 Starting with IPython 7.15, I am attempting to provide reproducible builds,
820 829 that is to say you should be able from the source tree to generate an sdist
821 830 and wheel that are identical byte for byte with the publish version on PyPI.
822 831
823 832 I've only tested on a couple of machines so far and the process is relatively
824 833 straightforward, so this mean that IPython not only have a deterministic build
825 834 process, but also I have either removed, or put under control all effects of
826 835 the build environments on the final artifact. I encourage you to attempt the
827 836 build process on your machine as documented in :ref:`core_developer_guide`
828 837 and let me know if you do not obtain an identical artifact.
829 838
830 839 While reproducible builds is critical to check that the supply chain of (open
831 840 source) software has not been compromised, it can also help to speedup many
832 841 of the build processes in large environment (conda, apt...) by allowing
833 842 better caching of intermediate build steps.
834 843
835 844 Learn more on `<https://reproducible-builds.org/>`_. `Reflections on trusting
836 845 trust <https://dl.acm.org/doi/10.1145/358198.358210>`_ is also one of the
837 846 cornerstone and recommended reads on this subject.
838 847
839 848 .. note::
840 849
841 850 The build commit from which the sdist is generated is also `signed
842 851 <https://en.wikipedia.org/wiki/Digital_signature>`_, so you should be able to
843 852 check it has not been compromised, and the git repository is a `merkle-tree
844 853 <https://en.wikipedia.org/wiki/Merkle_tree>`_, you can check the consistency
845 854 with `git-fsck <https://git-scm.com/docs/git-fsck>`_ which you likely `want
846 855 to enable by default
847 856 <https://gist.github.com/mbbx6spp/14b86437e794bffb4120>`_.
848 857
849 858 NEP29: Last version to support Python 3.6
850 859 -----------------------------------------
851 860
852 861 IPython 7.15 will be the Last IPython version to officially support Python
853 862 3.6, as stated by `NumPy Enhancement Proposal 29
854 863 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`_. Starting with
855 864 next minor version of IPython I may stop testing on Python 3.6 and may stop
856 865 publishing release artifacts that install on Python 3.6
857 866
858 867 Highlighted features
859 868 --------------------
860 869
861 870 Highlighted features are not new, but seem to not be widely known, this
862 871 section will help you discover in more narrative form what you can do with
863 872 IPython.
864 873
865 874 Increase Tab Completion Menu Height
866 875 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
867 876
868 877 In terminal IPython it is possible to increase the hight of the tab-completion
869 878 menu. To do so set the value of
870 879 :configtrait:`TerminalInteractiveShell.space_for_menu`, this will reserve more
871 880 space at the bottom of the screen for various kind of menus in IPython including
872 881 tab completion and searching in history.
873 882
874 883 Autoformat Code in the terminal
875 884 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
876 885
877 886 If you have a preferred code formatter, you can configure IPython to
878 887 reformat your code. Set the value of
879 888 :configtrait:`TerminalInteractiveShell.autoformatter` to for example ``'black'``
880 889 and IPython will auto format your code when possible.
881 890
882 891
883 892 .. _version 714:
884 893
885 894 IPython 7.14
886 895 ============
887 896
888 897 IPython 7.14 is a minor release that fix a couple of bugs and prepare
889 898 compatibility with new or future versions of some libraries.
890 899
891 900 Important changes:
892 901 ------------------
893 902
894 903 - Fix compatibility with Sphinx 3+ :ghpull:`12235`
895 904 - Remove deprecated matplotlib parameter usage, compatibility with matplotlib
896 905 3.3+ :`122250`
897 906
898 907 Misc Changes
899 908 ------------
900 909
901 910 - set ``.py`` extension when editing current buffer in vi/emacs. :ghpull:`12167`
902 911 - support for unicode identifiers in ``?``/``??`` :ghpull:`12208`
903 912 - add extra options to the ``Video`` Rich objects :ghpull:`12212`
904 913 - add pretty-printing to ``SimpleNamespace`` :ghpull:`12230`
905 914
906 915 IPython.core.debugger.Pdb is now interruptible
907 916 ----------------------------------------------
908 917
909 918 A ``KeyboardInterrupt`` will now interrupt IPython's extended debugger, in order to make Jupyter able to interrupt it. (:ghpull:`12168`)
910 919
911 920 Video HTML attributes
912 921 ---------------------
913 922
914 923 Add an option to `IPython.display.Video` to change the attributes of the HTML display of the video (:ghpull:`12212`)
915 924
916 925
917 926 Pending deprecated imports
918 927 --------------------------
919 928
920 929 Many object present in ``IPython.core.display`` are there for internal use only,
921 930 and should already been imported from ``IPython.display`` by users and external
922 931 libraries. Trying to import those from ``IPython.core.display`` is still possible
923 932 but will trigger a
924 933 deprecation warning in later versions of IPython and will become errors in the
925 934 future.
926 935
927 936 This will simplify compatibility with other Python kernels (like Xeus-Python),
928 937 and simplify code base.
929 938
930 939
931 940
932 941
933 942 .. _version 713:
934 943
935 944 IPython 7.13
936 945 ============
937 946
938 947 IPython 7.13 is the final release of the 7.x branch since master is diverging
939 948 toward an 8.0. Exiting new features have already been merged in 8.0 and will
940 949 not be available on the 7.x branch. All the changes below have been backported
941 950 from the master branch.
942 951
943 952
944 953 - Fix inability to run PDB when inside an event loop :ghpull:`12141`
945 954 - Fix ability to interrupt some processes on windows :ghpull:`12137`
946 955 - Fix debugger shortcuts :ghpull:`12132`
947 956 - improve tab completion when inside a string by removing irrelevant elements :ghpull:`12128`
948 957 - Fix display of filename tab completion when the path is long :ghpull:`12122`
949 958 - Many removal of Python 2 specific code path :ghpull:`12110`
950 959 - displaying wav files do not require NumPy anymore, and is 5x to 30x faster :ghpull:`12113`
951 960
952 961 See the list of all closed issues and pull request on `github
953 962 <https://github.com/ipython/ipython/pulls?q=is%3Aclosed+milestone%3A7.13>`_.
954 963
955 964 .. _version 712:
956 965
957 966 IPython 7.12
958 967 ============
959 968
960 969 IPython 7.12 is a minor update that mostly brings code cleanup, removal of
961 970 longtime deprecated function and a couple update to documentation cleanup as well.
962 971
963 972 Notable changes are the following:
964 973
965 974 - Exit non-zero when ipython is given a file path to run that doesn't exist :ghpull:`12074`
966 975 - Test PR on ARM64 with Travis-CI :ghpull:`12073`
967 976 - Update CI to work with latest Pytest :ghpull:`12086`
968 977 - Add infrastructure to run ipykernel eventloop via trio :ghpull:`12097`
969 978 - Support git blame ignore revs :ghpull:`12091`
970 979 - Start multi-line ``__repr__`` s on their own line :ghpull:`12099`
971 980
972 981 .. _version 7111:
973 982
974 983 IPython 7.11.1
975 984 ==============
976 985
977 986 A couple of deprecated functions (no-op) have been reintroduces in py3compat as
978 987 Cython was still relying on them, and will be removed in a couple of versions.
979 988
980 989 .. _version 711:
981 990
982 991 IPython 7.11
983 992 ============
984 993
985 994 IPython 7.11 received a couple of compatibility fixes and code cleanup.
986 995
987 996 A number of function in the ``py3compat`` have been removed; a number of types
988 997 in the IPython code base are now non-ambiguous and now always ``unicode``
989 998 instead of ``Union[Unicode,bytes]``; many of the relevant code path have thus
990 999 been simplified/cleaned and types annotation added.
991 1000
992 1001 IPython support several verbosity level from exceptions. ``xmode plain`` now
993 1002 support chained exceptions. :ghpull:`11999`
994 1003
995 1004 We are starting to remove ``shell=True`` in some usages of subprocess. While not directly
996 1005 a security issue (as IPython is made to run arbitrary code anyway) it is not good
997 1006 practice and we'd like to show the example. :ghissue:`12023`. This discussion
998 1007 was started by ``@mschwager`` thanks to a new auditing tool they are working on
999 1008 with duo-labs (`dlint <https://github.com/duo-labs/dlint>`_).
1000 1009
1001 1010 Work around some bugs in Python 3.9 tokenizer :ghpull:`12057`
1002 1011
1003 1012 IPython will now print its version after a crash. :ghpull:`11986`
1004 1013
1005 1014 This is likely the last release from the 7.x series that will see new feature.
1006 1015 The master branch will soon accept large code changes and thrilling new
1007 1016 features; the 7.x branch will only start to accept critical bug fixes, and
1008 1017 update dependencies.
1009 1018
1010 1019 .. _version 7102:
1011 1020
1012 1021 IPython 7.10.2
1013 1022 ==============
1014 1023
1015 1024 IPython 7.10.2 fix a couple of extra incompatibility between IPython, ipdb,
1016 1025 asyncio and Prompt Toolkit 3.
1017 1026
1018 1027 .. _version 7101:
1019 1028
1020 1029 IPython 7.10.1
1021 1030 ==============
1022 1031
1023 1032 IPython 7.10.1 fix a couple of incompatibilities with Prompt toolkit 3 (please
1024 1033 update Prompt toolkit to 3.0.2 at least), and fixes some interaction with
1025 1034 headless IPython.
1026 1035
1027 1036 .. _version 7100:
1028 1037
1029 1038 IPython 7.10.0
1030 1039 ==============
1031 1040
1032 1041 IPython 7.10 is the first double digit minor release in the last decade, and
1033 1042 first since the release of IPython 1.0, previous double digit minor release was
1034 1043 in August 2009.
1035 1044
1036 1045 We've been trying to give you regular release on the last Friday of every month
1037 1046 for a guaranty of rapid access to bug fixes and new features.
1038 1047
1039 1048 Unlike the previous first few releases that have seen only a couple of code
1040 1049 changes, 7.10 bring a number of changes, new features and bugfixes.
1041 1050
1042 1051 Stop Support for Python 3.5 – Adopt NEP 29
1043 1052 ------------------------------------------
1044 1053
1045 1054 IPython has decided to follow the informational `NEP 29
1046 1055 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`_ which layout a clear
1047 1056 policy as to which version of (C)Python and NumPy are supported.
1048 1057
1049 1058 We thus dropped support for Python 3.5, and cleaned up a number of code path
1050 1059 that were Python-version dependant. If you are on 3.5 or earlier pip should
1051 1060 automatically give you the latest compatible version of IPython so you do not
1052 1061 need to pin to a given version.
1053 1062
1054 1063 Support for Prompt Toolkit 3.0
1055 1064 ------------------------------
1056 1065
1057 1066 Prompt Toolkit 3.0 was release a week before IPython 7.10 and introduces a few
1058 1067 breaking changes. We believe IPython 7.10 should be compatible with both Prompt
1059 1068 Toolkit 2.x and 3.x, though it has not been extensively tested with 3.x so
1060 1069 please report any issues.
1061 1070
1062 1071
1063 1072 Prompt Rendering Performance improvements
1064 1073 -----------------------------------------
1065 1074
1066 1075 Pull Request :ghpull:`11933` introduced an optimisation in the prompt rendering
1067 1076 logic that should decrease the resource usage of IPython when using the
1068 1077 _default_ configuration but could potentially introduce a regression of
1069 1078 functionalities if you are using a custom prompt.
1070 1079
1071 1080 We know assume if you haven't changed the default keybindings that the prompt
1072 1081 **will not change** during the duration of your input – which is for example
1073 1082 not true when using vi insert mode that switches between `[ins]` and `[nor]`
1074 1083 for the current mode.
1075 1084
1076 1085 If you are experiencing any issue let us know.
1077 1086
1078 1087 Code autoformatting
1079 1088 -------------------
1080 1089
1081 1090 The IPython terminal can now auto format your code just before entering a new
1082 1091 line or executing a command. To do so use the
1083 1092 ``--TerminalInteractiveShell.autoformatter`` option and set it to ``'black'``;
1084 1093 if black is installed IPython will use black to format your code when possible.
1085 1094
1086 1095 IPython cannot always properly format your code; in particular it will
1087 1096 auto formatting with *black* will only work if:
1088 1097
1089 1098 - Your code does not contains magics or special python syntax.
1090 1099
1091 1100 - There is no code after your cursor.
1092 1101
1093 1102 The Black API is also still in motion; so this may not work with all versions of
1094 1103 black.
1095 1104
1096 1105 It should be possible to register custom formatter, though the API is till in
1097 1106 flux.
1098 1107
1099 1108 Arbitrary Mimetypes Handing in Terminal (Aka inline images in terminal)
1100 1109 -----------------------------------------------------------------------
1101 1110
1102 1111 When using IPython terminal it is now possible to register function to handle
1103 1112 arbitrary mimetypes. While rendering non-text based representation was possible in
1104 1113 many jupyter frontend; it was not possible in terminal IPython, as usually
1105 1114 terminal are limited to displaying text. As many terminal these days provide
1106 1115 escape sequences to display non-text; bringing this loved feature to IPython CLI
1107 1116 made a lot of sens. This functionality will not only allow inline images; but
1108 1117 allow opening of external program; for example ``mplayer`` to "display" sound
1109 1118 files.
1110 1119
1111 1120 So far only the hooks necessary for this are in place, but no default mime
1112 1121 renderers added; so inline images will only be available via extensions. We will
1113 1122 progressively enable these features by default in the next few releases, and
1114 1123 contribution is welcomed.
1115 1124
1116 1125 We welcome any feedback on the API. See :ref:`shell_mimerenderer` for more
1117 1126 informations.
1118 1127
1119 1128 This is originally based on work form in :ghpull:`10610` from @stephanh42
1120 1129 started over two years ago, and still a lot need to be done.
1121 1130
1122 1131 MISC
1123 1132 ----
1124 1133
1125 1134 - Completions can define their own ordering :ghpull:`11855`
1126 1135 - Enable Plotting in the same cell than the one that import matplotlib
1127 1136 :ghpull:`11916`
1128 1137 - Allow to store and restore multiple variables at once :ghpull:`11930`
1129 1138
1130 1139 You can see `all pull-requests <https://github.com/ipython/ipython/pulls?q=is%3Apr+milestone%3A7.10+is%3Aclosed>`_ for this release.
1131 1140
1132 1141 API Changes
1133 1142 -----------
1134 1143
1135 1144 Change of API and exposed objects automatically detected using `frappuccino <https://pypi.org/project/frappuccino/>`_ (still in beta):
1136 1145
1137 1146 The following items are new in IPython 7.10::
1138 1147
1139 1148 + IPython.terminal.shortcuts.reformat_text_before_cursor(buffer, document, shell)
1140 1149 + IPython.terminal.interactiveshell.PTK3
1141 1150 + IPython.terminal.interactiveshell.black_reformat_handler(text_before_cursor)
1142 1151 + IPython.terminal.prompts.RichPromptDisplayHook.write_format_data(self, format_dict, md_dict='None')
1143 1152
1144 1153 The following items have been removed in 7.10::
1145 1154
1146 1155 - IPython.lib.pretty.DICT_IS_ORDERED
1147 1156
1148 1157 The following signatures differ between versions::
1149 1158
1150 1159 - IPython.extensions.storemagic.restore_aliases(ip)
1151 1160 + IPython.extensions.storemagic.restore_aliases(ip, alias='None')
1152 1161
1153 1162 Special Thanks
1154 1163 --------------
1155 1164
1156 1165 - @stephanh42 who started the work on inline images in terminal 2 years ago
1157 1166 - @augustogoulart who spent a lot of time triaging issues and responding to
1158 1167 users.
1159 1168 - @con-f-use who is my (@Carreau) first sponsor on GitHub, as a reminder if you
1160 1169 like IPython, Jupyter and many other library of the SciPy stack you can
1161 1170 donate to numfocus.org non profit
1162 1171
1163 1172 .. _version 790:
1164 1173
1165 1174 IPython 7.9.0
1166 1175 =============
1167 1176
1168 1177 IPython 7.9 is a small release with a couple of improvement and bug fixes.
1169 1178
1170 1179 - Xterm terminal title should be restored on exit :ghpull:`11910`
1171 1180 - special variables ``_``,``__``, ``___`` are not set anymore when cache size
1172 1181 is 0 or less. :ghpull:`11877`
1173 1182 - Autoreload should have regained some speed by using a new heuristic logic to
1174 1183 find all objects needing reload. This should avoid large objects traversal
1175 1184 like pandas dataframes. :ghpull:`11876`
1176 1185 - Get ready for Python 4. :ghpull:`11874`
1177 1186 - `%env` Magic now has heuristic to hide potentially sensitive values :ghpull:`11896`
1178 1187
1179 1188 This is a small release despite a number of Pull Request Pending that need to
1180 1189 be reviewed/worked on. Many of the core developers have been busy outside of
1181 1190 IPython/Jupyter and we thanks all contributor for their patience; we'll work on
1182 1191 these as soon as we have time.
1183 1192
1184 1193
1185 1194 .. _version780:
1186 1195
1187 1196 IPython 7.8.0
1188 1197 =============
1189 1198
1190 1199 IPython 7.8.0 contain a few bugfix and 2 new APIs:
1191 1200
1192 1201 - Enable changing the font color for LaTeX rendering :ghpull:`11840`
1193 1202 - and Re-Expose some PDB API (see below)
1194 1203
1195 1204 Expose Pdb API
1196 1205 --------------
1197 1206
1198 1207 Expose the built-in ``pdb.Pdb`` API. ``Pdb`` constructor arguments are generically
1199 1208 exposed, regardless of python version.
1200 1209 Newly exposed arguments:
1201 1210
1202 1211 - ``skip`` - Python 3.1+
1203 1212 - ``nosiginnt`` - Python 3.2+
1204 1213 - ``readrc`` - Python 3.6+
1205 1214
1206 1215 Try it out::
1207 1216
1208 1217 from IPython.terminal.debugger import TerminalPdb
1209 1218 pdb = TerminalPdb(skip=["skipthismodule"])
1210 1219
1211 1220
1212 1221 See :ghpull:`11840`
1213 1222
1214 1223 .. _version770:
1215 1224
1216 1225 IPython 7.7.0
1217 1226 =============
1218 1227
1219 1228 IPython 7.7.0 contain multiple bug fixes and documentation updates; Here are a
1220 1229 few of the outstanding issue fixed:
1221 1230
1222 1231 - Fix a bug introduced in 7.6 where the ``%matplotlib`` magic would fail on
1223 1232 previously acceptable arguments :ghpull:`11814`.
1224 1233 - Fix the manage location on freebsd :ghpull:`11808`.
1225 1234 - Fix error message about aliases after ``%reset`` call in ipykernel
1226 1235 :ghpull:`11806`
1227 1236 - Fix Duplication completions in emacs :ghpull:`11803`
1228 1237
1229 1238 We are planning to adopt `NEP29 <https://github.com/numpy/numpy/pull/14086>`_
1230 1239 (still currently in draft) which may make this minor version of IPython the
1231 1240 last one to support Python 3.5 and will make the code base more aggressive
1232 1241 toward removing compatibility with older versions of Python.
1233 1242
1234 1243 GitHub now support to give only "Triage" permissions to users; if you'd like to
1235 1244 help close stale issues and labels issues please reach to us with your GitHub
1236 1245 Username and we'll add you to the triage team. It is a great way to start
1237 1246 contributing and a path toward getting commit rights.
1238 1247
1239 1248 .. _version761:
1240 1249
1241 1250 IPython 7.6.1
1242 1251 =============
1243 1252
1244 1253 IPython 7.6.1 contain a critical bugfix in the ``%timeit`` magic, which would
1245 1254 crash on some inputs as a side effect of :ghpull:`11716`. See :ghpull:`11812`
1246 1255
1247 1256
1248 1257 .. _whatsnew760:
1249 1258
1250 1259 IPython 7.6.0
1251 1260 =============
1252 1261
1253 1262 IPython 7.6.0 contains a couple of bug fixes and number of small features
1254 1263 additions as well as some compatibility with the current development version of
1255 1264 Python 3.8.
1256 1265
1257 1266 - Add a ``-l`` option to :magic:`psearch` to list the available search
1258 1267 types. :ghpull:`11672`
1259 1268 - Support ``PathLike`` for ``DisplayObject`` and ``Image``. :ghpull:`11764`
1260 1269 - Configurability of timeout in the test suite for slow platforms.
1261 1270 :ghpull:`11756`
1262 1271 - Accept any casing for matplotlib backend. :ghpull:`121748`
1263 1272 - Properly skip test that requires numpy to be installed :ghpull:`11723`
1264 1273 - More support for Python 3.8 and positional only arguments (pep570)
1265 1274 :ghpull:`11720`
1266 1275 - Unicode names for the completion are loaded lazily on first use which
1267 1276 should decrease startup time. :ghpull:`11693`
1268 1277 - Autoreload now update the types of reloaded objects; this for example allow
1269 1278 pickling of reloaded objects. :ghpull:`11644`
1270 1279 - Fix a bug where ``%%time`` magic would suppress cell output. :ghpull:`11716`
1271 1280
1272 1281
1273 1282 Prepare migration to pytest (instead of nose) for testing
1274 1283 ---------------------------------------------------------
1275 1284
1276 1285 Most of the work between 7.5 and 7.6 was to prepare the migration from our
1277 1286 testing framework to pytest. Most of the test suite should now work by simply
1278 1287 issuing ``pytest`` from the root of the repository.
1279 1288
1280 1289 The migration to pytest is just at its beginning. Many of our test still rely
1281 1290 on IPython-specific plugins for nose using pytest (doctest using IPython syntax
1282 1291 is one example of this where test appear as "passing", while no code has been
1283 1292 ran). Many test also need to be updated like ``yield-test`` to be properly
1284 1293 parametrized tests.
1285 1294
1286 1295 Migration to pytest allowed me to discover a number of issues in our test
1287 1296 suite; which was hiding a number of subtle issues – or not actually running
1288 1297 some of the tests in our test suite – I have thus corrected many of those; like
1289 1298 improperly closed resources; or used of deprecated features. I also made use of
1290 1299 the ``pytest --durations=...`` to find some of our slowest test and speed them
1291 1300 up (our test suite can now be up to 10% faster). Pytest as also a variety of
1292 1301 plugins and flags which will make the code quality of IPython and the testing
1293 1302 experience better.
1294 1303
1295 1304 Misc
1296 1305 ----
1297 1306
1298 1307 We skipped the release of 7.6 at the end of May, but will attempt to get back
1299 1308 on schedule. We are starting to think about making introducing backward
1300 1309 incompatible change and start the 8.0 series.
1301 1310
1302 1311 Special Thanks to Gabriel (@gpotter2 on GitHub), who among other took care many
1303 1312 of the remaining task for 7.4 and 7.5, like updating the website.
1304 1313
1305 1314 .. _whatsnew750:
1306 1315
1307 1316 IPython 7.5.0
1308 1317 =============
1309 1318
1310 1319 IPython 7.5.0 consist mostly of bug-fixes, and documentation updates, with one
1311 1320 minor new feature. The `Audio` display element can now be assigned an element
1312 1321 id when displayed in browser. See :ghpull:`11670`
1313 1322
1314 1323 The major outstanding bug fix correct a change of behavior that was introduce
1315 1324 in 7.4.0 where some cell magics would not be able to access or modify global
1316 1325 scope when using the ``@needs_local_scope`` decorator. This was typically
1317 1326 encountered with the ``%%time`` and ``%%timeit`` magics. See :ghissue:`11659`
1318 1327 and :ghpull:`11698`.
1319 1328
1320 1329 .. _whatsnew740:
1321 1330
1322 1331 IPython 7.4.0
1323 1332 =============
1324 1333
1325 1334 Unicode name completions
1326 1335 ------------------------
1327 1336
1328 1337 Previously, we provided completion for a unicode name with its relative symbol.
1329 1338 With this, now IPython provides complete suggestions to unicode name symbols.
1330 1339
1331 1340 As on the PR, if user types ``\LAT<tab>``, IPython provides a list of
1332 1341 possible completions. In this case, it would be something like::
1333 1342
1334 1343 'LATIN CAPITAL LETTER A',
1335 1344 'LATIN CAPITAL LETTER B',
1336 1345 'LATIN CAPITAL LETTER C',
1337 1346 'LATIN CAPITAL LETTER D',
1338 1347 ....
1339 1348
1340 1349 This help to type unicode character that do not have short latex aliases, and
1341 1350 have long unicode names. for example ``Ν°``, ``\GREEK CAPITAL LETTER HETA``.
1342 1351
1343 1352 This feature was contributed by Luciana Marques :ghpull:`11583`.
1344 1353
1345 1354 Make audio normalization optional
1346 1355 ---------------------------------
1347 1356
1348 1357 Added 'normalize' argument to `IPython.display.Audio`. This argument applies
1349 1358 when audio data is given as an array of samples. The default of `normalize=True`
1350 1359 preserves prior behavior of normalizing the audio to the maximum possible range.
1351 1360 Setting to `False` disables normalization.
1352 1361
1353 1362
1354 1363 Miscellaneous
1355 1364 -------------
1356 1365
1357 1366 - Fix improper acceptation of ``return`` outside of functions. :ghpull:`11641`.
1358 1367 - Fixed PyQt 5.11 backwards incompatibility causing sip import failure.
1359 1368 :ghpull:`11613`.
1360 1369 - Fix Bug where ``type?`` would crash IPython. :ghpull:`1608`.
1361 1370 - Allow to apply ``@needs_local_scope`` to cell magics for convenience.
1362 1371 :ghpull:`11542`.
1363 1372
1364 1373 .. _whatsnew730:
1365 1374
1366 1375 IPython 7.3.0
1367 1376 =============
1368 1377
1369 1378 .. _whatsnew720:
1370 1379
1371 1380 IPython 7.3.0 bring several bug fixes and small improvements that you will
1372 1381 described bellow.
1373 1382
1374 1383 The biggest change to this release is the implementation of the ``%conda`` and
1375 1384 ``%pip`` magics, that will attempt to install packages in the **current
1376 1385 environment**. You may still need to restart your interpreter or kernel for the
1377 1386 change to be taken into account, but it should simplify installation of packages
1378 1387 into remote environment. Installing using pip/conda from the command line is
1379 1388 still the prefer method.
1380 1389
1381 1390 The ``%pip`` magic was already present, but was only printing a warning; now it
1382 1391 will actually forward commands to pip.
1383 1392
1384 1393 Misc bug fixes and improvements:
1385 1394
1386 1395 - Compatibility with Python 3.8.
1387 1396 - Do not expand shell variable in execution magics, and added the
1388 1397 ``no_var_expand`` decorator for magic requiring a similar functionality
1389 1398 :ghpull:`11516`
1390 1399 - Add ``%pip`` and ``%conda`` magic :ghpull:`11524`
1391 1400 - Re-initialize posix aliases after a ``%reset`` :ghpull:`11528`
1392 1401 - Allow the IPython command line to run ``*.ipynb`` files :ghpull:`11529`
1393 1402
1394 1403 IPython 7.2.0
1395 1404 =============
1396 1405
1397 1406 IPython 7.2.0 brings minor bugfixes, improvements, and new configuration options:
1398 1407
1399 1408 - Fix a bug preventing PySide2 GUI integration from working :ghpull:`11464`
1400 1409 - Run CI on Mac OS ! :ghpull:`11471`
1401 1410 - Fix IPython "Demo" mode. :ghpull:`11498`
1402 1411 - Fix ``%run`` magic with path in name :ghpull:`11499`
1403 1412 - Fix: add CWD to sys.path *after* stdlib :ghpull:`11502`
1404 1413 - Better rendering of signatures, especially long ones. :ghpull:`11505`
1405 1414 - Re-enable jedi by default if it's installed :ghpull:`11506`
1406 1415 - Add New ``minimal`` exception reporting mode (useful for educational purpose). See :ghpull:`11509`
1407 1416
1408 1417
1409 1418 Added ability to show subclasses when using pinfo and other utilities
1410 1419 ---------------------------------------------------------------------
1411 1420
1412 1421 When using ``?``/``??`` on a class, IPython will now list the first 10 subclasses.
1413 1422
1414 1423 Special Thanks to Chris Mentzel of the Moore Foundation for this feature. Chris
1415 1424 is one of the people who played a critical role in IPython/Jupyter getting
1416 1425 funding.
1417 1426
1418 1427 We are grateful for all the help Chris has given us over the years,
1419 1428 and we're now proud to have code contributed by Chris in IPython.
1420 1429
1421 1430 OSMagics.cd_force_quiet configuration option
1422 1431 --------------------------------------------
1423 1432
1424 1433 You can set this option to force the %cd magic to behave as if ``-q`` was passed:
1425 1434 ::
1426 1435
1427 1436 In [1]: cd /
1428 1437 /
1429 1438
1430 1439 In [2]: %config OSMagics.cd_force_quiet = True
1431 1440
1432 1441 In [3]: cd /tmp
1433 1442
1434 1443 In [4]:
1435 1444
1436 1445 See :ghpull:`11491`
1437 1446
1438 1447 In vi editing mode, whether the prompt includes the current vi mode can now be configured
1439 1448 -----------------------------------------------------------------------------------------
1440 1449
1441 1450 Set the ``TerminalInteractiveShell.prompt_includes_vi_mode`` to a boolean value
1442 1451 (default: True) to control this feature. See :ghpull:`11492`
1443 1452
1444 1453 .. _whatsnew710:
1445 1454
1446 1455 IPython 7.1.0
1447 1456 =============
1448 1457
1449 1458 IPython 7.1.0 is the first minor release after 7.0.0 and mostly brings fixes to
1450 1459 new features, internal refactoring, and fixes for regressions that happened during the 6.x->7.x
1451 1460 transition. It also brings **Compatibility with Python 3.7.1**, as we're
1452 1461 unwillingly relying on a bug in CPython.
1453 1462
1454 1463 New Core Dev:
1455 1464
1456 1465 - We welcome Jonathan Slenders to the commiters. Jonathan has done a fantastic
1457 1466 work on prompt_toolkit, and we'd like to recognise his impact by giving him
1458 1467 commit rights. :ghissue:`11397`
1459 1468
1460 1469 Notable Changes
1461 1470
1462 1471 - Major update of "latex to unicode" tab completion map (see below)
1463 1472
1464 1473 Notable New Features:
1465 1474
1466 1475 - Restore functionality and documentation of the **sphinx directive**, which
1467 1476 is now stricter (fail on error by daefault), has new configuration options,
1468 1477 has a brand new documentation page :ref:`ipython_directive` (which needs
1469 1478 some cleanup). It is also now *tested* so we hope to have less regressions.
1470 1479 :ghpull:`11402`
1471 1480
1472 1481 - ``IPython.display.Video`` now supports ``width`` and ``height`` arguments,
1473 1482 allowing a custom width and height to be set instead of using the video's
1474 1483 width and height. :ghpull:`11353`
1475 1484
1476 1485 - Warn when using ``HTML('<iframe>')`` instead of ``IFrame`` :ghpull:`11350`
1477 1486
1478 1487 - Allow Dynamic switching of editing mode between vi/emacs and show
1479 1488 normal/input mode in prompt when using vi. :ghpull:`11390`. Use ``%config
1480 1489 TerminalInteractiveShell.editing_mode = 'vi'`` or ``%config
1481 1490 TerminalInteractiveShell.editing_mode = 'emacs'`` to dynamically switch
1482 1491 between modes.
1483 1492
1484 1493
1485 1494 Notable Fixes:
1486 1495
1487 1496 - Fix entering of **multi-line blocks in terminal** IPython, and various
1488 1497 crashes in the new input transformation machinery :ghpull:`11354`,
1489 1498 :ghpull:`11356`, :ghpull:`11358`. These also fix a **Compatibility bug
1490 1499 with Python 3.7.1**.
1491 1500
1492 1501 - Fix moving through generator stack in ipdb :ghpull:`11266`
1493 1502
1494 1503 - %Magic command arguments now support quoting. :ghpull:`11330`
1495 1504
1496 1505 - Re-add ``rprint`` and ``rprinte`` aliases. :ghpull:`11331`
1497 1506
1498 1507 - Remove implicit dependency on ``ipython_genutils`` :ghpull:`11317`
1499 1508
1500 1509 - Make ``nonlocal`` raise ``SyntaxError`` instead of silently failing in async
1501 1510 mode. :ghpull:`11382`
1502 1511
1503 1512 - Fix mishandling of magics and ``= !`` assignment just after a dedent in
1504 1513 nested code blocks :ghpull:`11418`
1505 1514
1506 1515 - Fix instructions for custom shortcuts :ghpull:`11426`
1507 1516
1508 1517
1509 1518 Notable Internals improvements:
1510 1519
1511 1520 - Use of ``os.scandir`` (Python 3 only) to speed up some file system operations.
1512 1521 :ghpull:`11365`
1513 1522
1514 1523 - use ``perf_counter`` instead of ``clock`` for more precise
1515 1524 timing results with ``%time`` :ghpull:`11376`
1516 1525
1517 1526 Many thanks to all the contributors and in particular to ``bartskowron`` and
1518 1527 ``tonyfast`` who handled some pretty complicated bugs in the input machinery. We
1519 1528 had a number of first time contributors and maybe hacktoberfest participants that
1520 1529 made significant contributions and helped us free some time to focus on more
1521 1530 complicated bugs.
1522 1531
1523 1532 You
1524 1533 can see all the closed issues and Merged PR, new features and fixes `here
1525 1534 <https://github.com/ipython/ipython/issues?utf8=%E2%9C%93&q=+is%3Aclosed+milestone%3A7.1+>`_.
1526 1535
1527 1536 Unicode Completion update
1528 1537 -------------------------
1529 1538
1530 1539 In IPython 7.1 the Unicode completion map has been updated and synchronized with
1531 1540 the Julia language.
1532 1541
1533 1542 Added and removed character characters:
1534 1543
1535 1544 ``\jmath`` (``Θ·``), ``\\underleftrightarrow`` (U+034D, combining) have been
1536 1545 added, while ``\\textasciicaron`` have been removed
1537 1546
1538 1547 Some sequences have seen their prefix removed:
1539 1548
1540 1549 - 6 characters ``\text...<tab>`` should now be inputed with ``\...<tab>`` directly,
1541 1550 - 45 characters ``\Elz...<tab>`` should now be inputed with ``\...<tab>`` directly,
1542 1551 - 65 characters ``\B...<tab>`` should now be inputed with ``\...<tab>`` directly,
1543 1552 - 450 characters ``\m...<tab>`` should now be inputed with ``\...<tab>`` directly,
1544 1553
1545 1554 Some sequences have seen their prefix shortened:
1546 1555
1547 1556 - 5 characters ``\mitBbb...<tab>`` should now be inputed with ``\bbi...<tab>`` directly,
1548 1557 - 52 characters ``\mit...<tab>`` should now be inputed with ``\i...<tab>`` directly,
1549 1558 - 216 characters ``\mbfit...<tab>`` should now be inputed with ``\bi...<tab>`` directly,
1550 1559 - 222 characters ``\mbf...<tab>`` should now be inputed with ``\b...<tab>`` directly,
1551 1560
1552 1561 A couple of characters had their sequence simplified:
1553 1562
1554 1563 - ``Γ°``, type ``\dh<tab>``, instead of ``\eth<tab>``
1555 1564 - ``Δ§``, type ``\hbar<tab>``, instead of ``\Elzxh<tab>``
1556 1565 - ``ΙΈ``, type ``\ltphi<tab>``, instead of ``\textphi<tab>``
1557 1566 - ``Ο΄``, type ``\varTheta<tab>``, instead of ``\textTheta<tab>``
1558 1567 - ``ℇ``, type ``\eulermascheroni<tab>``, instead of ``\Eulerconst<tab>``
1559 1568 - ``β„Ž``, type ``\planck<tab>``, instead of ``\Planckconst<tab>``
1560 1569
1561 1570 - U+0336 (COMBINING LONG STROKE OVERLAY), type ``\strike<tab>``, instead of ``\Elzbar<tab>``.
1562 1571
1563 1572 A couple of sequences have been updated:
1564 1573
1565 1574 - ``\varepsilon`` now gives ``Ι›`` (GREEK SMALL LETTER EPSILON) instead of ``Ξ΅`` (GREEK LUNATE EPSILON SYMBOL),
1566 1575 - ``\underbar`` now gives U+0331 (COMBINING MACRON BELOW) instead of U+0332 (COMBINING LOW LINE).
1567 1576
1568 1577
1569 1578 .. _whatsnew700:
1570 1579
1571 1580 IPython 7.0.0
1572 1581 =============
1573 1582
1574 1583 Released Thursday September 27th, 2018
1575 1584
1576 1585 IPython 7 includes major feature improvements.
1577 1586 This is also the second major version of IPython to support only
1578 1587 Python 3 – starting at Python 3.4. Python 2 is still community-supported
1579 1588 on the bugfix only 5.x branch, but we remind you that Python 2 "end of life"
1580 1589 is on Jan 1st 2020.
1581 1590
1582 1591 We were able to backport bug fixes to the 5.x branch thanks to our backport bot which
1583 1592 backported more than `70 Pull-Requests
1584 1593 <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>`_
1585 1594
1586 1595 The IPython 6.x branch will likely not see any further release unless critical
1587 1596 bugs are found.
1588 1597
1589 1598 Make sure you have pip > 9.0 before upgrading. You should be able to update by running:
1590 1599
1591 1600 .. code::
1592 1601
1593 1602 pip install ipython --upgrade
1594 1603
1595 1604 .. only:: ipydev
1596 1605
1597 1606 If you are trying to install or update an ``alpha``, ``beta``, or ``rc``
1598 1607 version, use pip ``--pre`` flag.
1599 1608
1600 1609 .. code::
1601 1610
1602 1611 pip install ipython --upgrade --pre
1603 1612
1604 1613
1605 1614 Or, if you have conda installed:
1606 1615
1607 1616 .. code::
1608 1617
1609 1618 conda install ipython
1610 1619
1611 1620
1612 1621
1613 1622 Prompt Toolkit 2.0
1614 1623 ------------------
1615 1624
1616 1625 IPython 7.0+ now uses ``prompt_toolkit 2.0``. If you still need to use an earlier
1617 1626 ``prompt_toolkit`` version, you may need to pin IPython to ``<7.0``.
1618 1627
1619 1628 Autowait: Asynchronous REPL
1620 1629 ---------------------------
1621 1630
1622 1631 Staring with IPython 7.0 on Python 3.6+, IPython can automatically ``await``
1623 1632 top level code. You should not need to access an event loop or runner
1624 1633 yourself. To learn more, read the :ref:`autoawait` section of our docs, see
1625 1634 :ghpull:`11265`, or try the following code::
1626 1635
1627 1636 Python 3.6.0
1628 1637 Type 'copyright', 'credits' or 'license' for more information
1629 1638 IPython 7.0.0 -- An enhanced Interactive Python. Type '?' for help.
1630 1639
1631 1640 In [1]: import aiohttp
1632 1641 ...: result = aiohttp.get('https://api.github.com')
1633 1642
1634 1643 In [2]: response = await result
1635 1644 <pause for a few 100s ms>
1636 1645
1637 1646 In [3]: await response.json()
1638 1647 Out[3]:
1639 1648 {'authorizations_url': 'https://api.github.com/authorizations',
1640 1649 'code_search_url': 'https://api.github.com/search/code?q={query}{&page,per_page,sort,order}',
1641 1650 ...
1642 1651 }
1643 1652
1644 1653 .. note::
1645 1654
1646 1655 Async integration is experimental code, behavior may change or be removed
1647 1656 between Python and IPython versions without warnings.
1648 1657
1649 1658 Integration is by default with `asyncio`, but other libraries can be configured --
1650 1659 like ``curio`` or ``trio`` -- to improve concurrency in the REPL::
1651 1660
1652 1661 In [1]: %autoawait trio
1653 1662
1654 1663 In [2]: import trio
1655 1664
1656 1665 In [3]: async def child(i):
1657 1666 ...: print(" child %s goes to sleep"%i)
1658 1667 ...: await trio.sleep(2)
1659 1668 ...: print(" child %s wakes up"%i)
1660 1669
1661 1670 In [4]: print('parent start')
1662 1671 ...: async with trio.open_nursery() as n:
1663 1672 ...: for i in range(3):
1664 1673 ...: n.spawn(child, i)
1665 1674 ...: print('parent end')
1666 1675 parent start
1667 1676 child 2 goes to sleep
1668 1677 child 0 goes to sleep
1669 1678 child 1 goes to sleep
1670 1679 <about 2 seconds pause>
1671 1680 child 2 wakes up
1672 1681 child 1 wakes up
1673 1682 child 0 wakes up
1674 1683 parent end
1675 1684
1676 1685 See :ref:`autoawait` for more information.
1677 1686
1678 1687
1679 1688 Asynchronous code in a Notebook interface or any other frontend using the
1680 1689 Jupyter Protocol will require further updates to the IPykernel package.
1681 1690
1682 1691 Non-Asynchronous code
1683 1692 ~~~~~~~~~~~~~~~~~~~~~
1684 1693
1685 1694 As the internal API of IPython is now asynchronous, IPython needs to run under
1686 1695 an event loop. In order to allow many workflows, (like using the :magic:`%run`
1687 1696 magic, or copy-pasting code that explicitly starts/stop event loop), when
1688 1697 top-level code is detected as not being asynchronous, IPython code is advanced
1689 1698 via a pseudo-synchronous runner, and may not advance pending tasks.
1690 1699
1691 1700 Change to Nested Embed
1692 1701 ~~~~~~~~~~~~~~~~~~~~~~
1693 1702
1694 1703 The introduction of the ability to run async code had some effect on the
1695 1704 ``IPython.embed()`` API. By default, embed will not allow you to run asynchronous
1696 1705 code unless an event loop is specified.
1697 1706
1698 1707 Effects on Magics
1699 1708 ~~~~~~~~~~~~~~~~~
1700 1709
1701 1710 Some magics will not work with async until they're updated.
1702 1711 Contributions welcome.
1703 1712
1704 1713 Expected Future changes
1705 1714 ~~~~~~~~~~~~~~~~~~~~~~~
1706 1715
1707 1716 We expect more internal but public IPython functions to become ``async``, and
1708 1717 will likely end up having a persistent event loop while IPython is running.
1709 1718
1710 1719 Thanks
1711 1720 ~~~~~~
1712 1721
1713 1722 This release took more than a year in the making.
1714 1723 The code was rebased a number of
1715 1724 times; leading to commit authorship that may have been lost in the final
1716 1725 Pull-Request. Huge thanks to many people for contribution, discussion, code,
1717 1726 documentation, use-cases: dalejung, danielballan, ellisonbg, fperez, gnestor,
1718 1727 minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many others.
1719 1728
1720 1729
1721 1730 Autoreload Improvement
1722 1731 ----------------------
1723 1732
1724 1733 The magic :magic:`%autoreload 2 <autoreload>` now captures new methods added to
1725 1734 classes. Earlier, only methods existing as of the initial import were being
1726 1735 tracked and updated.
1727 1736
1728 1737 This new feature helps dual environment development - Jupyter+IDE - where the
1729 1738 code gradually moves from notebook cells to package files as it gets
1730 1739 structured.
1731 1740
1732 1741 **Example**: An instance of the class ``MyClass`` will be able to access the
1733 1742 method ``cube()`` after it is uncommented and the file ``file1.py`` is saved on
1734 1743 disk.
1735 1744
1736 1745
1737 1746 .. code::
1738 1747
1739 1748 # notebook
1740 1749
1741 1750 from mymodule import MyClass
1742 1751 first = MyClass(5)
1743 1752
1744 1753 .. code::
1745 1754
1746 1755 # mymodule/file1.py
1747 1756
1748 1757 class MyClass:
1749 1758
1750 1759 def __init__(self, a=10):
1751 1760 self.a = a
1752 1761
1753 1762 def square(self):
1754 1763 print('compute square')
1755 1764 return self.a*self.a
1756 1765
1757 1766 # def cube(self):
1758 1767 # print('compute cube')
1759 1768 # return self.a*self.a*self.a
1760 1769
1761 1770
1762 1771
1763 1772
1764 1773 Misc
1765 1774 ----
1766 1775
1767 1776 The autoindent feature that was deprecated in 5.x was re-enabled and
1768 1777 un-deprecated in :ghpull:`11257`
1769 1778
1770 1779 Make :magic:`%run -n -i ... <run>` work correctly. Earlier, if :magic:`%run` was
1771 1780 passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308`
1772 1781
1773 1782
1774 1783 The :cellmagic:`%%script` (as well as :cellmagic:`%%bash`,
1775 1784 :cellmagic:`%%ruby`... ) cell magics now raise by default if the return code of
1776 1785 the given code is non-zero (thus halting execution of further cells in a
1777 1786 notebook). The behavior can be disable by passing the ``--no-raise-error`` flag.
1778 1787
1779 1788
1780 1789 Deprecations
1781 1790 ------------
1782 1791
1783 1792 A couple of unused functions and methods have been deprecated and will be removed
1784 1793 in future versions:
1785 1794
1786 1795 - ``IPython.utils.io.raw_print_err``
1787 1796 - ``IPython.utils.io.raw_print``
1788 1797
1789 1798
1790 1799 Backwards incompatible changes
1791 1800 ------------------------------
1792 1801
1793 1802 * The API for transforming input before it is parsed as Python code has been
1794 1803 completely redesigned: any custom input transformations will need to be
1795 1804 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