##// END OF EJS Templates
Light editing of 8.0 what's new
Jason Grout -
Show More
@@ -5,9 +5,6 b''
5 IPython 8.0
5 IPython 8.0
6 -----------
6 -----------
7
7
8 IPython 8.0 is still in alpha/beta stage. Please help us improve those release notes
9 by sending PRs that modify docs/source/whatsnew/version8.rst
10
11 IPython 8.0 is bringing a large number of new features and improvements to both the
8 IPython 8.0 is bringing a large number of new features and improvements to both the
12 user of the terminal and of the kernel via Jupyter. The removal of compatibility
9 user of the terminal and of the kernel via Jupyter. The removal of compatibility
13 with older version of Python is also the opportunity to do a couple of
10 with older version of Python is also the opportunity to do a couple of
@@ -15,24 +12,24 b' performance improvement in particular with respect to startup time.'
15 The 8.x branch started diverging from its predecessor around IPython 7.12
12 The 8.x branch started diverging from its predecessor around IPython 7.12
16 (January 2020).
13 (January 2020).
17
14
18 This release contains 250+ Pull Requests, in addition to many of the features
15 This release contains 250+ pull requests, in addition to many of the features
19 and backports that have made it to the 7.x branch. All PRs that went into this
16 and backports that have made it to the 7.x branch. All PRs that went into this
20 released are properly tagged with the 8.0 milestone if you wish to have a more
17 released are properly tagged with the 8.0 milestone if you wish to have a more
21 in depth look at the changes.
18 in depth look at the changes.
22
19
23 Please fell free to send pull-requests to updates those notes after release,
20 Please fell free to send pull requests to updates those notes after release,
24 I have likely forgotten a few things reviewing 250+ PRs.
21 I have likely forgotten a few things reviewing 250+ PRs.
25
22
26 Dependencies changes/downstream packaging
23 Dependencies changes/downstream packaging
27 -----------------------------------------
24 -----------------------------------------
28
25
29 Note that most of our building step have been changes to be (mostly) declarative
26 Most of our building steps have been changed to be (mostly) declarative
30 and follow PEP 517, we are trying to completely remove ``setup.py`` (:ghpull:`13238`) and are
27 and follow PEP 517. We are trying to completely remove ``setup.py`` (:ghpull:`13238`) and are
31 looking for help to do so.
28 looking for help to do so.
32
29
33 - Minimum supported ``traitlets`` version if now 5+
30 - minimum supported ``traitlets`` version is now 5+
34 - we now require ``stack_data``
31 - we now require ``stack_data``
35 - Minimal Python is now 3.8
32 - minimal Python is now 3.8
36 - ``nose`` is not a testing requirement anymore
33 - ``nose`` is not a testing requirement anymore
37 - ``pytest`` replaces nose.
34 - ``pytest`` replaces nose.
38 - ``iptest``/``iptest3`` cli entrypoints do not exists anymore.
35 - ``iptest``/``iptest3`` cli entrypoints do not exists anymore.
@@ -44,24 +41,24 b' Deprecation and removal'
44 -----------------------
41 -----------------------
45
42
46 We removed almost all features, arguments, functions, and modules that were
43 We removed almost all features, arguments, functions, and modules that were
47 marked as deprecated between IPython 1.0 and 5.0. As reminder 5.0 was released
44 marked as deprecated between IPython 1.0 and 5.0. As a reminder, 5.0 was released
48 in 2016, and 1.0 in 2013. Last release of the 5 branch was 5.10.0, in may 2020.
45 in 2016, and 1.0 in 2013. Last release of the 5 branch was 5.10.0, in May 2020.
49 The few remaining deprecated features we left have better deprecation warnings
46 The few remaining deprecated features we left have better deprecation warnings
50 or have been turned into explicit errors for better error messages.
47 or have been turned into explicit errors for better error messages.
51
48
52 I will use this occasion to add the following requests to anyone emitting a
49 I will use this occasion to add the following requests to anyone emitting a
53 deprecation warning:
50 deprecation warning:
54
51
55 - Please at at least ``stacklevel=2`` so that the warning is emitted into the
52 - Please use at least ``stacklevel=2`` so that the warning is emitted into the
56 caller context, and not the callee one.
53 caller context, and not the callee one.
57 - Please add **since which version** something is deprecated.
54 - Please add **since which version** something is deprecated.
58
55
59 As a side note it is much easier to deal with conditional comparing to versions
56 As a side note, it is much easier to conditionally compare version
60 numbers than ``try/except`` when a functionality change with version.
57 numbers rather than using ``try/except`` when functionality changes with a version.
61
58
62 I won't list all the removed features here, but modules like ``IPython.kernel``,
59 I won't list all the removed features here, but modules like ``IPython.kernel``,
63 which was just a shim module around ``ipykernel`` for the past 8 years have been
60 which was just a shim module around ``ipykernel`` for the past 8 years, have been
64 remove, and so many other similar things that pre-date the name **Jupyter**
61 removed, and so many other similar things that pre-date the name **Jupyter**
65 itself.
62 itself.
66
63
67 We no longer need to add ``IPyhton.extensions`` to the PYTHONPATH because that is being
64 We no longer need to add ``IPyhton.extensions`` to the PYTHONPATH because that is being
@@ -74,15 +71,15 b' other packages and no longer need to be inside IPython.'
74 Documentation
71 Documentation
75 -------------
72 -------------
76
73
77 Majority of our docstrings have now been reformatted and automatically fixed by
74 The majority of our docstrings have now been reformatted and automatically fixed by
78 the experimental `VΓ©lin <https://pypi.org/project/velin/>`_ project, to conform
75 the experimental `VΓ©lin <https://pypi.org/project/velin/>`_ project to conform
79 to numpydoc.
76 to numpydoc.
80
77
81 Type annotations
78 Type annotations
82 ----------------
79 ----------------
83
80
84 While IPython itself is highly dynamic and can't be completely typed, many of
81 While IPython itself is highly dynamic and can't be completely typed, many of
85 the function now have type annotation, and part of the codebase and now checked
82 the functions now have type annotations, and part of the codebase is now checked
86 by mypy.
83 by mypy.
87
84
88
85
@@ -92,9 +89,9 b' Featured changes'
92 Here is a features list of changes in IPython 8.0. This is of course non-exhaustive.
89 Here is a features list of changes in IPython 8.0. This is of course non-exhaustive.
93 Please note as well that many features have been added in the 7.x branch as well
90 Please note as well that many features have been added in the 7.x branch as well
94 (and hence why you want to read the 7.x what's new notes), in particular
91 (and hence why you want to read the 7.x what's new notes), in particular
95 features contributed by QuantStack (with respect to debugger protocol, and Xeus
92 features contributed by QuantStack (with respect to debugger protocol and Xeus
96 Python), as well as many debugger features that I was please to implement as
93 Python), as well as many debugger features that I was pleased to implement as
97 part of my work at QuanSight and Sponsored by DE Shaw.
94 part of my work at QuanSight and sponsored by DE Shaw.
98
95
99 Traceback improvements
96 Traceback improvements
100 ~~~~~~~~~~~~~~~~~~~~~~
97 ~~~~~~~~~~~~~~~~~~~~~~
@@ -137,9 +134,8 b' The error traceback is now correctly formatted, showing the cell number in which'
137
134
138 ZeroDivisionError: division by zero
135 ZeroDivisionError: division by zero
139
136
140 The Second on is the integration of the ``stack_data`` package;
137 The ``stack_data`` package has been integrated, which provides smarter information in the traceback;
141 which provide smarter informations in traceback; in particular it will highlight
138 in particular it will highlight the AST node where an error occurs which can help to quickly narrow down errors.
142 the AST node where an error occurs which can help to quickly narrow down errors.
143
139
144 For example in the following snippet::
140 For example in the following snippet::
145
141
@@ -154,8 +150,8 b' For example in the following snippet::'
154 ) + foo(2)
150 ) + foo(2)
155
151
156
152
157 Calling ``bar()`` would raise an ``IndexError`` on the return line of ``foo``,
153 calling ``bar()`` would raise an ``IndexError`` on the return line of ``foo``,
158 IPython 8.0 is capable of telling you, where the index error occurs::
154 and IPython 8.0 is capable of telling you where the index error occurs::
159
155
160
156
161 IndexError
157 IndexError
@@ -178,11 +174,10 b' IPython 8.0 is capable of telling you, where the index error occurs::'
178 ----> 3 return x[0][i][0]
174 ----> 3 return x[0][i][0]
179 ^^^^^^^
175 ^^^^^^^
180
176
181 Corresponding location marked here with ``^`` will show up highlighted in
177 The corresponding locations marked here with ``^`` will show up highlighted in
182 terminal and notebooks.
178 the terminal and notebooks.
183
179
184 The Third, which is the most discreet but can have a high impact on
180 Finally, a colon ``::`` and line number is appended after a filename in
185 productivity, a colon ``::`` and line number is appended after a filename in
186 traceback::
181 traceback::
187
182
188
183
@@ -196,8 +191,9 b' traceback::'
196 1 def f():
191 1 def f():
197 ----> 2 1/0
192 ----> 2 1/0
198
193
199 Many terminal and editor have integrations allow to directly jump to the
194 Many terminals and editors have integrations enabling you to directly jump to the
200 relevant file/line when this syntax is used.
195 relevant file/line when this syntax is used, so this small addition may have a high
196 impact on productivity.
201
197
202
198
203 Autosuggestons
199 Autosuggestons
@@ -274,7 +270,7 b' Show pinfo information in ipdb using "?" and "??"'
274 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
270 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
275
271
276 In IPDB, it is now possible to show the information about an object using "?"
272 In IPDB, it is now possible to show the information about an object using "?"
277 and "??", in much the same way it can be done when using the IPython prompt::
273 and "??", in much the same way that it can be done when using the IPython prompt::
278
274
279 ipdb> partial?
275 ipdb> partial?
280 Init signature: partial(self, /, *args, **kwargs)
276 Init signature: partial(self, /, *args, **kwargs)
@@ -291,14 +287,14 b' Previously, ``pinfo`` or ``pinfo2`` command had to be used for this purpose.'
291 Autoreload 3 feature
287 Autoreload 3 feature
292 ~~~~~~~~~~~~~~~~~~~~
288 ~~~~~~~~~~~~~~~~~~~~
293
289
294 Example: When an IPython session is ran with the 'autoreload' extension loaded,
290 Example: When an IPython session is run with the 'autoreload' extension loaded,
295 you will now have the option '3' to select which means the following:
291 you will now have the option '3' to select, which means the following:
296
292
297 1. replicate all functionality from option 2
293 1. replicate all functionality from option 2
298 2. autoload all new funcs/classes/enums/globals from the module when they are added
294 2. autoload all new funcs/classes/enums/globals from the module when they are added
299 3. autoload all newly imported funcs/classes/enums/globals from external modules
295 3. autoload all newly imported funcs/classes/enums/globals from external modules
300
296
301 Try ``%autoreload 3`` in an IPython session after running ``%load_ext autoreload``
297 Try ``%autoreload 3`` in an IPython session after running ``%load_ext autoreload``.
302
298
303 For more information please see the following unit test : ``extensions/tests/test_autoreload.py:test_autoload_newly_added_objects``
299 For more information please see the following unit test : ``extensions/tests/test_autoreload.py:test_autoload_newly_added_objects``
304
300
@@ -309,7 +305,7 b' If ``black`` is installed in the same environment as IPython, terminal IPython'
309 will now *by default* reformat the code in the CLI when possible. You can
305 will now *by default* reformat the code in the CLI when possible. You can
310 disable this with ``--TerminalInteractiveShell.autoformatter=None``.
306 disable this with ``--TerminalInteractiveShell.autoformatter=None``.
311
307
312 This feature was present in 7.x but disabled by default.
308 This feature was present in 7.x, but disabled by default.
313
309
314
310
315 History Range Glob feature
311 History Range Glob feature
@@ -336,10 +332,10 b' then the glob pattern would be used (globbing *all* history) *and the range woul'
336
332
337 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.
333 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.
338
334
339 Don't start a multi line cell with sunken parenthesis
335 Don't start a multi-line cell with sunken parenthesis
340 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
336 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
341
337
342 From now on IPython will not ask for the next line of input when given a single
338 From now on, IPython will not ask for the next line of input when given a single
343 line with more closing than opening brackets. For example, this means that if
339 line with more closing than opening brackets. For example, this means that if
344 you (mis)type ``]]`` instead of ``[]``, a ``SyntaxError`` will show up, instead of
340 you (mis)type ``]]`` instead of ``[]``, a ``SyntaxError`` will show up, instead of
345 the ``...:`` prompt continuation.
341 the ``...:`` prompt continuation.
@@ -394,89 +390,85 b' Using them this way will make them take the history of the current session up'
394 to the point of the magic call (such that the magic itself will not be
390 to the point of the magic call (such that the magic itself will not be
395 included).
391 included).
396
392
397 Therefore it is now possible to save the whole history to a file using simple
393 Therefore it is now possible to save the whole history to a file using
398 ``%save <filename>``, load and edit it using ``%load`` (makes for a nice usage
394 ``%save <filename>``, load and edit it using ``%load`` (makes for a nice usage
399 when followed with :kbd:`F2`), send it to `dpaste.org <http://dpast.org>`_ using
395 when followed with :kbd:`F2`), send it to `dpaste.org <http://dpast.org>`_ using
400 ``%pastebin``, or view the whole thing syntax-highlighted with a single
396 ``%pastebin``, or view the whole thing syntax-highlighted with a single
401 ``%pycat``.
397 ``%pycat``.
402
398
403
399
404 Windows time-implementation: Switch to process_time
400 Windows timing implementation: Switch to process_time
405 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
401 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
406 Timing for example with ``%%time`` on windows is based on ``time.perf_counter``.
402 Timing on Windows, for example with ``%%time``, was changed from being based on ``time.perf_counter``
407 This is at the end the same as W-All.
403 (which counted time even when the process was sleeping) to being based on ``time.process_time`` instead
408 To be a bit tighter to linux one could change to ``time.process_time`` instead.
404 (which only counts CPU time). This brings it closer to the behavior on Linux. See :ghpull:`12984`.
409 Thus for example one would no longer count periods of sleep and further.
410
411
405
412 Miscellaneous
406 Miscellaneous
413 ~~~~~~~~~~~~~
407 ~~~~~~~~~~~~~
414 - Non-text formatters are not disabled in terminal which should simplify
408 - Non-text formatters are not disabled in the terminal, which should simplify
415 writing extension displaying images or other mimetypes supporting terminals.
409 writing extensions displaying images or other mimetypes in supporting terminals.
416 :ghpull:`12315`
410 :ghpull:`12315`
417 -
418 - It is now possible to automatically insert matching brackets in Terminal IPython using the
411 - It is now possible to automatically insert matching brackets in Terminal IPython using the
419 ``TerminalInteractiveShell.auto_match=True`` option. :ghpull:`12586`
412 ``TerminalInteractiveShell.auto_match=True`` option. :ghpull:`12586`
420 - We are thinking of deprecating the current ``%%javascript`` magic in favor of a better replacement. See :ghpull:`13376`
413 - We are thinking of deprecating the current ``%%javascript`` magic in favor of a better replacement. See :ghpull:`13376`.
421 - ``%time`` uses ``process_time`` instead of ``perf_counter``, see :ghpull:`12984`
422 - ``~`` is now expanded when part of a path in most magics :ghpull:`13385`
414 - ``~`` is now expanded when part of a path in most magics :ghpull:`13385`
423 - ``%/%%timeit`` magic now adds comma every thousands to make reading long number easier :ghpull:`13379`
415 - ``%/%%timeit`` magic now adds a comma every thousands to make reading a long number easier :ghpull:`13379`
424 - ``"info"`` messages can now be customised to hide some fields :ghpull:`13343`
416 - ``"info"`` messages can now be customised to hide some fields :ghpull:`13343`
425 - ``collections.UserList`` now pretty-prints :ghpull:`13320`
417 - ``collections.UserList`` now pretty-prints :ghpull:`13320`
426 - The debugger now have a persistent history, which should make it less
418 - The debugger now has a persistent history, which should make it less
427 annoying to retype commands :ghpull:`13246`
419 annoying to retype commands :ghpull:`13246`
428 - ``!pip`` ``!conda`` ``!cd`` or ``!ls`` are likely doing the wrong thing, we
420 - ``!pip`` ``!conda`` ``!cd`` or ``!ls`` are likely doing the wrong thing. We
429 now warn users if they use it. :ghpull:`12954`
421 now warn users if they use one of those commands. :ghpull:`12954`
430 - make ``%precision`` work for ``numpy.float64`` type :ghpull:`12902`
422 - Make ``%precision`` work for ``numpy.float64`` type :ghpull:`12902`
431
423
432 Re-added support for XDG config directories
424 Re-added support for XDG config directories
433 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
425 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
434
426
435 XDG support through the years did come an go, there is a tension between having
427 XDG support through the years comes and goes. There is a tension between having
436 identical location in all platforms to have simple instructions. After initial
428 an identical location for configuration in all platforms versus having simple instructions.
437 failure a couple of years ago IPython was modified to automatically migrate XDG
429 After initial failures a couple of years ago, IPython was modified to automatically migrate XDG
438 config files back into ``~/.ipython``, the migration code has now been removed.
430 config files back into ``~/.ipython``. That migration code has now been removed.
439 And IPython now check the XDG locations, so if you _manually_ move your config
431 IPython now checks the XDG locations, so if you _manually_ move your config
440 files to your preferred location, IPython will not move them back.
432 files to your preferred location, IPython will not move them back.
441
433
442
434
443 Numfocus Small Developer Grant
435 Preparing for Python 3.10
444 ------------------------------
436 -------------------------
445
437
446 To prepare for Python 3.10 we have also started working on removing reliance and
438 To prepare for Python 3.10, we have started working on removing reliance and
447 any dependency that is not Python 3.10 compatible; that include migrating our
439 any dependency that is not compatible with Python 3.10. This includes migrating our
448 test suite to pytest, and starting to remove nose. This also mean that the
440 test suite to pytest and starting to remove nose. This also means that the
449 ``iptest`` command is now gone, and all testing is via pytest.
441 ``iptest`` command is now gone and all testing is via pytest.
450
442
451 This was in large part thanks to the NumFOCUS Small Developer grant, which enabled us to
443 This was in large part thanks to the NumFOCUS Small Developer grant, which enabled us to
452 allocate \$4000 to hire `Nikita Kniazev (@Kojoley) <https://github.com/Kojoley>`_,
444 allocate \$4000 to hire `Nikita Kniazev (@Kojoley) <https://github.com/Kojoley>`_,
453 who did a fantastic job at updating our code base, migrating to pytest, pushing
445 who did a fantastic job at updating our code base, migrating to pytest, pushing
454 our coverage, and fixing a large number of bugs. I highly recommend contacting
446 our coverage, and fixing a large number of bugs. I highly recommend contacting
455 them if you need help with C++ and Python projects
447 them if you need help with C++ and Python projects.
456
448
457 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+>`__
449 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+>`__
458
450
459 Removing support for Older Python
451 Removing support for older Python versions
460 ---------------------------------
452 ------------------------------------------
461
453
462
454
463 We are also removing support for Python up to 3.7 allowing internal code to use more
455 We are removing support for Python up through 3.7, allowing internal code to use the more
464 efficient ``pathlib``, and make better use of type annotations.
456 efficient ``pathlib`` and to make better use of type annotations.
465
457
466 .. image:: ../_images/8.0/pathlib_pathlib_everywhere.jpg
458 .. image:: ../_images/8.0/pathlib_pathlib_everywhere.jpg
467 :alt: "Meme image of Toy Story with Woody and Buzz, with the text 'pathlib, pathlib everywhere'"
459 :alt: "Meme image of Toy Story with Woody and Buzz, with the text 'pathlib, pathlib everywhere'"
468
460
469
461
470 We have about 34 PRs only to update some logic to update some functions from managing strings to
462 We had about 34 PRs only to update some logic to update some functions from managing strings to
471 using Pathlib.
463 using Pathlib.
472
464
473 The completer has also seen significant updates and make use of newer Jedi API
465 The completer has also seen significant updates and now makes use of newer Jedi APIs,
474 offering faster and more reliable tab completion.
466 offering faster and more reliable tab completion.
475
467
476 Misc Statistics
468 Misc Statistics
477 ---------------
469 ---------------
478
470
479 Here are some numbers:
471 Here are some numbers::
480
472
481 7.x: 296 files, 12561 blank lines, 20282 comments, 35142 line of code.
473 7.x: 296 files, 12561 blank lines, 20282 comments, 35142 line of code.
482 8.0: 252 files, 12053 blank lines, 19232 comments, 34505 line of code.
474 8.0: 252 files, 12053 blank lines, 19232 comments, 34505 line of code.
@@ -484,8 +476,8 b' Here are some numbers:'
484 $ git diff --stat 7.x...master | tail -1
476 $ git diff --stat 7.x...master | tail -1
485 340 files changed, 13399 insertions(+), 12421 deletions(-)
477 340 files changed, 13399 insertions(+), 12421 deletions(-)
486
478
487 We have commits from 162 authors, who contributed 1916 commits in 23 month, excluding merges to not bias toward
479 We have commits from 162 authors, who contributed 1916 commits in 23 month, excluding merges (to not bias toward
488 maintainers pushing buttons.::
480 maintainers pushing buttons).::
489
481
490 $ git shortlog -s --no-merges 7.x...master | sort -nr
482 $ git shortlog -s --no-merges 7.x...master | sort -nr
491 535 Matthias Bussonnier
483 535 Matthias Bussonnier
@@ -649,7 +641,7 b' maintainers pushing buttons.::'
649 1 Albert Zhang
641 1 Albert Zhang
650 1 Adam Johnson
642 1 Adam Johnson
651
643
652 This does not of course represent non-code contributions.
644 This does not, of course, represent non-code contributions, for which we are also grateful.
653
645
654
646
655 API Changes using Frappuccino
647 API Changes using Frappuccino
General Comments 0
You need to be logged in to leave comments. Login now