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