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