##// END OF EJS Templates
Merge pull request #13605 from Carreau/wn8...
Matthias Bussonnier -
r27607:1da22098 merge
parent child Browse files
Show More
@@ -1,1021 +1,1044 b''
1 1 ============
2 2 8.x Series
3 3 ============
4 4
5 5
6 .. _version 8.2.0:
7
8 IPython 8.2.0
9 -------------
10
11 IPython 8.2 mostly bring bugfixes to IPython.
12
13 - Auto-suggestion can now be elected with the ``end`` key. :ghpull:`13566`
14 - Some traceback issues with ``assert etb is not None`` have been fixed. :ghpull:`13588`
15 - History is now pulled from the sqitel database and not from in-memory.
16 In particular when using the ``%paste`` magic, the content of the pasted text will
17 be part of the history and not the verbatim text ``%paste`` anymore. :ghpull:`13592`
18 - Fix ``Ctrl-\\`` exit cleanup :ghpull:`13603`
19 - Fixes to ``ultratb`` ipdb support when used outside of IPython. :ghpull:`13498`
20
21
22 I am still trying to fix and investigate :ghissue:`13598`, which seem to be
23 random, and would appreciate help if you find reproducible minimal case. I've
24 tried to make various changes to the codebase to mitigate it, but a proper fix
25 will be difficult without understating the cause.
26
27
28
6 29 .. _version 8.1.1:
7 30
8 31 IPython 8.1.1
9 32 -------------
10 33
11 34 Fix an issue with virtualenv and Python 3.8 introduced in 8.1
12 35
13 36 Revert :ghpull:`13537` (fix an issue with symlinks in virtualenv) that raises an
14 37 error in Python 3.8, and fixed in a different way in :ghpull:`13559`.
15 38
16 39 .. _version 8.1:
17 40
18 41 IPython 8.1.0
19 42 -------------
20 43
21 44 IPython 8.1 is the first minor release after 8.0 and fixes a number of bugs and
22 45 Update a few behavior that were problematic with the 8.0 as with many new major
23 46 release.
24 47
25 48 Note that beyond the changes listed here, IPython 8.1.0 also contains all the
26 49 features listed in :ref:`version 7.32`.
27 50
28 51 - Misc and multiple fixes around quotation auto-closing. It is now disabled by
29 52 default. Run with ``TerminalInteractiveShell.auto_match=True`` to re-enabled
30 53 - Require pygments>=2.4.0 :ghpull:`13459`, this was implicit in the code, but
31 54 is now explicit in ``setup.cfg``/``setup.py``
32 55 - Docs improvement of ``core.magic_arguments`` examples. :ghpull:`13433`
33 56 - Multi-line edit executes too early with await. :ghpull:`13424`
34 57
35 58 - ``black`` is back as an optional dependency, and autoformatting disabled by
36 59 default until some fixes are implemented (black improperly reformat magics).
37 60 :ghpull:`13471` Additionally the ability to use ``yapf`` as a code
38 61 reformatter has been added :ghpull:`13528` . You can use
39 62 ``TerminalInteractiveShell.autoformatter="black"``,
40 63 ``TerminalInteractiveShell.autoformatter="yapf"`` to re-enable auto formating
41 64 with black, or switch to yapf.
42 65
43 66 - Fix and issue where ``display`` was not defined.
44 67
45 68 - Auto suggestions are now configurable. Currently only
46 69 ``AutoSuggestFromHistory`` (default) and ``None``. new provider contribution
47 70 welcomed. :ghpull:`13475`
48 71
49 72 - multiple packaging/testing improvement to simplify downstream packaging
50 73 (xfail with reasons, try to not access network...).
51 74
52 75 - Update deprecation. ``InteractiveShell.magic`` internal method has been
53 76 deprecated for many years but did not emit a warning until now.
54 77
55 78 - internal ``appended_to_syspath`` context manager has been deprecated.
56 79
57 80 - fix an issue with symlinks in virtualenv :ghpull:`13537` (Reverted in 8.1.1)
58 81
59 82 - Fix an issue with vim mode, where cursor would not be reset on exit :ghpull:`13472`
60 83
61 84 - ipython directive now remove only known pseudo-decorators :ghpull:`13532`
62 85
63 86 - ``IPython/lib/security`` which used to be used for jupyter notebook has been
64 87 removed.
65 88
66 89 - Fix an issue where ``async with`` would execute on new lines. :ghpull:`13436`
67 90
68 91
69 92 We want to remind users that IPython is part of the Jupyter organisations, and
70 93 thus governed by a Code of Conduct. Some of the behavior we have seen on GitHub is not acceptable.
71 94 Abuse and non-respectful comments on discussion will not be tolerated.
72 95
73 96 Many thanks to all the contributors to this release, many of the above fixed issue and
74 97 new features where done by first time contributors, showing there is still
75 98 plenty of easy contribution possible in IPython
76 99 . You can find all individual contributions
77 100 to this milestone `on github <https://github.com/ipython/ipython/milestone/91>`__.
78 101
79 102 Thanks as well to the `D. E. Shaw group <https://deshaw.com/>`__ for sponsoring
80 103 work on IPython and related libraries. In particular the Lazy autoloading of
81 104 magics that you will find described in the 7.32 release notes.
82 105
83 106
84 107 .. _version 8.0.1:
85 108
86 109 IPython 8.0.1 (CVE-2022-21699)
87 110 ------------------------------
88 111
89 112 IPython 8.0.1, 7.31.1 and 5.11 are security releases that change some default
90 113 values in order to prevent potential Execution with Unnecessary Privileges.
91 114
92 115 Almost all version of IPython looks for configuration and profiles in current
93 116 working directory. Since IPython was developed before pip and environments
94 117 existed it was used a convenient way to load code/packages in a project
95 118 dependant way.
96 119
97 120 In 2022, it is not necessary anymore, and can lead to confusing behavior where
98 121 for example cloning a repository and starting IPython or loading a notebook from
99 122 any Jupyter-Compatible interface that has ipython set as a kernel can lead to
100 123 code execution.
101 124
102 125
103 126 I did not find any standard way for packaged to advertise CVEs they fix, I'm
104 127 thus trying to add a ``__patched_cves__`` attribute to the IPython module that
105 128 list the CVEs that should have been fixed. This attribute is informational only
106 129 as if a executable has a flaw, this value can always be changed by an attacker.
107 130
108 131 .. code::
109 132
110 133 In [1]: import IPython
111 134
112 135 In [2]: IPython.__patched_cves__
113 136 Out[2]: {'CVE-2022-21699'}
114 137
115 138 In [3]: 'CVE-2022-21699' in IPython.__patched_cves__
116 139 Out[3]: True
117 140
118 141 Thus starting with this version:
119 142
120 143 - The current working directory is not searched anymore for profiles or
121 144 configurations files.
122 145 - Added a ``__patched_cves__`` attribute (set of strings) to IPython module that contain
123 146 the list of fixed CVE. This is informational only.
124 147
125 148 Further details can be read on the `GitHub Advisory <https://github.com/ipython/ipython/security/advisories/GHSA-pq7m-3gw7-gq5x>`__
126 149
127 150
128 151 .. _version 8.0:
129 152
130 153 IPython 8.0
131 154 -----------
132 155
133 156 IPython 8.0 is bringing a large number of new features and improvements to both the
134 157 user of the terminal and of the kernel via Jupyter. The removal of compatibility
135 158 with older version of Python is also the opportunity to do a couple of
136 159 performance improvements in particular with respect to startup time.
137 160 The 8.x branch started diverging from its predecessor around IPython 7.12
138 161 (January 2020).
139 162
140 163 This release contains 250+ pull requests, in addition to many of the features
141 164 and backports that have made it to the 7.x branch. Please see the
142 165 `8.0 milestone <https://github.com/ipython/ipython/milestone/73?closed=1>`__ for the full list of pull requests.
143 166
144 167 Please feel free to send pull requests to updates those notes after release,
145 168 I have likely forgotten a few things reviewing 250+ PRs.
146 169
147 170 Dependencies changes/downstream packaging
148 171 -----------------------------------------
149 172
150 173 Most of our building steps have been changed to be (mostly) declarative
151 174 and follow PEP 517. We are trying to completely remove ``setup.py`` (:ghpull:`13238`) and are
152 175 looking for help to do so.
153 176
154 177 - minimum supported ``traitlets`` version is now 5+
155 178 - we now require ``stack_data``
156 179 - minimal Python is now 3.8
157 180 - ``nose`` is not a testing requirement anymore
158 181 - ``pytest`` replaces nose.
159 182 - ``iptest``/``iptest3`` cli entrypoints do not exists anymore.
160 183 - minimum officially support ``numpy`` version has been bumped, but this should
161 184 not have much effect on packaging.
162 185
163 186
164 187 Deprecation and removal
165 188 -----------------------
166 189
167 190 We removed almost all features, arguments, functions, and modules that were
168 191 marked as deprecated between IPython 1.0 and 5.0. As a reminder, 5.0 was released
169 192 in 2016, and 1.0 in 2013. Last release of the 5 branch was 5.10.0, in May 2020.
170 193 The few remaining deprecated features we left have better deprecation warnings
171 194 or have been turned into explicit errors for better error messages.
172 195
173 196 I will use this occasion to add the following requests to anyone emitting a
174 197 deprecation warning:
175 198
176 199 - Please add at least ``stacklevel=2`` so that the warning is emitted into the
177 200 caller context, and not the callee one.
178 201 - Please add **since which version** something is deprecated.
179 202
180 203 As a side note, it is much easier to conditionally compare version
181 204 numbers rather than using ``try/except`` when functionality changes with a version.
182 205
183 206 I won't list all the removed features here, but modules like ``IPython.kernel``,
184 207 which was just a shim module around ``ipykernel`` for the past 8 years, have been
185 208 removed, and so many other similar things that pre-date the name **Jupyter**
186 209 itself.
187 210
188 211 We no longer need to add ``IPython.extensions`` to the PYTHONPATH because that is being
189 212 handled by ``load_extension``.
190 213
191 214 We are also removing ``Cythonmagic``, ``sympyprinting`` and ``rmagic`` as they are now in
192 215 other packages and no longer need to be inside IPython.
193 216
194 217
195 218 Documentation
196 219 -------------
197 220
198 221 The majority of our docstrings have now been reformatted and automatically fixed by
199 222 the experimental `VΓ©lin <https://pypi.org/project/velin/>`_ project to conform
200 223 to numpydoc.
201 224
202 225 Type annotations
203 226 ----------------
204 227
205 228 While IPython itself is highly dynamic and can't be completely typed, many of
206 229 the functions now have type annotations, and part of the codebase is now checked
207 230 by mypy.
208 231
209 232
210 233 Featured changes
211 234 ----------------
212 235
213 236 Here is a features list of changes in IPython 8.0. This is of course non-exhaustive.
214 237 Please note as well that many features have been added in the 7.x branch as well
215 238 (and hence why you want to read the 7.x what's new notes), in particular
216 239 features contributed by QuantStack (with respect to debugger protocol and Xeus
217 240 Python), as well as many debugger features that I was pleased to implement as
218 241 part of my work at QuanSight and sponsored by DE Shaw.
219 242
220 243 Traceback improvements
221 244 ~~~~~~~~~~~~~~~~~~~~~~
222 245
223 246 Previously, error tracebacks for errors happening in code cells were showing a
224 247 hash, the one used for compiling the Python AST::
225 248
226 249 In [1]: def foo():
227 250 ...: return 3 / 0
228 251 ...:
229 252
230 253 In [2]: foo()
231 254 ---------------------------------------------------------------------------
232 255 ZeroDivisionError Traceback (most recent call last)
233 256 <ipython-input-2-c19b6d9633cf> in <module>
234 257 ----> 1 foo()
235 258
236 259 <ipython-input-1-1595a74c32d5> in foo()
237 260 1 def foo():
238 261 ----> 2 return 3 / 0
239 262 3
240 263
241 264 ZeroDivisionError: division by zero
242 265
243 266 The error traceback is now correctly formatted, showing the cell number in which the error happened::
244 267
245 268 In [1]: def foo():
246 269 ...: return 3 / 0
247 270 ...:
248 271
249 272 Input In [2]: foo()
250 273 ---------------------------------------------------------------------------
251 274 ZeroDivisionError Traceback (most recent call last)
252 275 input In [2], in <module>
253 276 ----> 1 foo()
254 277
255 278 Input In [1], in foo()
256 279 1 def foo():
257 280 ----> 2 return 3 / 0
258 281
259 282 ZeroDivisionError: division by zero
260 283
261 284 The ``stack_data`` package has been integrated, which provides smarter information in the traceback;
262 285 in particular it will highlight the AST node where an error occurs which can help to quickly narrow down errors.
263 286
264 287 For example in the following snippet::
265 288
266 289 def foo(i):
267 290 x = [[[0]]]
268 291 return x[0][i][0]
269 292
270 293
271 294 def bar():
272 295 return foo(0) + foo(
273 296 1
274 297 ) + foo(2)
275 298
276 299
277 300 calling ``bar()`` would raise an ``IndexError`` on the return line of ``foo``,
278 301 and IPython 8.0 is capable of telling you where the index error occurs::
279 302
280 303
281 304 IndexError
282 305 Input In [2], in <module>
283 306 ----> 1 bar()
284 307 ^^^^^
285 308
286 309 Input In [1], in bar()
287 310 6 def bar():
288 311 ----> 7 return foo(0) + foo(
289 312 ^^^^
290 313 8 1
291 314 ^^^^^^^^
292 315 9 ) + foo(2)
293 316 ^^^^
294 317
295 318 Input In [1], in foo(i)
296 319 1 def foo(i):
297 320 2 x = [[[0]]]
298 321 ----> 3 return x[0][i][0]
299 322 ^^^^^^^
300 323
301 324 The corresponding locations marked here with ``^`` will show up highlighted in
302 325 the terminal and notebooks.
303 326
304 327 Finally, a colon ``::`` and line number is appended after a filename in
305 328 traceback::
306 329
307 330
308 331 ZeroDivisionError Traceback (most recent call last)
309 332 File ~/error.py:4, in <module>
310 333 1 def f():
311 334 2 1/0
312 335 ----> 4 f()
313 336
314 337 File ~/error.py:2, in f()
315 338 1 def f():
316 339 ----> 2 1/0
317 340
318 341 Many terminals and editors have integrations enabling you to directly jump to the
319 342 relevant file/line when this syntax is used, so this small addition may have a high
320 343 impact on productivity.
321 344
322 345
323 346 Autosuggestions
324 347 ~~~~~~~~~~~~~~~
325 348
326 349 Autosuggestion is a very useful feature available in `fish <https://fishshell.com/>`__, `zsh <https://en.wikipedia.org/wiki/Z_shell>`__, and `prompt-toolkit <https://python-prompt-toolkit.readthedocs.io/en/master/pages/asking_for_input.html#auto-suggestion>`__.
327 350
328 351 `Ptpython <https://github.com/prompt-toolkit/ptpython#ptpython>`__ allows users to enable this feature in
329 352 `ptpython/config.py <https://github.com/prompt-toolkit/ptpython/blob/master/examples/ptpython_config/config.py#L90>`__.
330 353
331 354 This feature allows users to accept autosuggestions with ctrl e, ctrl f,
332 355 or right arrow as described below.
333 356
334 357 1. Start ipython
335 358
336 359 .. image:: ../_images/8.0/auto_suggest_1_prompt_no_text.png
337 360
338 361 2. Run ``print("hello")``
339 362
340 363 .. image:: ../_images/8.0/auto_suggest_2_print_hello_suggest.png
341 364
342 365 3. start typing ``print`` again to see the autosuggestion
343 366
344 367 .. image:: ../_images/8.0/auto_suggest_3_print_hello_suggest.png
345 368
346 369 4. Press ``ctrl-f``, or ``ctrl-e``, or ``right-arrow`` to accept the suggestion
347 370
348 371 .. image:: ../_images/8.0/auto_suggest_4_print_hello.png
349 372
350 373 You can also complete word by word:
351 374
352 375 1. Run ``def say_hello(): print("hello")``
353 376
354 377 .. image:: ../_images/8.0/auto_suggest_second_prompt.png
355 378
356 379 2. Start typing the first letter if ``def`` to see the autosuggestion
357 380
358 381 .. image:: ../_images/8.0/auto_suggest_d_phantom.png
359 382
360 383 3. Press ``alt-f`` (or ``escape`` followed by ``f``), to accept the first word of the suggestion
361 384
362 385 .. image:: ../_images/8.0/auto_suggest_def_phantom.png
363 386
364 387 Importantly, this feature does not interfere with tab completion:
365 388
366 389 1. After running ``def say_hello(): print("hello")``, press d
367 390
368 391 .. image:: ../_images/8.0/auto_suggest_d_phantom.png
369 392
370 393 2. Press Tab to start tab completion
371 394
372 395 .. image:: ../_images/8.0/auto_suggest_d_completions.png
373 396
374 397 3A. Press Tab again to select the first option
375 398
376 399 .. image:: ../_images/8.0/auto_suggest_def_completions.png
377 400
378 401 3B. Press ``alt f`` (``escape``, ``f``) to accept to accept the first word of the suggestion
379 402
380 403 .. image:: ../_images/8.0/auto_suggest_def_phantom.png
381 404
382 405 3C. Press ``ctrl-f`` or ``ctrl-e`` to accept the entire suggestion
383 406
384 407 .. image:: ../_images/8.0/auto_suggest_match_parens.png
385 408
386 409
387 410 Currently, autosuggestions are only shown in the emacs or vi insert editing modes:
388 411
389 412 - The ctrl e, ctrl f, and alt f shortcuts work by default in emacs mode.
390 413 - To use these shortcuts in vi insert mode, you will have to create `custom keybindings in your config.py <https://github.com/mskar/setup/commit/2892fcee46f9f80ef7788f0749edc99daccc52f4/>`__.
391 414
392 415
393 416 Show pinfo information in ipdb using "?" and "??"
394 417 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
395 418
396 419 In IPDB, it is now possible to show the information about an object using "?"
397 420 and "??", in much the same way that it can be done when using the IPython prompt::
398 421
399 422 ipdb> partial?
400 423 Init signature: partial(self, /, *args, **kwargs)
401 424 Docstring:
402 425 partial(func, *args, **keywords) - new function with partial application
403 426 of the given arguments and keywords.
404 427 File: ~/.pyenv/versions/3.8.6/lib/python3.8/functools.py
405 428 Type: type
406 429 Subclasses:
407 430
408 431 Previously, ``pinfo`` or ``pinfo2`` command had to be used for this purpose.
409 432
410 433
411 434 Autoreload 3 feature
412 435 ~~~~~~~~~~~~~~~~~~~~
413 436
414 437 Example: When an IPython session is run with the 'autoreload' extension loaded,
415 438 you will now have the option '3' to select, which means the following:
416 439
417 440 1. replicate all functionality from option 2
418 441 2. autoload all new funcs/classes/enums/globals from the module when they are added
419 442 3. autoload all newly imported funcs/classes/enums/globals from external modules
420 443
421 444 Try ``%autoreload 3`` in an IPython session after running ``%load_ext autoreload``.
422 445
423 446 For more information please see the following unit test : ``extensions/tests/test_autoreload.py:test_autoload_newly_added_objects``
424 447
425 448 Auto formatting with black in the CLI
426 449 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
427 450
428 451 This feature was present in 7.x, but disabled by default.
429 452
430 453 In 8.0, input was automatically reformatted with Black when black was installed.
431 454 This feature has been reverted for the time being.
432 455 You can re-enable it by setting ``TerminalInteractiveShell.autoformatter`` to ``"black"``
433 456
434 457 History Range Glob feature
435 458 ~~~~~~~~~~~~~~~~~~~~~~~~~~
436 459
437 460 Previously, when using ``%history``, users could specify either
438 461 a range of sessions and lines, for example:
439 462
440 463 .. code-block:: python
441 464
442 465 ~8/1-~6/5 # see history from the first line of 8 sessions ago,
443 466 # to the fifth line of 6 sessions ago.``
444 467
445 468 Or users could specify a glob pattern:
446 469
447 470 .. code-block:: python
448 471
449 472 -g <pattern> # glob ALL history for the specified pattern.
450 473
451 474 However users could *not* specify both.
452 475
453 476 If a user *did* specify both a range and a glob pattern,
454 477 then the glob pattern would be used (globbing *all* history) *and the range would be ignored*.
455 478
456 479 With this enhancement, if a user specifies both a range and a glob pattern, then the glob pattern will be applied to the specified range of history.
457 480
458 481 Don't start a multi-line cell with sunken parenthesis
459 482 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
460 483
461 484 From now on, IPython will not ask for the next line of input when given a single
462 485 line with more closing than opening brackets. For example, this means that if
463 486 you (mis)type ``]]`` instead of ``[]``, a ``SyntaxError`` will show up, instead of
464 487 the ``...:`` prompt continuation.
465 488
466 489 IPython shell for ipdb interact
467 490 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
468 491
469 492 The ipdb ``interact`` starts an IPython shell instead of Python's built-in ``code.interact()``.
470 493
471 494 Automatic Vi prompt stripping
472 495 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
473 496
474 497 When pasting code into IPython, it will strip the leading prompt characters if
475 498 there are any. For example, you can paste the following code into the console -
476 499 it will still work, even though each line is prefixed with prompts (`In`,
477 500 `Out`)::
478 501
479 502 In [1]: 2 * 2 == 4
480 503 Out[1]: True
481 504
482 505 In [2]: print("This still works as pasted")
483 506
484 507
485 508 Previously, this was not the case for the Vi-mode prompts::
486 509
487 510 In [1]: [ins] In [13]: 2 * 2 == 4
488 511 ...: Out[13]: True
489 512 ...:
490 513 File "<ipython-input-1-727bb88eaf33>", line 1
491 514 [ins] In [13]: 2 * 2 == 4
492 515 ^
493 516 SyntaxError: invalid syntax
494 517
495 518 This is now fixed, and Vi prompt prefixes - ``[ins]`` and ``[nav]`` - are
496 519 skipped just as the normal ``In`` would be.
497 520
498 521 IPython shell can be started in the Vi mode using ``ipython --TerminalInteractiveShell.editing_mode=vi``,
499 522 You should be able to change mode dynamically with ``%config TerminalInteractiveShell.editing_mode='vi'``
500 523
501 524 Empty History Ranges
502 525 ~~~~~~~~~~~~~~~~~~~~
503 526
504 527 A number of magics that take history ranges can now be used with an empty
505 528 range. These magics are:
506 529
507 530 * ``%save``
508 531 * ``%load``
509 532 * ``%pastebin``
510 533 * ``%pycat``
511 534
512 535 Using them this way will make them take the history of the current session up
513 536 to the point of the magic call (such that the magic itself will not be
514 537 included).
515 538
516 539 Therefore it is now possible to save the whole history to a file using
517 540 ``%save <filename>``, load and edit it using ``%load`` (makes for a nice usage
518 541 when followed with :kbd:`F2`), send it to `dpaste.org <http://dpast.org>`_ using
519 542 ``%pastebin``, or view the whole thing syntax-highlighted with a single
520 543 ``%pycat``.
521 544
522 545
523 546 Windows timing implementation: Switch to process_time
524 547 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
525 548 Timing on Windows, for example with ``%%time``, was changed from being based on ``time.perf_counter``
526 549 (which counted time even when the process was sleeping) to being based on ``time.process_time`` instead
527 550 (which only counts CPU time). This brings it closer to the behavior on Linux. See :ghpull:`12984`.
528 551
529 552 Miscellaneous
530 553 ~~~~~~~~~~~~~
531 554 - Non-text formatters are not disabled in the terminal, which should simplify
532 555 writing extensions displaying images or other mimetypes in supporting terminals.
533 556 :ghpull:`12315`
534 557 - It is now possible to automatically insert matching brackets in Terminal IPython using the
535 558 ``TerminalInteractiveShell.auto_match=True`` option. :ghpull:`12586`
536 559 - We are thinking of deprecating the current ``%%javascript`` magic in favor of a better replacement. See :ghpull:`13376`.
537 560 - ``~`` is now expanded when part of a path in most magics :ghpull:`13385`
538 561 - ``%/%%timeit`` magic now adds a comma every thousands to make reading a long number easier :ghpull:`13379`
539 562 - ``"info"`` messages can now be customised to hide some fields :ghpull:`13343`
540 563 - ``collections.UserList`` now pretty-prints :ghpull:`13320`
541 564 - The debugger now has a persistent history, which should make it less
542 565 annoying to retype commands :ghpull:`13246`
543 566 - ``!pip`` ``!conda`` ``!cd`` or ``!ls`` are likely doing the wrong thing. We
544 567 now warn users if they use one of those commands. :ghpull:`12954`
545 568 - Make ``%precision`` work for ``numpy.float64`` type :ghpull:`12902`
546 569
547 570 Re-added support for XDG config directories
548 571 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
549 572
550 573 XDG support through the years comes and goes. There is a tension between having
551 574 an identical location for configuration in all platforms versus having simple instructions.
552 575 After initial failures a couple of years ago, IPython was modified to automatically migrate XDG
553 576 config files back into ``~/.ipython``. That migration code has now been removed.
554 577 IPython now checks the XDG locations, so if you _manually_ move your config
555 578 files to your preferred location, IPython will not move them back.
556 579
557 580
558 581 Preparing for Python 3.10
559 582 -------------------------
560 583
561 584 To prepare for Python 3.10, we have started working on removing reliance and
562 585 any dependency that is not compatible with Python 3.10. This includes migrating our
563 586 test suite to pytest and starting to remove nose. This also means that the
564 587 ``iptest`` command is now gone and all testing is via pytest.
565 588
566 589 This was in large part thanks to the NumFOCUS Small Developer grant, which enabled us to
567 590 allocate \$4000 to hire `Nikita Kniazev (@Kojoley) <https://github.com/Kojoley>`_,
568 591 who did a fantastic job at updating our code base, migrating to pytest, pushing
569 592 our coverage, and fixing a large number of bugs. I highly recommend contacting
570 593 them if you need help with C++ and Python projects.
571 594
572 595 You can find all relevant issues and PRs with the SDG 2021 tag `<https://github.com/ipython/ipython/issues?q=label%3A%22Numfocus+SDG+2021%22+>`__
573 596
574 597 Removing support for older Python versions
575 598 ------------------------------------------
576 599
577 600
578 601 We are removing support for Python up through 3.7, allowing internal code to use the more
579 602 efficient ``pathlib`` and to make better use of type annotations.
580 603
581 604 .. image:: ../_images/8.0/pathlib_pathlib_everywhere.jpg
582 605 :alt: "Meme image of Toy Story with Woody and Buzz, with the text 'pathlib, pathlib everywhere'"
583 606
584 607
585 608 We had about 34 PRs only to update some logic to update some functions from managing strings to
586 609 using Pathlib.
587 610
588 611 The completer has also seen significant updates and now makes use of newer Jedi APIs,
589 612 offering faster and more reliable tab completion.
590 613
591 614 Misc Statistics
592 615 ---------------
593 616
594 617 Here are some numbers::
595 618
596 619 7.x: 296 files, 12561 blank lines, 20282 comments, 35142 line of code.
597 620 8.0: 252 files, 12053 blank lines, 19232 comments, 34505 line of code.
598 621
599 622 $ git diff --stat 7.x...master | tail -1
600 623 340 files changed, 13399 insertions(+), 12421 deletions(-)
601 624
602 625 We have commits from 162 authors, who contributed 1916 commits in 23 month, excluding merges (to not bias toward
603 626 maintainers pushing buttons).::
604 627
605 628 $ git shortlog -s --no-merges 7.x...master | sort -nr
606 629 535 Matthias Bussonnier
607 630 86 Nikita Kniazev
608 631 69 Blazej Michalik
609 632 49 Samuel Gaist
610 633 27 Itamar Turner-Trauring
611 634 18 Spas Kalaydzhisyki
612 635 17 Thomas Kluyver
613 636 17 Quentin Peter
614 637 17 James Morris
615 638 17 Artur Svistunov
616 639 15 Bart Skowron
617 640 14 Alex Hall
618 641 13 rushabh-v
619 642 13 Terry Davis
620 643 13 Benjamin Ragan-Kelley
621 644 8 martinRenou
622 645 8 farisachugthai
623 646 7 dswij
624 647 7 Gal B
625 648 7 Corentin Cadiou
626 649 6 yuji96
627 650 6 Martin Skarzynski
628 651 6 Justin Palmer
629 652 6 Daniel Goldfarb
630 653 6 Ben Greiner
631 654 5 Sammy Al Hashemi
632 655 5 Paul Ivanov
633 656 5 Inception95
634 657 5 Eyenpi
635 658 5 Douglas Blank
636 659 5 Coco Mishra
637 660 5 Bibo Hao
638 661 5 AndrΓ© A. Gomes
639 662 5 Ahmed Fasih
640 663 4 takuya fujiwara
641 664 4 palewire
642 665 4 Thomas A Caswell
643 666 4 Talley Lambert
644 667 4 Scott Sanderson
645 668 4 Ram Rachum
646 669 4 Nick Muoh
647 670 4 Nathan Goldbaum
648 671 4 Mithil Poojary
649 672 4 Michael T
650 673 4 Jakub Klus
651 674 4 Ian Castleden
652 675 4 Eli Rykoff
653 676 4 Ashwin Vishnu
654 677 3 谭九鼎
655 678 3 sleeping
656 679 3 Sylvain Corlay
657 680 3 Peter Corke
658 681 3 Paul Bissex
659 682 3 Matthew Feickert
660 683 3 Fernando Perez
661 684 3 Eric Wieser
662 685 3 Daniel Mietchen
663 686 3 Aditya Sathe
664 687 3 007vedant
665 688 2 rchiodo
666 689 2 nicolaslazo
667 690 2 luttik
668 691 2 gorogoroumaru
669 692 2 foobarbyte
670 693 2 bar-hen
671 694 2 Theo Ouzhinski
672 695 2 Strawkage
673 696 2 Samreen Zarroug
674 697 2 Pete Blois
675 698 2 Meysam Azad
676 699 2 Matthieu Ancellin
677 700 2 Mark Schmitz
678 701 2 Maor Kleinberger
679 702 2 MRCWirtz
680 703 2 Lumir Balhar
681 704 2 Julien Rabinow
682 705 2 Juan Luis Cano RodrΓ­guez
683 706 2 Joyce Er
684 707 2 Jakub
685 708 2 Faris A Chugthai
686 709 2 Ethan Madden
687 710 2 Dimitri Papadopoulos
688 711 2 Diego Fernandez
689 712 2 Daniel Shimon
690 713 2 Coco Bennett
691 714 2 Carlos Cordoba
692 715 2 Boyuan Liu
693 716 2 BaoGiang HoangVu
694 717 2 Augusto
695 718 2 Arthur Svistunov
696 719 2 Arthur Moreira
697 720 2 Ali Nabipour
698 721 2 Adam Hackbarth
699 722 1 richard
700 723 1 linar-jether
701 724 1 lbennett
702 725 1 juacrumar
703 726 1 gpotter2
704 727 1 digitalvirtuoso
705 728 1 dalthviz
706 729 1 Yonatan Goldschmidt
707 730 1 Tomasz KΕ‚oczko
708 731 1 Tobias Bengfort
709 732 1 Timur Kushukov
710 733 1 Thomas
711 734 1 Snir Broshi
712 735 1 Shao Yang Hong
713 736 1 Sanjana-03
714 737 1 Romulo Filho
715 738 1 Rodolfo Carvalho
716 739 1 Richard Shadrach
717 740 1 Reilly Tucker Siemens
718 741 1 Rakessh Roshan
719 742 1 Piers Titus van der Torren
720 743 1 PhanatosZou
721 744 1 Pavel Safronov
722 745 1 Paulo S. Costa
723 746 1 Paul McCarthy
724 747 1 NotWearingPants
725 748 1 Naelson Douglas
726 749 1 Michael Tiemann
727 750 1 Matt Wozniski
728 751 1 Markus Wageringel
729 752 1 Marcus Wirtz
730 753 1 Marcio Mazza
731 754 1 LumΓ­r 'Frenzy' Balhar
732 755 1 Lightyagami1
733 756 1 Leon Anavi
734 757 1 LeafyLi
735 758 1 L0uisJ0shua
736 759 1 Kyle Cutler
737 760 1 Krzysztof Cybulski
738 761 1 Kevin Kirsche
739 762 1 KIU Shueng Chuan
740 763 1 Jonathan Slenders
741 764 1 Jay Qi
742 765 1 Jake VanderPlas
743 766 1 Iwan Briquemont
744 767 1 Hussaina Begum Nandyala
745 768 1 Gordon Ball
746 769 1 Gabriel Simonetto
747 770 1 Frank Tobia
748 771 1 Erik
749 772 1 Elliott Sales de Andrade
750 773 1 Daniel Hahler
751 774 1 Dan Green-Leipciger
752 775 1 Dan Green
753 776 1 Damian Yurzola
754 777 1 Coon, Ethan T
755 778 1 Carol Willing
756 779 1 Brian Lee
757 780 1 Brendan Gerrity
758 781 1 Blake Griffin
759 782 1 Bastian Ebeling
760 783 1 Bartosz Telenczuk
761 784 1 Ankitsingh6299
762 785 1 Andrew Port
763 786 1 Andrew J. Hesford
764 787 1 Albert Zhang
765 788 1 Adam Johnson
766 789
767 790 This does not, of course, represent non-code contributions, for which we are also grateful.
768 791
769 792
770 793 API Changes using Frappuccino
771 794 -----------------------------
772 795
773 796 This is an experimental exhaustive API difference using `Frappuccino <https://pypi.org/project/frappuccino/>`_
774 797
775 798
776 799 The following items are new in IPython 8.0 ::
777 800
778 801 + IPython.core.async_helpers.get_asyncio_loop()
779 802 + IPython.core.completer.Dict
780 803 + IPython.core.completer.Pattern
781 804 + IPython.core.completer.Sequence
782 805 + IPython.core.completer.__skip_doctest__
783 806 + IPython.core.debugger.Pdb.precmd(self, line)
784 807 + IPython.core.debugger.__skip_doctest__
785 808 + IPython.core.display.__getattr__(name)
786 809 + IPython.core.display.warn
787 810 + IPython.core.display_functions
788 811 + IPython.core.display_functions.DisplayHandle
789 812 + IPython.core.display_functions.DisplayHandle.display(self, obj, **kwargs)
790 813 + IPython.core.display_functions.DisplayHandle.update(self, obj, **kwargs)
791 814 + IPython.core.display_functions.__all__
792 815 + IPython.core.display_functions.__builtins__
793 816 + IPython.core.display_functions.__cached__
794 817 + IPython.core.display_functions.__doc__
795 818 + IPython.core.display_functions.__file__
796 819 + IPython.core.display_functions.__loader__
797 820 + IPython.core.display_functions.__name__
798 821 + IPython.core.display_functions.__package__
799 822 + IPython.core.display_functions.__spec__
800 823 + IPython.core.display_functions.b2a_hex
801 824 + IPython.core.display_functions.clear_output(wait=False)
802 825 + IPython.core.display_functions.display(*objs, include='None', exclude='None', metadata='None', transient='None', display_id='None', raw=False, clear=False, **kwargs)
803 826 + IPython.core.display_functions.publish_display_data(data, metadata='None', source='<deprecated>', *, transient='None', **kwargs)
804 827 + IPython.core.display_functions.update_display(obj, *, display_id, **kwargs)
805 828 + IPython.core.extensions.BUILTINS_EXTS
806 829 + IPython.core.inputtransformer2.has_sunken_brackets(tokens)
807 830 + IPython.core.interactiveshell.Callable
808 831 + IPython.core.interactiveshell.__annotations__
809 832 + IPython.core.ultratb.List
810 833 + IPython.core.ultratb.Tuple
811 834 + IPython.lib.pretty.CallExpression
812 835 + IPython.lib.pretty.CallExpression.factory(name)
813 836 + IPython.lib.pretty.RawStringLiteral
814 837 + IPython.lib.pretty.RawText
815 838 + IPython.terminal.debugger.TerminalPdb.do_interact(self, arg)
816 839 + IPython.terminal.embed.Set
817 840
818 841 The following items have been removed (or moved to superclass)::
819 842
820 843 - IPython.core.application.BaseIPythonApplication.initialize_subcommand
821 844 - IPython.core.completer.Sentinel
822 845 - IPython.core.completer.skip_doctest
823 846 - IPython.core.debugger.Tracer
824 847 - IPython.core.display.DisplayHandle
825 848 - IPython.core.display.DisplayHandle.display
826 849 - IPython.core.display.DisplayHandle.update
827 850 - IPython.core.display.b2a_hex
828 851 - IPython.core.display.clear_output
829 852 - IPython.core.display.display
830 853 - IPython.core.display.publish_display_data
831 854 - IPython.core.display.update_display
832 855 - IPython.core.excolors.Deprec
833 856 - IPython.core.excolors.ExceptionColors
834 857 - IPython.core.history.warn
835 858 - IPython.core.hooks.late_startup_hook
836 859 - IPython.core.hooks.pre_run_code_hook
837 860 - IPython.core.hooks.shutdown_hook
838 861 - IPython.core.interactiveshell.InteractiveShell.init_deprecation_warnings
839 862 - IPython.core.interactiveshell.InteractiveShell.init_readline
840 863 - IPython.core.interactiveshell.InteractiveShell.write
841 864 - IPython.core.interactiveshell.InteractiveShell.write_err
842 865 - IPython.core.interactiveshell.get_default_colors
843 866 - IPython.core.interactiveshell.removed_co_newlocals
844 867 - IPython.core.magics.execution.ExecutionMagics.profile_missing_notice
845 868 - IPython.core.magics.script.PIPE
846 869 - IPython.core.prefilter.PrefilterManager.init_transformers
847 870 - IPython.core.release.classifiers
848 871 - IPython.core.release.description
849 872 - IPython.core.release.keywords
850 873 - IPython.core.release.long_description
851 874 - IPython.core.release.name
852 875 - IPython.core.release.platforms
853 876 - IPython.core.release.url
854 877 - IPython.core.ultratb.VerboseTB.format_records
855 878 - IPython.core.ultratb.find_recursion
856 879 - IPython.core.ultratb.findsource
857 880 - IPython.core.ultratb.fix_frame_records_filenames
858 881 - IPython.core.ultratb.inspect_error
859 882 - IPython.core.ultratb.is_recursion_error
860 883 - IPython.core.ultratb.with_patch_inspect
861 884 - IPython.external.__all__
862 885 - IPython.external.__builtins__
863 886 - IPython.external.__cached__
864 887 - IPython.external.__doc__
865 888 - IPython.external.__file__
866 889 - IPython.external.__loader__
867 890 - IPython.external.__name__
868 891 - IPython.external.__package__
869 892 - IPython.external.__path__
870 893 - IPython.external.__spec__
871 894 - IPython.kernel.KernelConnectionInfo
872 895 - IPython.kernel.__builtins__
873 896 - IPython.kernel.__cached__
874 897 - IPython.kernel.__warningregistry__
875 898 - IPython.kernel.pkg
876 899 - IPython.kernel.protocol_version
877 900 - IPython.kernel.protocol_version_info
878 901 - IPython.kernel.src
879 902 - IPython.kernel.version_info
880 903 - IPython.kernel.warn
881 904 - IPython.lib.backgroundjobs
882 905 - IPython.lib.backgroundjobs.BackgroundJobBase
883 906 - IPython.lib.backgroundjobs.BackgroundJobBase.run
884 907 - IPython.lib.backgroundjobs.BackgroundJobBase.traceback
885 908 - IPython.lib.backgroundjobs.BackgroundJobExpr
886 909 - IPython.lib.backgroundjobs.BackgroundJobExpr.call
887 910 - IPython.lib.backgroundjobs.BackgroundJobFunc
888 911 - IPython.lib.backgroundjobs.BackgroundJobFunc.call
889 912 - IPython.lib.backgroundjobs.BackgroundJobManager
890 913 - IPython.lib.backgroundjobs.BackgroundJobManager.flush
891 914 - IPython.lib.backgroundjobs.BackgroundJobManager.new
892 915 - IPython.lib.backgroundjobs.BackgroundJobManager.remove
893 916 - IPython.lib.backgroundjobs.BackgroundJobManager.result
894 917 - IPython.lib.backgroundjobs.BackgroundJobManager.status
895 918 - IPython.lib.backgroundjobs.BackgroundJobManager.traceback
896 919 - IPython.lib.backgroundjobs.__builtins__
897 920 - IPython.lib.backgroundjobs.__cached__
898 921 - IPython.lib.backgroundjobs.__doc__
899 922 - IPython.lib.backgroundjobs.__file__
900 923 - IPython.lib.backgroundjobs.__loader__
901 924 - IPython.lib.backgroundjobs.__name__
902 925 - IPython.lib.backgroundjobs.__package__
903 926 - IPython.lib.backgroundjobs.__spec__
904 927 - IPython.lib.kernel.__builtins__
905 928 - IPython.lib.kernel.__cached__
906 929 - IPython.lib.kernel.__doc__
907 930 - IPython.lib.kernel.__file__
908 931 - IPython.lib.kernel.__loader__
909 932 - IPython.lib.kernel.__name__
910 933 - IPython.lib.kernel.__package__
911 934 - IPython.lib.kernel.__spec__
912 935 - IPython.lib.kernel.__warningregistry__
913 936 - IPython.paths.fs_encoding
914 937 - IPython.terminal.debugger.DEFAULT_BUFFER
915 938 - IPython.terminal.debugger.cursor_in_leading_ws
916 939 - IPython.terminal.debugger.emacs_insert_mode
917 940 - IPython.terminal.debugger.has_selection
918 941 - IPython.terminal.debugger.vi_insert_mode
919 942 - IPython.terminal.interactiveshell.DISPLAY_BANNER_DEPRECATED
920 943 - IPython.terminal.ipapp.TerminalIPythonApp.parse_command_line
921 944 - IPython.testing.test
922 945 - IPython.utils.contexts.NoOpContext
923 946 - IPython.utils.io.IOStream
924 947 - IPython.utils.io.IOStream.close
925 948 - IPython.utils.io.IOStream.write
926 949 - IPython.utils.io.IOStream.writelines
927 950 - IPython.utils.io.__warningregistry__
928 951 - IPython.utils.io.atomic_writing
929 952 - IPython.utils.io.stderr
930 953 - IPython.utils.io.stdin
931 954 - IPython.utils.io.stdout
932 955 - IPython.utils.io.unicode_std_stream
933 956 - IPython.utils.path.get_ipython_cache_dir
934 957 - IPython.utils.path.get_ipython_dir
935 958 - IPython.utils.path.get_ipython_module_path
936 959 - IPython.utils.path.get_ipython_package_dir
937 960 - IPython.utils.path.locate_profile
938 961 - IPython.utils.path.unquote_filename
939 962 - IPython.utils.py3compat.PY2
940 963 - IPython.utils.py3compat.PY3
941 964 - IPython.utils.py3compat.buffer_to_bytes
942 965 - IPython.utils.py3compat.builtin_mod_name
943 966 - IPython.utils.py3compat.cast_bytes
944 967 - IPython.utils.py3compat.getcwd
945 968 - IPython.utils.py3compat.isidentifier
946 969 - IPython.utils.py3compat.u_format
947 970
948 971 The following signatures differ between 7.x and 8.0::
949 972
950 973 - IPython.core.completer.IPCompleter.unicode_name_matches(self, text)
951 974 + IPython.core.completer.IPCompleter.unicode_name_matches(text)
952 975
953 976 - IPython.core.completer.match_dict_keys(keys, prefix, delims)
954 977 + IPython.core.completer.match_dict_keys(keys, prefix, delims, extra_prefix='None')
955 978
956 979 - IPython.core.interactiveshell.InteractiveShell.object_inspect_mime(self, oname, detail_level=0)
957 980 + IPython.core.interactiveshell.InteractiveShell.object_inspect_mime(self, oname, detail_level=0, omit_sections='()')
958 981
959 982 - IPython.core.interactiveshell.InteractiveShell.set_hook(self, name, hook, priority=50, str_key='None', re_key='None', _warn_deprecated=True)
960 983 + IPython.core.interactiveshell.InteractiveShell.set_hook(self, name, hook, priority=50, str_key='None', re_key='None')
961 984
962 985 - IPython.core.oinspect.Inspector.info(self, obj, oname='', formatter='None', info='None', detail_level=0)
963 986 + IPython.core.oinspect.Inspector.info(self, obj, oname='', info='None', detail_level=0)
964 987
965 988 - IPython.core.oinspect.Inspector.pinfo(self, obj, oname='', formatter='None', info='None', detail_level=0, enable_html_pager=True)
966 989 + IPython.core.oinspect.Inspector.pinfo(self, obj, oname='', formatter='None', info='None', detail_level=0, enable_html_pager=True, omit_sections='()')
967 990
968 991 - IPython.core.profiledir.ProfileDir.copy_config_file(self, config_file, path='None', overwrite=False)
969 992 + IPython.core.profiledir.ProfileDir.copy_config_file(self, config_file, path, overwrite=False)
970 993
971 994 - IPython.core.ultratb.VerboseTB.format_record(self, frame, file, lnum, func, lines, index)
972 995 + IPython.core.ultratb.VerboseTB.format_record(self, frame_info)
973 996
974 997 - IPython.terminal.embed.InteractiveShellEmbed.mainloop(self, local_ns='None', module='None', stack_depth=0, display_banner='None', global_ns='None', compile_flags='None')
975 998 + IPython.terminal.embed.InteractiveShellEmbed.mainloop(self, local_ns='None', module='None', stack_depth=0, compile_flags='None')
976 999
977 1000 - IPython.terminal.embed.embed(**kwargs)
978 1001 + IPython.terminal.embed.embed(*, header='', compile_flags='None', **kwargs)
979 1002
980 1003 - IPython.terminal.interactiveshell.TerminalInteractiveShell.interact(self, display_banner='<object object at 0xffffff>')
981 1004 + IPython.terminal.interactiveshell.TerminalInteractiveShell.interact(self)
982 1005
983 1006 - IPython.terminal.interactiveshell.TerminalInteractiveShell.mainloop(self, display_banner='<object object at 0xffffff>')
984 1007 + IPython.terminal.interactiveshell.TerminalInteractiveShell.mainloop(self)
985 1008
986 1009 - IPython.utils.path.get_py_filename(name, force_win32='None')
987 1010 + IPython.utils.path.get_py_filename(name)
988 1011
989 1012 The following are new attributes (that might be inherited)::
990 1013
991 1014 + IPython.core.completer.IPCompleter.unicode_names
992 1015 + IPython.core.debugger.InterruptiblePdb.precmd
993 1016 + IPython.core.debugger.Pdb.precmd
994 1017 + IPython.core.ultratb.AutoFormattedTB.has_colors
995 1018 + IPython.core.ultratb.ColorTB.has_colors
996 1019 + IPython.core.ultratb.FormattedTB.has_colors
997 1020 + IPython.core.ultratb.ListTB.has_colors
998 1021 + IPython.core.ultratb.SyntaxTB.has_colors
999 1022 + IPython.core.ultratb.TBTools.has_colors
1000 1023 + IPython.core.ultratb.VerboseTB.has_colors
1001 1024 + IPython.terminal.debugger.TerminalPdb.do_interact
1002 1025 + IPython.terminal.debugger.TerminalPdb.precmd
1003 1026
1004 1027 The following attribute/methods have been removed::
1005 1028
1006 1029 - IPython.core.application.BaseIPythonApplication.deprecated_subcommands
1007 1030 - IPython.core.ultratb.AutoFormattedTB.format_records
1008 1031 - IPython.core.ultratb.ColorTB.format_records
1009 1032 - IPython.core.ultratb.FormattedTB.format_records
1010 1033 - IPython.terminal.embed.InteractiveShellEmbed.init_deprecation_warnings
1011 1034 - IPython.terminal.embed.InteractiveShellEmbed.init_readline
1012 1035 - IPython.terminal.embed.InteractiveShellEmbed.write
1013 1036 - IPython.terminal.embed.InteractiveShellEmbed.write_err
1014 1037 - IPython.terminal.interactiveshell.TerminalInteractiveShell.init_deprecation_warnings
1015 1038 - IPython.terminal.interactiveshell.TerminalInteractiveShell.init_readline
1016 1039 - IPython.terminal.interactiveshell.TerminalInteractiveShell.write
1017 1040 - IPython.terminal.interactiveshell.TerminalInteractiveShell.write_err
1018 1041 - IPython.terminal.ipapp.LocateIPythonApp.deprecated_subcommands
1019 1042 - IPython.terminal.ipapp.LocateIPythonApp.initialize_subcommand
1020 1043 - IPython.terminal.ipapp.TerminalIPythonApp.deprecated_subcommands
1021 1044 - IPython.terminal.ipapp.TerminalIPythonApp.initialize_subcommand
General Comments 0
You need to be logged in to leave comments. Login now