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