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