##// END OF EJS Templates
Update docs/source/whatsnew/version7.rst...
Matthias Bussonnier -
Show More
@@ -1,1226 +1,1226 b''
1 1 ============
2 2 7.x Series
3 3 ============
4 4
5 5 .. _version 720:
6 6
7 7 IPython 7.20
8 8 ============
9 9
10 10 IPython 7.20 is the accumulation of 3 month of work on IPython, spacing between
11 11 IPython release have been increased from the usual once a month for various
12 12 reason.
13 13
14 14 - Mainly as I'm too busy and the effectively sole maintainer, and
15 15 - Second because not much changes happened before mid December.
16 16
17 17 The main driver for this release was the new version of Jedi 0.18 breaking API;
18 18 which was taken care of in the master branch early in 2020 but not in 7.x as I
19 19 though that by now 8.0 would be out.
20 20
21 21 The inclusion of a resolver in pip did not help and actually made things worse.
22 22 If usually I would have simply pinned Jedi to ``<0.18``; this is not a solution
23 23 anymore as now pip is free to install Jedi 0.18, and downgrade IPython.
24 24
25 25 I'll do my best to keep the regular release, but as the 8.0-dev branch and 7.x
26 26 are starting to diverge this is becoming difficult in particular with my limited
27 27 time, so if you have any cycles to spare I'll appreciate your help to respond to
28 28 issues and pushing 8.0 forward.
29 29
30 30 Here are thus some of the changes for IPython 7.20.
31 31
32 32 - Support for PyQt5 >= 5.11 :ghpull:`12715`
33 33 - ``%reset`` remove imports more agressively :ghpull:`12718`
34 - fix the ``%conda`` magic :ghull:`12739`
34 - fix the ``%conda`` magic :ghpull:`12739`
35 35 - compatibility with Jedi 0.18, and bump minimum Jedi version. :ghpull:`12793`
36 36
37 37
38 38 .. _version 719:
39 39
40 40 IPython 7.19
41 41 ============
42 42
43 43 IPython 7.19 accumulative two month of works, bug fixes and improvements, there
44 44 was exceptionally no release last month.
45 45
46 46 - Fix to restore the ability to specify more than one extension using command
47 47 line flags when using traitlets 5.0 :ghpull:`12543`
48 48 - Docs docs formatting that make the install commands work on zsh
49 49 :ghpull:`12587`
50 50 - Always display the last frame in tracebacks even if hidden with
51 51 ``__traceback_hide__`` :ghpull:`12601`
52 52 - Avoid an issue where a callback can be registered multiple times.
53 53 :ghpull:`12625`
54 54 - Avoid an issue in debugger mode where frames changes could be lost.
55 55 :ghpull:`12627`
56 56
57 57 - Never hide the frames that invoke a debugger, even if marked as hidden by
58 58 ``__traceback_hide__`` :ghpull:`12631`
59 59 - Fix calling the debugger in a recursive manner :ghpull:`12659`
60 60
61 61
62 62 A number of code changes have landed on master and we are getting close to
63 63 enough new features and codebase improvement that a 8.0 start to make sens.
64 64 For downstream packages, please start working on migrating downstream testing
65 65 away from iptest and using pytest, as nose will not work on Python 3.10 and we
66 66 will likely start removing it as a dependency for testing.
67 67
68 68 .. _version 718:
69 69
70 70 IPython 7.18
71 71 ============
72 72
73 73 IPython 7.18 is a minor release that mostly contains bugfixes.
74 74
75 75 - ``CRLF`` is now handled by magics my default; solving some issues due to copy
76 76 pasting on windows. :ghpull:`12475`
77 77
78 78 - Requiring pexpect ``>=4.3`` as we are Python 3.7+ only and earlier version of
79 79 pexpect will be incompatible. :ghpull:`12510`
80 80
81 81 - Minimum jedi version is now 0.16. :ghpull:`12488`
82 82
83 83
84 84
85 85 .. _version 717:
86 86
87 87 IPython 7.17
88 88 ============
89 89
90 90 IPython 7.17 brings a couple of new improvements to API and a couple of user
91 91 facing changes to make the terminal experience more user friendly.
92 92
93 93 :ghpull:`12407` introduces the ability to pass extra argument to the IPython
94 94 debugger class; this is to help a new project from ``kmaork``
95 95 (https://github.com/kmaork/madbg) to feature a fully remote debugger.
96 96
97 97 :ghpull:`12410` finally remove support for 3.6, while the codebase is still
98 98 technically compatible; IPython will not install on Python 3.6.
99 99
100 100 lots of work on the debugger and hidden frames from ``@impact27`` in
101 101 :ghpull:`12437`, :ghpull:`12445`, :ghpull:`12460` and in particular
102 102 :ghpull:`12453` which make the debug magic more robust at handling spaces.
103 103
104 104 Biggest API addition is code transformation which is done before code execution;
105 105 IPython allows a number of hooks to catch non-valid Python syntax (magic, prompt
106 106 stripping...etc). Transformers are usually called many time; typically:
107 107
108 108 - When trying to figure out whether the code is complete and valid (should we
109 109 insert a new line or execute ?)
110 110 - During actual code execution pass before giving the code to Python's
111 111 ``exec``.
112 112
113 113 This lead to issues when transformer might have had side effects; or do external
114 114 queries. Starting with IPython 7.17 you can expect your transformer to be called
115 115 less time.
116 116
117 117 Input transformers are now called only once in the execution path of
118 118 `InteractiveShell`, allowing to register transformer that potentially have side
119 119 effects (note that this is not recommended). Internal methods `should_run_async`, and
120 120 `run_cell_async` now take a recommended optional `transformed_cell`, and
121 121 `preprocessing_exc_tuple` parameters that will become mandatory at some point in
122 122 the future; that is to say cells need to be explicitly transformed to be valid
123 123 Python syntax ahead of trying to run them. :ghpull:`12440`;
124 124
125 125 ``input_transformers`` can now also have an attribute ``has_side_effects`` set
126 126 to `True`, when this attribute is present; this will prevent the transformers
127 127 from being ran when IPython is trying to guess whether the user input is
128 128 complete. Note that this may means you will need to explicitly execute in some
129 129 case where your transformations are now not ran; but will not affect users with
130 130 no custom extensions.
131 131
132 132
133 133 API Changes
134 134 -----------
135 135
136 136 Change of API and exposed objects automatically detected using `frappuccino
137 137 <https://pypi.org/project/frappuccino/>`_
138 138
139 139
140 140 The following items are new since 7.16.0::
141 141
142 142 + IPython.core.interactiveshell.InteractiveShell.get_local_scope(self, stack_depth)
143 143
144 144 The following signatures differ since 7.16.0::
145 145
146 146 - IPython.core.interactiveshell.InteractiveShell.run_cell_async(self, raw_cell, store_history=False, silent=False, shell_futures=True)
147 147 + 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)
148 148
149 149 - IPython.core.interactiveshell.InteractiveShell.should_run_async(self, raw_cell)
150 150 + IPython.core.interactiveshell.InteractiveShell.should_run_async(self, raw_cell, *, transformed_cell=None, preprocessing_exc_tuple=None)
151 151
152 152 - IPython.terminal.debugger.TerminalPdb.pt_init(self)
153 153 + IPython.terminal.debugger.TerminalPdb.pt_init(self, pt_session_options=None)
154 154
155 155 This method was added::
156 156
157 157 + IPython.core.interactiveshell.InteractiveShell.get_local_scope
158 158
159 159 Which is now also present on subclasses::
160 160
161 161 + IPython.terminal.embed.InteractiveShellEmbed.get_local_scope
162 162 + IPython.terminal.interactiveshell.TerminalInteractiveShell.get_local_scope
163 163
164 164
165 165 .. _version 716:
166 166
167 167 IPython 7.16
168 168 ============
169 169
170 170
171 171 The default traceback mode will now skip frames that are marked with
172 172 ``__tracebackhide__ = True`` and show how many traceback frames have been
173 173 skipped. This can be toggled by using :magic:`xmode` with the ``--show`` or
174 174 ``--hide`` attribute. It will have no effect on non verbose traceback modes.
175 175
176 176 The ipython debugger also now understands ``__tracebackhide__`` as well and will
177 177 skip hidden frames when displaying. Movement up and down the stack will skip the
178 178 hidden frames and will show how many frames were hidden. Internal IPython frames
179 179 are also now hidden by default. The behavior can be changed with the
180 180 ``skip_hidden`` while in the debugger, command and accepts "yes", "no", "true"
181 181 and "false" case insensitive parameters.
182 182
183 183
184 184 Misc Noticeable changes:
185 185 ------------------------
186 186
187 187 - Exceptions are now (re)raised when running notebooks via the :magic:`%run`, helping to catch issues in workflows and
188 188 pipelines. :ghpull:`12301`
189 189 - Fix inputhook for qt 5.15.0 :ghpull:`12355`
190 190 - Fix wx inputhook :ghpull:`12375`
191 191 - Add handling for malformed pathext env var (Windows) :ghpull:`12367`
192 192 - use $SHELL in system_piped :ghpull:`12360` for uniform behavior with
193 193 ipykernel.
194 194
195 195 Reproducible Build
196 196 ------------------
197 197
198 198 IPython 7.15 reproducible build did not work, so we try again this month
199 199 :ghpull:`12358`.
200 200
201 201
202 202 API Changes
203 203 -----------
204 204
205 205 Change of API and exposed objects automatically detected using `frappuccino
206 206 <https://pypi.org/project/frappuccino/>`_ (still in beta):
207 207
208 208
209 209 The following items are new and mostly related to understanding ``__tracebackbhide__``::
210 210
211 211 + IPython.core.debugger.Pdb.do_down(self, arg)
212 212 + IPython.core.debugger.Pdb.do_skip_hidden(self, arg)
213 213 + IPython.core.debugger.Pdb.do_up(self, arg)
214 214 + IPython.core.debugger.Pdb.hidden_frames(self, stack)
215 215 + IPython.core.debugger.Pdb.stop_here(self, frame)
216 216
217 217
218 218 The following items have been removed::
219 219
220 220 - IPython.core.debugger.Pdb.new_do_down
221 221 - IPython.core.debugger.Pdb.new_do_up
222 222
223 223 Those were implementation details.
224 224
225 225
226 226 .. _version 715:
227 227
228 228 IPython 7.15
229 229 ============
230 230
231 231 IPython 7.15 brings a number of bug fixes and user facing improvements.
232 232
233 233 Misc Noticeable changes:
234 234 ------------------------
235 235
236 236 - Long completion name have better elision in terminal :ghpull:`12284`
237 237 - I've started to test on Python 3.9 :ghpull:`12307` and fix some errors.
238 238 - Hi DPI scaling of figures when using qt eventloop :ghpull:`12314`
239 239 - Document the ability to have systemwide configuration for IPython.
240 240 :ghpull:`12328`
241 241 - Fix issues with input autoformatting :ghpull:`12336`
242 242 - ``IPython.core.debugger.Pdb`` is now interruptible (:ghpull:`12168`, in 7.14
243 243 but forgotten in release notes)
244 244 - Video HTML attributes (:ghpull:`12212`, in 7.14 but forgotten in release
245 245 notes)
246 246
247 247 Reproducible Build
248 248 ------------------
249 249
250 250 Starting with IPython 7.15, I am attempting to provide reproducible builds,
251 251 that is to say you should be able from the source tree to generate an sdist
252 252 and wheel that are identical byte for byte with the publish version on PyPI.
253 253
254 254 I've only tested on a couple of machines so far and the process is relatively
255 255 straightforward, so this mean that IPython not only have a deterministic build
256 256 process, but also I have either removed, or put under control all effects of
257 257 the build environments on the final artifact. I encourage you to attempt the
258 258 build process on your machine as documented in :ref:`core_developer_guide`
259 259 and let me know if you do not obtain an identical artifact.
260 260
261 261 While reproducible builds is critical to check that the supply chain of (open
262 262 source) software has not been compromised, it can also help to speedup many
263 263 of the build processes in large environment (conda, apt...) by allowing
264 264 better caching of intermediate build steps.
265 265
266 266 Learn more on `<https://reproducible-builds.org/>`_. `Reflections on trusting
267 267 trust <https://dl.acm.org/doi/10.1145/358198.358210>`_ is also one of the
268 268 cornerstone and recommended reads on this subject.
269 269
270 270 .. note::
271 271
272 272 The build commit from which the sdist is generated is also `signed
273 273 <https://en.wikipedia.org/wiki/Digital_signature>`_, so you should be able to
274 274 check it has not been compromised, and the git repository is a `merkle-tree
275 275 <https://en.wikipedia.org/wiki/Merkle_tree>`_, you can check the consistency
276 276 with `git-fsck <https://git-scm.com/docs/git-fsck>`_ which you likely `want
277 277 to enable by default
278 278 <https://gist.github.com/mbbx6spp/14b86437e794bffb4120>`_.
279 279
280 280 NEP29: Last version to support Python 3.6
281 281 -----------------------------------------
282 282
283 283 IPython 7.15 will be the Last IPython version to officially support Python
284 284 3.6, as stated by `NumPy Enhancement Proposal 29
285 285 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`_. Starting with
286 286 next minor version of IPython I may stop testing on Python 3.6 and may stop
287 287 publishing release artifacts that install on Python 3.6
288 288
289 289 Highlighted features
290 290 --------------------
291 291
292 292 Highlighted features are not new, but seem to not be widely known, this
293 293 section will help you discover in more narrative form what you can do with
294 294 IPython.
295 295
296 296 Increase Tab Completion Menu Height
297 297 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
298 298
299 299 In terminal IPython it is possible to increase the hight of the tab-completion
300 300 menu. To do so set the value of
301 301 :configtrait:`TerminalInteractiveShell.space_for_menu`, this will reserve more
302 302 space at the bottom of the screen for various kind of menus in IPython including
303 303 tab completion and searching in history.
304 304
305 305 Autoformat Code in the terminal
306 306 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
307 307
308 308 If you have a preferred code formatter, you can configure IPython to
309 309 reformat your code. Set the value of
310 310 :configtrait:`TerminalInteractiveShell.autoformatter` to for example ``'black'``
311 311 and IPython will auto format your code when possible.
312 312
313 313
314 314 .. _version 714:
315 315
316 316 IPython 7.14
317 317 ============
318 318
319 319 IPython 7.14 is a minor release that fix a couple of bugs and prepare
320 320 compatibility with new or future versions of some libraries.
321 321
322 322 Important changes:
323 323 ------------------
324 324
325 325 - Fix compatibility with Sphinx 3+ :ghpull:`12235`
326 326 - Remove deprecated matplotlib parameter usage, compatibility with matplotlib
327 327 3.3+ :`122250`
328 328
329 329 Misc Changes
330 330 ------------
331 331
332 332 - set ``.py`` extension when editing current buffer in vi/emacs. :ghpull:`12167`
333 333 - support for unicode identifiers in ``?``/``??`` :ghpull:`12208`
334 334 - add extra options to the ``Video`` Rich objects :ghpull:`12212`
335 335 - add pretty-printing to ``SimpleNamespace`` :ghpull:`12230`
336 336
337 337 IPython.core.debugger.Pdb is now interruptible
338 338 ----------------------------------------------
339 339
340 340 A ``KeyboardInterrupt`` will now interrupt IPython's extended debugger, in order to make Jupyter able to interrupt it. (:ghpull:`12168`)
341 341
342 342 Video HTML attributes
343 343 ---------------------
344 344
345 345 Add an option to `IPython.display.Video` to change the attributes of the HTML display of the video (:ghpull:`12212`)
346 346
347 347
348 348 Pending deprecated imports
349 349 --------------------------
350 350
351 351 Many object present in ``IPython.core.display`` are there for internal use only,
352 352 and should already been imported from ``IPython.display`` by users and external
353 353 libraries. Trying to import those from ``IPython.core.display`` is still possible
354 354 but will trigger a
355 355 deprecation warning in later versions of IPython and will become errors in the
356 356 future.
357 357
358 358 This will simplify compatibility with other Python kernels (like Xeus-Python),
359 359 and simplify code base.
360 360
361 361
362 362
363 363
364 364 .. _version 713:
365 365
366 366 IPython 7.13
367 367 ============
368 368
369 369 IPython 7.13 is the final release of the 7.x branch since master is diverging
370 370 toward an 8.0. Exiting new features have already been merged in 8.0 and will
371 371 not be available on the 7.x branch. All the changes below have been backported
372 372 from the master branch.
373 373
374 374
375 375 - Fix inability to run PDB when inside an event loop :ghpull:`12141`
376 376 - Fix ability to interrupt some processes on windows :ghpull:`12137`
377 377 - Fix debugger shortcuts :ghpull:`12132`
378 378 - improve tab completion when inside a string by removing irrelevant elements :ghpull:`12128`
379 379 - Fix display of filename tab completion when the path is long :ghpull:`12122`
380 380 - Many removal of Python 2 specific code path :ghpull:`12110`
381 381 - displaying wav files do not require NumPy anymore, and is 5x to 30x faster :ghpull:`12113`
382 382
383 383 See the list of all closed issues and pull request on `github
384 384 <https://github.com/ipython/ipython/pulls?q=is%3Aclosed+milestone%3A7.13>`_.
385 385
386 386 .. _version 712:
387 387
388 388 IPython 7.12
389 389 ============
390 390
391 391 IPython 7.12 is a minor update that mostly brings code cleanup, removal of
392 392 longtime deprecated function and a couple update to documentation cleanup as well.
393 393
394 394 Notable changes are the following:
395 395
396 396 - Exit non-zero when ipython is given a file path to run that doesn't exist :ghpull:`12074`
397 397 - Test PR on ARM64 with Travis-CI :ghpull:`12073`
398 398 - Update CI to work with latest Pytest :ghpull:`12086`
399 399 - Add infrastructure to run ipykernel eventloop via trio :ghpull:`12097`
400 400 - Support git blame ignore revs :ghpull:`12091`
401 401 - Start multi-line ``__repr__`` s on their own line :ghpull:`12099`
402 402
403 403 .. _version 7111:
404 404
405 405 IPython 7.11.1
406 406 ==============
407 407
408 408 A couple of deprecated functions (no-op) have been reintroduces in py3compat as
409 409 Cython was still relying on them, and will be removed in a couple of versions.
410 410
411 411 .. _version 711:
412 412
413 413 IPython 7.11
414 414 ============
415 415
416 416 IPython 7.11 received a couple of compatibility fixes and code cleanup.
417 417
418 418 A number of function in the ``py3compat`` have been removed; a number of types
419 419 in the IPython code base are now non-ambiguous and now always ``unicode``
420 420 instead of ``Union[Unicode,bytes]``; many of the relevant code path have thus
421 421 been simplified/cleaned and types annotation added.
422 422
423 423 IPython support several verbosity level from exceptions. ``xmode plain`` now
424 424 support chained exceptions. :ghpull:`11999`
425 425
426 426 We are starting to remove ``shell=True`` in some usages of subprocess. While not directly
427 427 a security issue (as IPython is made to run arbitrary code anyway) it is not good
428 428 practice and we'd like to show the example. :ghissue:`12023`. This discussion
429 429 was started by ``@mschwager`` thanks to a new auditing tool they are working on
430 430 with duo-labs (`dlint <https://github.com/duo-labs/dlint>`_).
431 431
432 432 Work around some bugs in Python 3.9 tokenizer :ghpull:`12057`
433 433
434 434 IPython will now print its version after a crash. :ghpull:`11986`
435 435
436 436 This is likely the last release from the 7.x series that will see new feature.
437 437 The master branch will soon accept large code changes and thrilling new
438 438 features; the 7.x branch will only start to accept critical bug fixes, and
439 439 update dependencies.
440 440
441 441 .. _version 7102:
442 442
443 443 IPython 7.10.2
444 444 ==============
445 445
446 446 IPython 7.10.2 fix a couple of extra incompatibility between IPython, ipdb,
447 447 asyncio and Prompt Toolkit 3.
448 448
449 449 .. _version 7101:
450 450
451 451 IPython 7.10.1
452 452 ==============
453 453
454 454 IPython 7.10.1 fix a couple of incompatibilities with Prompt toolkit 3 (please
455 455 update Prompt toolkit to 3.0.2 at least), and fixes some interaction with
456 456 headless IPython.
457 457
458 458 .. _version 7100:
459 459
460 460 IPython 7.10.0
461 461 ==============
462 462
463 463 IPython 7.10 is the first double digit minor release in the last decade, and
464 464 first since the release of IPython 1.0, previous double digit minor release was
465 465 in August 2009.
466 466
467 467 We've been trying to give you regular release on the last Friday of every month
468 468 for a guaranty of rapid access to bug fixes and new features.
469 469
470 470 Unlike the previous first few releases that have seen only a couple of code
471 471 changes, 7.10 bring a number of changes, new features and bugfixes.
472 472
473 473 Stop Support for Python 3.5 – Adopt NEP 29
474 474 ------------------------------------------
475 475
476 476 IPython has decided to follow the informational `NEP 29
477 477 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`_ which layout a clear
478 478 policy as to which version of (C)Python and NumPy are supported.
479 479
480 480 We thus dropped support for Python 3.5, and cleaned up a number of code path
481 481 that were Python-version dependant. If you are on 3.5 or earlier pip should
482 482 automatically give you the latest compatible version of IPython so you do not
483 483 need to pin to a given version.
484 484
485 485 Support for Prompt Toolkit 3.0
486 486 ------------------------------
487 487
488 488 Prompt Toolkit 3.0 was release a week before IPython 7.10 and introduces a few
489 489 breaking changes. We believe IPython 7.10 should be compatible with both Prompt
490 490 Toolkit 2.x and 3.x, though it has not been extensively tested with 3.x so
491 491 please report any issues.
492 492
493 493
494 494 Prompt Rendering Performance improvements
495 495 -----------------------------------------
496 496
497 497 Pull Request :ghpull:`11933` introduced an optimisation in the prompt rendering
498 498 logic that should decrease the resource usage of IPython when using the
499 499 _default_ configuration but could potentially introduce a regression of
500 500 functionalities if you are using a custom prompt.
501 501
502 502 We know assume if you haven't changed the default keybindings that the prompt
503 503 **will not change** during the duration of your input – which is for example
504 504 not true when using vi insert mode that switches between `[ins]` and `[nor]`
505 505 for the current mode.
506 506
507 507 If you are experiencing any issue let us know.
508 508
509 509 Code autoformatting
510 510 -------------------
511 511
512 512 The IPython terminal can now auto format your code just before entering a new
513 513 line or executing a command. To do so use the
514 514 ``--TerminalInteractiveShell.autoformatter`` option and set it to ``'black'``;
515 515 if black is installed IPython will use black to format your code when possible.
516 516
517 517 IPython cannot always properly format your code; in particular it will
518 518 auto formatting with *black* will only work if:
519 519
520 520 - Your code does not contains magics or special python syntax.
521 521
522 522 - There is no code after your cursor.
523 523
524 524 The Black API is also still in motion; so this may not work with all versions of
525 525 black.
526 526
527 527 It should be possible to register custom formatter, though the API is till in
528 528 flux.
529 529
530 530 Arbitrary Mimetypes Handing in Terminal (Aka inline images in terminal)
531 531 -----------------------------------------------------------------------
532 532
533 533 When using IPython terminal it is now possible to register function to handle
534 534 arbitrary mimetypes. While rendering non-text based representation was possible in
535 535 many jupyter frontend; it was not possible in terminal IPython, as usually
536 536 terminal are limited to displaying text. As many terminal these days provide
537 537 escape sequences to display non-text; bringing this loved feature to IPython CLI
538 538 made a lot of sens. This functionality will not only allow inline images; but
539 539 allow opening of external program; for example ``mplayer`` to "display" sound
540 540 files.
541 541
542 542 So far only the hooks necessary for this are in place, but no default mime
543 543 renderers added; so inline images will only be available via extensions. We will
544 544 progressively enable these features by default in the next few releases, and
545 545 contribution is welcomed.
546 546
547 547 We welcome any feedback on the API. See :ref:`shell_mimerenderer` for more
548 548 informations.
549 549
550 550 This is originally based on work form in :ghpull:`10610` from @stephanh42
551 551 started over two years ago, and still a lot need to be done.
552 552
553 553 MISC
554 554 ----
555 555
556 556 - Completions can define their own ordering :ghpull:`11855`
557 557 - Enable Plotting in the same cell than the one that import matplotlib
558 558 :ghpull:`11916`
559 559 - Allow to store and restore multiple variables at once :ghpull:`11930`
560 560
561 561 You can see `all pull-requests <https://github.com/ipython/ipython/pulls?q=is%3Apr+milestone%3A7.10+is%3Aclosed>`_ for this release.
562 562
563 563 API Changes
564 564 -----------
565 565
566 566 Change of API and exposed objects automatically detected using `frappuccino <https://pypi.org/project/frappuccino/>`_ (still in beta):
567 567
568 568 The following items are new in IPython 7.10::
569 569
570 570 + IPython.terminal.shortcuts.reformat_text_before_cursor(buffer, document, shell)
571 571 + IPython.terminal.interactiveshell.PTK3
572 572 + IPython.terminal.interactiveshell.black_reformat_handler(text_before_cursor)
573 573 + IPython.terminal.prompts.RichPromptDisplayHook.write_format_data(self, format_dict, md_dict='None')
574 574
575 575 The following items have been removed in 7.10::
576 576
577 577 - IPython.lib.pretty.DICT_IS_ORDERED
578 578
579 579 The following signatures differ between versions::
580 580
581 581 - IPython.extensions.storemagic.restore_aliases(ip)
582 582 + IPython.extensions.storemagic.restore_aliases(ip, alias='None')
583 583
584 584 Special Thanks
585 585 --------------
586 586
587 587 - @stephanh42 who started the work on inline images in terminal 2 years ago
588 588 - @augustogoulart who spent a lot of time triaging issues and responding to
589 589 users.
590 590 - @con-f-use who is my (@Carreau) first sponsor on GitHub, as a reminder if you
591 591 like IPython, Jupyter and many other library of the SciPy stack you can
592 592 donate to numfocus.org non profit
593 593
594 594 .. _version 790:
595 595
596 596 IPython 7.9.0
597 597 =============
598 598
599 599 IPython 7.9 is a small release with a couple of improvement and bug fixes.
600 600
601 601 - Xterm terminal title should be restored on exit :ghpull:`11910`
602 602 - special variables ``_``,``__``, ``___`` are not set anymore when cache size
603 603 is 0 or less. :ghpull:`11877`
604 604 - Autoreload should have regained some speed by using a new heuristic logic to
605 605 find all objects needing reload. This should avoid large objects traversal
606 606 like pandas dataframes. :ghpull:`11876`
607 607 - Get ready for Python 4. :ghpull:`11874`
608 608 - `%env` Magic now has heuristic to hide potentially sensitive values :ghpull:`11896`
609 609
610 610 This is a small release despite a number of Pull Request Pending that need to
611 611 be reviewed/worked on. Many of the core developers have been busy outside of
612 612 IPython/Jupyter and we thanks all contributor for their patience; we'll work on
613 613 these as soon as we have time.
614 614
615 615
616 616 .. _version780:
617 617
618 618 IPython 7.8.0
619 619 =============
620 620
621 621 IPython 7.8.0 contain a few bugfix and 2 new APIs:
622 622
623 623 - Enable changing the font color for LaTeX rendering :ghpull:`11840`
624 624 - and Re-Expose some PDB API (see below)
625 625
626 626 Expose Pdb API
627 627 --------------
628 628
629 629 Expose the built-in ``pdb.Pdb`` API. ``Pdb`` constructor arguments are generically
630 630 exposed, regardless of python version.
631 631 Newly exposed arguments:
632 632
633 633 - ``skip`` - Python 3.1+
634 634 - ``nosiginnt`` - Python 3.2+
635 635 - ``readrc`` - Python 3.6+
636 636
637 637 Try it out::
638 638
639 639 from IPython.terminal.debugger import TerminalPdb
640 640 pdb = TerminalPdb(skip=["skipthismodule"])
641 641
642 642
643 643 See :ghpull:`11840`
644 644
645 645 .. _version770:
646 646
647 647 IPython 7.7.0
648 648 =============
649 649
650 650 IPython 7.7.0 contain multiple bug fixes and documentation updates; Here are a
651 651 few of the outstanding issue fixed:
652 652
653 653 - Fix a bug introduced in 7.6 where the ``%matplotlib`` magic would fail on
654 654 previously acceptable arguments :ghpull:`11814`.
655 655 - Fix the manage location on freebsd :ghpull:`11808`.
656 656 - Fix error message about aliases after ``%reset`` call in ipykernel
657 657 :ghpull:`11806`
658 658 - Fix Duplication completions in emacs :ghpull:`11803`
659 659
660 660 We are planning to adopt `NEP29 <https://github.com/numpy/numpy/pull/14086>`_
661 661 (still currently in draft) which may make this minor version of IPython the
662 662 last one to support Python 3.5 and will make the code base more aggressive
663 663 toward removing compatibility with older versions of Python.
664 664
665 665 GitHub now support to give only "Triage" permissions to users; if you'd like to
666 666 help close stale issues and labels issues please reach to us with your GitHub
667 667 Username and we'll add you to the triage team. It is a great way to start
668 668 contributing and a path toward getting commit rights.
669 669
670 670 .. _version761:
671 671
672 672 IPython 7.6.1
673 673 =============
674 674
675 675 IPython 7.6.1 contain a critical bugfix in the ``%timeit`` magic, which would
676 676 crash on some inputs as a side effect of :ghpull:`11716`. See :ghpull:`11812`
677 677
678 678
679 679 .. _whatsnew760:
680 680
681 681 IPython 7.6.0
682 682 =============
683 683
684 684 IPython 7.6.0 contains a couple of bug fixes and number of small features
685 685 additions as well as some compatibility with the current development version of
686 686 Python 3.8.
687 687
688 688 - Add a ``-l`` option to :magic:`psearch` to list the available search
689 689 types. :ghpull:`11672`
690 690 - Support ``PathLike`` for ``DisplayObject`` and ``Image``. :ghpull:`11764`
691 691 - Configurability of timeout in the test suite for slow platforms.
692 692 :ghpull:`11756`
693 693 - Accept any casing for matplotlib backend. :ghpull:`121748`
694 694 - Properly skip test that requires numpy to be installed :ghpull:`11723`
695 695 - More support for Python 3.8 and positional only arguments (pep570)
696 696 :ghpull:`11720`
697 697 - Unicode names for the completion are loaded lazily on first use which
698 698 should decrease startup time. :ghpull:`11693`
699 699 - Autoreload now update the types of reloaded objects; this for example allow
700 700 pickling of reloaded objects. :ghpull:`11644`
701 701 - Fix a bug where ``%%time`` magic would suppress cell output. :ghpull:`11716`
702 702
703 703
704 704 Prepare migration to pytest (instead of nose) for testing
705 705 ---------------------------------------------------------
706 706
707 707 Most of the work between 7.5 and 7.6 was to prepare the migration from our
708 708 testing framework to pytest. Most of the test suite should now work by simply
709 709 issuing ``pytest`` from the root of the repository.
710 710
711 711 The migration to pytest is just at its beginning. Many of our test still rely
712 712 on IPython-specific plugins for nose using pytest (doctest using IPython syntax
713 713 is one example of this where test appear as "passing", while no code has been
714 714 ran). Many test also need to be updated like ``yield-test`` to be properly
715 715 parametrized tests.
716 716
717 717 Migration to pytest allowed me to discover a number of issues in our test
718 718 suite; which was hiding a number of subtle issues – or not actually running
719 719 some of the tests in our test suite – I have thus corrected many of those; like
720 720 improperly closed resources; or used of deprecated features. I also made use of
721 721 the ``pytest --durations=...`` to find some of our slowest test and speed them
722 722 up (our test suite can now be up to 10% faster). Pytest as also a variety of
723 723 plugins and flags which will make the code quality of IPython and the testing
724 724 experience better.
725 725
726 726 Misc
727 727 ----
728 728
729 729 We skipped the release of 7.6 at the end of May, but will attempt to get back
730 730 on schedule. We are starting to think about making introducing backward
731 731 incompatible change and start the 8.0 series.
732 732
733 733 Special Thanks to Gabriel (@gpotter2 on GitHub), who among other took care many
734 734 of the remaining task for 7.4 and 7.5, like updating the website.
735 735
736 736 .. _whatsnew750:
737 737
738 738 IPython 7.5.0
739 739 =============
740 740
741 741 IPython 7.5.0 consist mostly of bug-fixes, and documentation updates, with one
742 742 minor new feature. The `Audio` display element can now be assigned an element
743 743 id when displayed in browser. See :ghpull:`11670`
744 744
745 745 The major outstanding bug fix correct a change of behavior that was introduce
746 746 in 7.4.0 where some cell magics would not be able to access or modify global
747 747 scope when using the ``@needs_local_scope`` decorator. This was typically
748 748 encountered with the ``%%time`` and ``%%timeit`` magics. See :ghissue:`11659`
749 749 and :ghpull:`11698`.
750 750
751 751 .. _whatsnew740:
752 752
753 753 IPython 7.4.0
754 754 =============
755 755
756 756 Unicode name completions
757 757 ------------------------
758 758
759 759 Previously, we provided completion for a unicode name with its relative symbol.
760 760 With this, now IPython provides complete suggestions to unicode name symbols.
761 761
762 762 As on the PR, if user types ``\LAT<tab>``, IPython provides a list of
763 763 possible completions. In this case, it would be something like::
764 764
765 765 'LATIN CAPITAL LETTER A',
766 766 'LATIN CAPITAL LETTER B',
767 767 'LATIN CAPITAL LETTER C',
768 768 'LATIN CAPITAL LETTER D',
769 769 ....
770 770
771 771 This help to type unicode character that do not have short latex aliases, and
772 772 have long unicode names. for example ``Ν°``, ``\GREEK CAPITAL LETTER HETA``.
773 773
774 774 This feature was contributed by Luciana Marques :ghpull:`11583`.
775 775
776 776 Make audio normalization optional
777 777 ---------------------------------
778 778
779 779 Added 'normalize' argument to `IPython.display.Audio`. This argument applies
780 780 when audio data is given as an array of samples. The default of `normalize=True`
781 781 preserves prior behavior of normalizing the audio to the maximum possible range.
782 782 Setting to `False` disables normalization.
783 783
784 784
785 785 Miscellaneous
786 786 -------------
787 787
788 788 - Fix improper acceptation of ``return`` outside of functions. :ghpull:`11641`.
789 789 - Fixed PyQt 5.11 backwards incompatibility causing sip import failure.
790 790 :ghpull:`11613`.
791 791 - Fix Bug where ``type?`` would crash IPython. :ghpull:`1608`.
792 792 - Allow to apply ``@needs_local_scope`` to cell magics for convenience.
793 793 :ghpull:`11542`.
794 794
795 795 .. _whatsnew730:
796 796
797 797 IPython 7.3.0
798 798 =============
799 799
800 800 .. _whatsnew720:
801 801
802 802 IPython 7.3.0 bring several bug fixes and small improvements that you will
803 803 described bellow.
804 804
805 805 The biggest change to this release is the implementation of the ``%conda`` and
806 806 ``%pip`` magics, that will attempt to install packages in the **current
807 807 environment**. You may still need to restart your interpreter or kernel for the
808 808 change to be taken into account, but it should simplify installation of packages
809 809 into remote environment. Installing using pip/conda from the command line is
810 810 still the prefer method.
811 811
812 812 The ``%pip`` magic was already present, but was only printing a warning; now it
813 813 will actually forward commands to pip.
814 814
815 815 Misc bug fixes and improvements:
816 816
817 817 - Compatibility with Python 3.8.
818 818 - Do not expand shell variable in execution magics, and added the
819 819 ``no_var_expand`` decorator for magic requiring a similar functionality
820 820 :ghpull:`11516`
821 821 - Add ``%pip`` and ``%conda`` magic :ghpull:`11524`
822 822 - Re-initialize posix aliases after a ``%reset`` :ghpull:`11528`
823 823 - Allow the IPython command line to run ``*.ipynb`` files :ghpull:`11529`
824 824
825 825 IPython 7.2.0
826 826 =============
827 827
828 828 IPython 7.2.0 brings minor bugfixes, improvements, and new configuration options:
829 829
830 830 - Fix a bug preventing PySide2 GUI integration from working :ghpull:`11464`
831 831 - Run CI on Mac OS ! :ghpull:`11471`
832 832 - Fix IPython "Demo" mode. :ghpull:`11498`
833 833 - Fix ``%run`` magic with path in name :ghpull:`11499`
834 834 - Fix: add CWD to sys.path *after* stdlib :ghpull:`11502`
835 835 - Better rendering of signatures, especially long ones. :ghpull:`11505`
836 836 - Re-enable jedi by default if it's installed :ghpull:`11506`
837 837 - Add New ``minimal`` exception reporting mode (useful for educational purpose). See :ghpull:`11509`
838 838
839 839
840 840 Added ability to show subclasses when using pinfo and other utilities
841 841 ---------------------------------------------------------------------
842 842
843 843 When using ``?``/``??`` on a class, IPython will now list the first 10 subclasses.
844 844
845 845 Special Thanks to Chris Mentzel of the Moore Foundation for this feature. Chris
846 846 is one of the people who played a critical role in IPython/Jupyter getting
847 847 funding.
848 848
849 849 We are grateful for all the help Chris has given us over the years,
850 850 and we're now proud to have code contributed by Chris in IPython.
851 851
852 852 OSMagics.cd_force_quiet configuration option
853 853 --------------------------------------------
854 854
855 855 You can set this option to force the %cd magic to behave as if ``-q`` was passed:
856 856 ::
857 857
858 858 In [1]: cd /
859 859 /
860 860
861 861 In [2]: %config OSMagics.cd_force_quiet = True
862 862
863 863 In [3]: cd /tmp
864 864
865 865 In [4]:
866 866
867 867 See :ghpull:`11491`
868 868
869 869 In vi editing mode, whether the prompt includes the current vi mode can now be configured
870 870 -----------------------------------------------------------------------------------------
871 871
872 872 Set the ``TerminalInteractiveShell.prompt_includes_vi_mode`` to a boolean value
873 873 (default: True) to control this feature. See :ghpull:`11492`
874 874
875 875 .. _whatsnew710:
876 876
877 877 IPython 7.1.0
878 878 =============
879 879
880 880 IPython 7.1.0 is the first minor release after 7.0.0 and mostly brings fixes to
881 881 new features, internal refactoring, and fixes for regressions that happened during the 6.x->7.x
882 882 transition. It also brings **Compatibility with Python 3.7.1**, as we're
883 883 unwillingly relying on a bug in CPython.
884 884
885 885 New Core Dev:
886 886
887 887 - We welcome Jonathan Slenders to the commiters. Jonathan has done a fantastic
888 888 work on prompt_toolkit, and we'd like to recognise his impact by giving him
889 889 commit rights. :ghissue:`11397`
890 890
891 891 Notable Changes
892 892
893 893 - Major update of "latex to unicode" tab completion map (see below)
894 894
895 895 Notable New Features:
896 896
897 897 - Restore functionality and documentation of the **sphinx directive**, which
898 898 is now stricter (fail on error by daefault), has new configuration options,
899 899 has a brand new documentation page :ref:`ipython_directive` (which needs
900 900 some cleanup). It is also now *tested* so we hope to have less regressions.
901 901 :ghpull:`11402`
902 902
903 903 - ``IPython.display.Video`` now supports ``width`` and ``height`` arguments,
904 904 allowing a custom width and height to be set instead of using the video's
905 905 width and height. :ghpull:`11353`
906 906
907 907 - Warn when using ``HTML('<iframe>')`` instead of ``IFrame`` :ghpull:`11350`
908 908
909 909 - Allow Dynamic switching of editing mode between vi/emacs and show
910 910 normal/input mode in prompt when using vi. :ghpull:`11390`. Use ``%config
911 911 TerminalInteractiveShell.editing_mode = 'vi'`` or ``%config
912 912 TerminalInteractiveShell.editing_mode = 'emacs'`` to dynamically switch
913 913 between modes.
914 914
915 915
916 916 Notable Fixes:
917 917
918 918 - Fix entering of **multi-line blocks in terminal** IPython, and various
919 919 crashes in the new input transformation machinery :ghpull:`11354`,
920 920 :ghpull:`11356`, :ghpull:`11358`. These also fix a **Compatibility bug
921 921 with Python 3.7.1**.
922 922
923 923 - Fix moving through generator stack in ipdb :ghpull:`11266`
924 924
925 925 - %Magic command arguments now support quoting. :ghpull:`11330`
926 926
927 927 - Re-add ``rprint`` and ``rprinte`` aliases. :ghpull:`11331`
928 928
929 929 - Remove implicit dependency on ``ipython_genutils`` :ghpull:`11317`
930 930
931 931 - Make ``nonlocal`` raise ``SyntaxError`` instead of silently failing in async
932 932 mode. :ghpull:`11382`
933 933
934 934 - Fix mishandling of magics and ``= !`` assignment just after a dedent in
935 935 nested code blocks :ghpull:`11418`
936 936
937 937 - Fix instructions for custom shortcuts :ghpull:`11426`
938 938
939 939
940 940 Notable Internals improvements:
941 941
942 942 - Use of ``os.scandir`` (Python 3 only) to speed up some file system operations.
943 943 :ghpull:`11365`
944 944
945 945 - use ``perf_counter`` instead of ``clock`` for more precise
946 946 timing results with ``%time`` :ghpull:`11376`
947 947
948 948 Many thanks to all the contributors and in particular to ``bartskowron`` and
949 949 ``tonyfast`` who handled some pretty complicated bugs in the input machinery. We
950 950 had a number of first time contributors and maybe hacktoberfest participants that
951 951 made significant contributions and helped us free some time to focus on more
952 952 complicated bugs.
953 953
954 954 You
955 955 can see all the closed issues and Merged PR, new features and fixes `here
956 956 <https://github.com/ipython/ipython/issues?utf8=%E2%9C%93&q=+is%3Aclosed+milestone%3A7.1+>`_.
957 957
958 958 Unicode Completion update
959 959 -------------------------
960 960
961 961 In IPython 7.1 the Unicode completion map has been updated and synchronized with
962 962 the Julia language.
963 963
964 964 Added and removed character characters:
965 965
966 966 ``\jmath`` (``Θ·``), ``\\underleftrightarrow`` (U+034D, combining) have been
967 967 added, while ``\\textasciicaron`` have been removed
968 968
969 969 Some sequences have seen their prefix removed:
970 970
971 971 - 6 characters ``\text...<tab>`` should now be inputed with ``\...<tab>`` directly,
972 972 - 45 characters ``\Elz...<tab>`` should now be inputed with ``\...<tab>`` directly,
973 973 - 65 characters ``\B...<tab>`` should now be inputed with ``\...<tab>`` directly,
974 974 - 450 characters ``\m...<tab>`` should now be inputed with ``\...<tab>`` directly,
975 975
976 976 Some sequences have seen their prefix shortened:
977 977
978 978 - 5 characters ``\mitBbb...<tab>`` should now be inputed with ``\bbi...<tab>`` directly,
979 979 - 52 characters ``\mit...<tab>`` should now be inputed with ``\i...<tab>`` directly,
980 980 - 216 characters ``\mbfit...<tab>`` should now be inputed with ``\bi...<tab>`` directly,
981 981 - 222 characters ``\mbf...<tab>`` should now be inputed with ``\b...<tab>`` directly,
982 982
983 983 A couple of characters had their sequence simplified:
984 984
985 985 - ``Γ°``, type ``\dh<tab>``, instead of ``\eth<tab>``
986 986 - ``Δ§``, type ``\hbar<tab>``, instead of ``\Elzxh<tab>``
987 987 - ``ΙΈ``, type ``\ltphi<tab>``, instead of ``\textphi<tab>``
988 988 - ``Ο΄``, type ``\varTheta<tab>``, instead of ``\textTheta<tab>``
989 989 - ``ℇ``, type ``\eulermascheroni<tab>``, instead of ``\Eulerconst<tab>``
990 990 - ``β„Ž``, type ``\planck<tab>``, instead of ``\Planckconst<tab>``
991 991
992 992 - U+0336 (COMBINING LONG STROKE OVERLAY), type ``\strike<tab>``, instead of ``\Elzbar<tab>``.
993 993
994 994 A couple of sequences have been updated:
995 995
996 996 - ``\varepsilon`` now gives ``Ι›`` (GREEK SMALL LETTER EPSILON) instead of ``Ξ΅`` (GREEK LUNATE EPSILON SYMBOL),
997 997 - ``\underbar`` now gives U+0331 (COMBINING MACRON BELOW) instead of U+0332 (COMBINING LOW LINE).
998 998
999 999
1000 1000 .. _whatsnew700:
1001 1001
1002 1002 IPython 7.0.0
1003 1003 =============
1004 1004
1005 1005 Released Thursday September 27th, 2018
1006 1006
1007 1007 IPython 7 includes major feature improvements.
1008 1008 This is also the second major version of IPython to support only
1009 1009 Python 3 – starting at Python 3.4. Python 2 is still community-supported
1010 1010 on the bugfix only 5.x branch, but we remind you that Python 2 "end of life"
1011 1011 is on Jan 1st 2020.
1012 1012
1013 1013 We were able to backport bug fixes to the 5.x branch thanks to our backport bot which
1014 1014 backported more than `70 Pull-Requests
1015 1015 <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>`_
1016 1016
1017 1017 The IPython 6.x branch will likely not see any further release unless critical
1018 1018 bugs are found.
1019 1019
1020 1020 Make sure you have pip > 9.0 before upgrading. You should be able to update by running:
1021 1021
1022 1022 .. code::
1023 1023
1024 1024 pip install ipython --upgrade
1025 1025
1026 1026 .. only:: ipydev
1027 1027
1028 1028 If you are trying to install or update an ``alpha``, ``beta``, or ``rc``
1029 1029 version, use pip ``--pre`` flag.
1030 1030
1031 1031 .. code::
1032 1032
1033 1033 pip install ipython --upgrade --pre
1034 1034
1035 1035
1036 1036 Or, if you have conda installed:
1037 1037
1038 1038 .. code::
1039 1039
1040 1040 conda install ipython
1041 1041
1042 1042
1043 1043
1044 1044 Prompt Toolkit 2.0
1045 1045 ------------------
1046 1046
1047 1047 IPython 7.0+ now uses ``prompt_toolkit 2.0``. If you still need to use an earlier
1048 1048 ``prompt_toolkit`` version, you may need to pin IPython to ``<7.0``.
1049 1049
1050 1050 Autowait: Asynchronous REPL
1051 1051 ---------------------------
1052 1052
1053 1053 Staring with IPython 7.0 on Python 3.6+, IPython can automatically ``await``
1054 1054 top level code. You should not need to access an event loop or runner
1055 1055 yourself. To learn more, read the :ref:`autoawait` section of our docs, see
1056 1056 :ghpull:`11265`, or try the following code::
1057 1057
1058 1058 Python 3.6.0
1059 1059 Type 'copyright', 'credits' or 'license' for more information
1060 1060 IPython 7.0.0 -- An enhanced Interactive Python. Type '?' for help.
1061 1061
1062 1062 In [1]: import aiohttp
1063 1063 ...: result = aiohttp.get('https://api.github.com')
1064 1064
1065 1065 In [2]: response = await result
1066 1066 <pause for a few 100s ms>
1067 1067
1068 1068 In [3]: await response.json()
1069 1069 Out[3]:
1070 1070 {'authorizations_url': 'https://api.github.com/authorizations',
1071 1071 'code_search_url': 'https://api.github.com/search/code?q={query}{&page,per_page,sort,order}',
1072 1072 ...
1073 1073 }
1074 1074
1075 1075 .. note::
1076 1076
1077 1077 Async integration is experimental code, behavior may change or be removed
1078 1078 between Python and IPython versions without warnings.
1079 1079
1080 1080 Integration is by default with `asyncio`, but other libraries can be configured --
1081 1081 like ``curio`` or ``trio`` -- to improve concurrency in the REPL::
1082 1082
1083 1083 In [1]: %autoawait trio
1084 1084
1085 1085 In [2]: import trio
1086 1086
1087 1087 In [3]: async def child(i):
1088 1088 ...: print(" child %s goes to sleep"%i)
1089 1089 ...: await trio.sleep(2)
1090 1090 ...: print(" child %s wakes up"%i)
1091 1091
1092 1092 In [4]: print('parent start')
1093 1093 ...: async with trio.open_nursery() as n:
1094 1094 ...: for i in range(3):
1095 1095 ...: n.spawn(child, i)
1096 1096 ...: print('parent end')
1097 1097 parent start
1098 1098 child 2 goes to sleep
1099 1099 child 0 goes to sleep
1100 1100 child 1 goes to sleep
1101 1101 <about 2 seconds pause>
1102 1102 child 2 wakes up
1103 1103 child 1 wakes up
1104 1104 child 0 wakes up
1105 1105 parent end
1106 1106
1107 1107 See :ref:`autoawait` for more information.
1108 1108
1109 1109
1110 1110 Asynchronous code in a Notebook interface or any other frontend using the
1111 1111 Jupyter Protocol will require further updates to the IPykernel package.
1112 1112
1113 1113 Non-Asynchronous code
1114 1114 ~~~~~~~~~~~~~~~~~~~~~
1115 1115
1116 1116 As the internal API of IPython is now asynchronous, IPython needs to run under
1117 1117 an event loop. In order to allow many workflows, (like using the :magic:`%run`
1118 1118 magic, or copy-pasting code that explicitly starts/stop event loop), when
1119 1119 top-level code is detected as not being asynchronous, IPython code is advanced
1120 1120 via a pseudo-synchronous runner, and may not advance pending tasks.
1121 1121
1122 1122 Change to Nested Embed
1123 1123 ~~~~~~~~~~~~~~~~~~~~~~
1124 1124
1125 1125 The introduction of the ability to run async code had some effect on the
1126 1126 ``IPython.embed()`` API. By default, embed will not allow you to run asynchronous
1127 1127 code unless an event loop is specified.
1128 1128
1129 1129 Effects on Magics
1130 1130 ~~~~~~~~~~~~~~~~~
1131 1131
1132 1132 Some magics will not work with async until they're updated.
1133 1133 Contributions welcome.
1134 1134
1135 1135 Expected Future changes
1136 1136 ~~~~~~~~~~~~~~~~~~~~~~~
1137 1137
1138 1138 We expect more internal but public IPython functions to become ``async``, and
1139 1139 will likely end up having a persistent event loop while IPython is running.
1140 1140
1141 1141 Thanks
1142 1142 ~~~~~~
1143 1143
1144 1144 This release took more than a year in the making.
1145 1145 The code was rebased a number of
1146 1146 times; leading to commit authorship that may have been lost in the final
1147 1147 Pull-Request. Huge thanks to many people for contribution, discussion, code,
1148 1148 documentation, use-cases: dalejung, danielballan, ellisonbg, fperez, gnestor,
1149 1149 minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many others.
1150 1150
1151 1151
1152 1152 Autoreload Improvement
1153 1153 ----------------------
1154 1154
1155 1155 The magic :magic:`%autoreload 2 <autoreload>` now captures new methods added to
1156 1156 classes. Earlier, only methods existing as of the initial import were being
1157 1157 tracked and updated.
1158 1158
1159 1159 This new feature helps dual environment development - Jupyter+IDE - where the
1160 1160 code gradually moves from notebook cells to package files as it gets
1161 1161 structured.
1162 1162
1163 1163 **Example**: An instance of the class ``MyClass`` will be able to access the
1164 1164 method ``cube()`` after it is uncommented and the file ``file1.py`` is saved on
1165 1165 disk.
1166 1166
1167 1167
1168 1168 .. code::
1169 1169
1170 1170 # notebook
1171 1171
1172 1172 from mymodule import MyClass
1173 1173 first = MyClass(5)
1174 1174
1175 1175 .. code::
1176 1176
1177 1177 # mymodule/file1.py
1178 1178
1179 1179 class MyClass:
1180 1180
1181 1181 def __init__(self, a=10):
1182 1182 self.a = a
1183 1183
1184 1184 def square(self):
1185 1185 print('compute square')
1186 1186 return self.a*self.a
1187 1187
1188 1188 # def cube(self):
1189 1189 # print('compute cube')
1190 1190 # return self.a*self.a*self.a
1191 1191
1192 1192
1193 1193
1194 1194
1195 1195 Misc
1196 1196 ----
1197 1197
1198 1198 The autoindent feature that was deprecated in 5.x was re-enabled and
1199 1199 un-deprecated in :ghpull:`11257`
1200 1200
1201 1201 Make :magic:`%run -n -i ... <run>` work correctly. Earlier, if :magic:`%run` was
1202 1202 passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308`
1203 1203
1204 1204
1205 1205 The :cellmagic:`%%script` (as well as :cellmagic:`%%bash`,
1206 1206 :cellmagic:`%%ruby`... ) cell magics now raise by default if the return code of
1207 1207 the given code is non-zero (thus halting execution of further cells in a
1208 1208 notebook). The behavior can be disable by passing the ``--no-raise-error`` flag.
1209 1209
1210 1210
1211 1211 Deprecations
1212 1212 ------------
1213 1213
1214 1214 A couple of unused functions and methods have been deprecated and will be removed
1215 1215 in future versions:
1216 1216
1217 1217 - ``IPython.utils.io.raw_print_err``
1218 1218 - ``IPython.utils.io.raw_print``
1219 1219
1220 1220
1221 1221 Backwards incompatible changes
1222 1222 ------------------------------
1223 1223
1224 1224 * The API for transforming input before it is parsed as Python code has been
1225 1225 completely redesigned: any custom input transformations will need to be
1226 1226 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