##// END OF EJS Templates
Merge pull request #13389 from Carreau/morewn...
Matthias Bussonnier -
r27304:465a6075 merge
parent child Browse files
Show More
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -185,7 +185,7 b' def _format_filename(file, ColorFilename, ColorNormal):'
185
185
186 if ipinst is not None and file in ipinst.compile._filename_map:
186 if ipinst is not None and file in ipinst.compile._filename_map:
187 file = "[%s]" % ipinst.compile._filename_map[file]
187 file = "[%s]" % ipinst.compile._filename_map[file]
188 tpl_link = "In %s%%s%s" % (ColorFilename, ColorNormal)
188 tpl_link = "Input %sIn %%s%s" % (ColorFilename, ColorNormal)
189 else:
189 else:
190 file = util_path.compress_user(
190 file = util_path.compress_user(
191 py3compat.cast_unicode(file, util_path.fs_encoding)
191 py3compat.cast_unicode(file, util_path.fs_encoding)
1 NO CONTENT: file renamed from docs/source/_images/auto_suggest_d_completions.png to docs/source/_images/8.0/auto_suggest_d_completions.png
NO CONTENT: file renamed from docs/source/_images/auto_suggest_d_completions.png to docs/source/_images/8.0/auto_suggest_d_completions.png
1 NO CONTENT: file renamed from docs/source/_images/audo_suggest_d_phantom.png to docs/source/_images/8.0/auto_suggest_d_phantom.png
NO CONTENT: file renamed from docs/source/_images/audo_suggest_d_phantom.png to docs/source/_images/8.0/auto_suggest_d_phantom.png
1 NO CONTENT: file renamed from docs/source/_images/auto_suggest_def_completions.png to docs/source/_images/8.0/auto_suggest_def_completions.png
NO CONTENT: file renamed from docs/source/_images/auto_suggest_def_completions.png to docs/source/_images/8.0/auto_suggest_def_completions.png
1 NO CONTENT: file renamed from docs/source/_images/auto_suggest_def_phantom.png to docs/source/_images/8.0/auto_suggest_def_phantom.png
NO CONTENT: file renamed from docs/source/_images/auto_suggest_def_phantom.png to docs/source/_images/8.0/auto_suggest_def_phantom.png
1 NO CONTENT: file renamed from docs/source/_images/auto_suggest_match_parens.png to docs/source/_images/8.0/auto_suggest_match_parens.png
NO CONTENT: file renamed from docs/source/_images/auto_suggest_match_parens.png to docs/source/_images/8.0/auto_suggest_match_parens.png
1 NO CONTENT: file renamed from docs/source/_images/auto_suggest_print_hello.png to docs/source/_images/8.0/auto_suggest_print_hello.png
NO CONTENT: file renamed from docs/source/_images/auto_suggest_print_hello.png to docs/source/_images/8.0/auto_suggest_print_hello.png
1 NO CONTENT: file renamed from docs/source/_images/auto_suggest_print_hello_suggest.png to docs/source/_images/8.0/auto_suggest_print_hello_suggest.png
NO CONTENT: file renamed from docs/source/_images/auto_suggest_print_hello_suggest.png to docs/source/_images/8.0/auto_suggest_print_hello_suggest.png
1 NO CONTENT: file renamed from docs/source/_images/auto_suggest_prompt_no_text.png to docs/source/_images/8.0/auto_suggest_prompt_no_text.png
NO CONTENT: file renamed from docs/source/_images/auto_suggest_prompt_no_text.png to docs/source/_images/8.0/auto_suggest_prompt_no_text.png
1 NO CONTENT: file renamed from docs/source/_images/auto_suggest_second_prompt.png to docs/source/_images/8.0/auto_suggest_second_prompt.png
NO CONTENT: file renamed from docs/source/_images/auto_suggest_second_prompt.png to docs/source/_images/8.0/auto_suggest_second_prompt.png
@@ -26,21 +26,95 b' IPython 8.0 is bringing a large number of new features and improvements to both '
26 user of the terminal and of the kernel via Jupyter. The removal of compatibility
26 user of the terminal and of the kernel via Jupyter. The removal of compatibility
27 with older version of Python is also the opportunity to do a couple of
27 with older version of Python is also the opportunity to do a couple of
28 performance improvement in particular with respect to startup time.
28 performance improvement in particular with respect to startup time.
29 The 8.x branch started diverging from its predecessor around IPython 7.12
30 (January 2020).
29
31
30 This release contains 250+ Pull requests, in addition to many of the features
32 This release contains 250+ Pull Requests, in addition to many of the features
31 and backports that have made it to the 7.x branch.
33 and backports that have made it to the 7.x branch. All PRs that went into this
34 released are properly tagged with the 8.0 milestone if you wish to have a more
35 in depth look at the changes.
36
37 Please fell free to send pull-requests to updates those notes after release,
38 I have likely forgotten a few things reviewing 250+ PRs.
39
40 Dependencies changes/downstream packaging
41 -----------------------------------------
42
43 Note that most of our building step have been changes to be (mostly) declarative
44 and follow PEP 517, we are trying to completely remove ``setup.py`` (:ghpull:`13238`) and are
45 looking for help to do so.
46
47 - Minimum supported ``traitlets`` version if now 5+
48 - we now require ``stack_data``
49 - Minimal Python is now 3.8
50 - ``nose`` is not a testing requirement anymore
51 - ``pytest`` replaces nose.
52 - ``iptest``/``iptest3`` cli entrypoints do not exists anymore.
53 - minimum officially support ``numpy`` version has been bumped, but this should
54 not have much effect on packaging.
55
56
57 Deprecation and removal
58 -----------------------
32
59
33 We removed almost all features, arguments, functions, and modules that were
60 We removed almost all features, arguments, functions, and modules that were
34 marked as deprecated between IPython 1.0 and 5.0 and before. As reminder 5.0 was
61 marked as deprecated between IPython 1.0 and 5.0. As reminder 5.0 was released
35 released in 2016, and 1.0 in 2013. Last release of the 5 branch was 5.10.0, in
62 in 2016, and 1.0 in 2013. Last release of the 5 branch was 5.10.0, in may 2020.
36 may 2020. The few remaining deprecated features have better deprecation warnings
63 The few remaining deprecated features we left have better deprecation warnings
37 or errors.
64 or have been turned into explicit errors for better error messages.
38
65
39 There are many change in IPython 8.0 will will try to describe subsequently,
66 I will use this occasion to add the following requests to anyone emitting a
67 deprecation warning:
68
69 - Please at at least ``stacklevel=2`` so that the warning is emitted into the
70 caller context, and not the callee one.
71 - Please add **since which version** something is deprecated.
72
73 As a side note it is much easier to deal with conditional comparing to versions
74 numbers than ``try/except`` when a functionality change with version.
75
76 I won't list all the removed features here, but modules like ``IPython.kernel``,
77 which was just a shim module around ``ipykernel`` for the past 8 years have been
78 remove, and so many other similar things that pre-date the name **Jupyter**
79 itself.
80
81 We no longer need to add ``IPyhton.extensions`` to the PYTHONPATH because that is being
82 handled by ``load_extension``.
83
84 We are also removing ``Cythonmagic``, ``sympyprinting`` and ``rmagic`` as they are now in
85 other packages and no longer need to be inside IPython.
40
86
41
87
88 Documentation
89 -------------
90
91 Majority of our docstrings have now been reformatted and automatically fixed by
92 the experimental `VΓ©lin <https://pypi.org/project/velin/>`_ project, to conform
93 to numpydoc.
94
95 Type annotations
96 ----------------
97
98 While IPython itself is highly dynamic and can't be completely typed, many of
99 the function now have type annotation, and part of the codebase and now checked
100 by mypy.
101
102
103 Featured changes
104 ----------------
105
106 Here is a features list of changes in IPython 8.0. This is of course non-exhaustive.
107 Please note as well that many features have been added in the 7.x branch as well
108 (and hence why you want to read the 7.x what's new notes), in particular
109 features contributed by QuantStack (with respect to debugger protocol, and Xeus
110 Python), as well as many debugger features that I was please to implement as
111 part of my work at QuanSight and Sponsored by DE Shaw.
112
113 Better Tracebacks
114 ~~~~~~~~~~~~~~~~~
115
42 The first on is the integration of the ``stack_data`` package;
116 The first on is the integration of the ``stack_data`` package;
43 which provide smarter information in traceback; in particular it will highlight
117 which provide smarter informations in traceback; in particular it will highlight
44 the AST node where an error occurs which can help to quickly narrow down errors.
118 the AST node where an error occurs which can help to quickly narrow down errors.
45
119
46 For example in the following snippet::
120 For example in the following snippet::
@@ -59,44 +133,33 b' For example in the following snippet::'
59 Calling ``bar()`` would raise an ``IndexError`` on the return line of ``foo``,
133 Calling ``bar()`` would raise an ``IndexError`` on the return line of ``foo``,
60 IPython 8.0 is capable of telling you, where the index error occurs::
134 IPython 8.0 is capable of telling you, where the index error occurs::
61
135
62 return x[0][i][0]
63 ^
64
65
66 Numfocus Small Developer Grant
67 ------------------------------
68
69 To prepare for Python 3.10 we have also started working on removing reliance and
70 any dependency that is not Python 3.10 compatible; that include migrating our
71 test suite to pytest, and starting to remove nose. This also mean that the
72 ``iptest`` command is now gone, and all testing is via pytest.
73
136
74 This was in bog part thanks the NumFOCUS Small Developer grant, we were able to
137 IndexError
75 allocate 4000 to hire `Nikita Kniazev @Kojoley <https://github.com/Kojoley>`__
138 Input In [2], in <module>
76 who did a fantastic job at updating our code base, migrating to pytest, pushing
139 ----> 1 bar()
77 our coverage, and fixing a large number of bugs. I highly recommend contacting
140 ^^^^^
78 them if you need help with C++ and Python projects
79
141
80 You can find all relevant issues and PRs with the SDG 2021 tag:
142 Input In [1], in bar()
81
143 6 def bar():
82 https://github.com/ipython/ipython/issues?q=label%3A%22Numfocus+SDG+2021%22+
144 ----> 7 return foo(0) + foo(
83
145 ^^^^
84 Removing support for Older Python
146 8 1
85 ---------------------------------
147 ^^^^^^^^
148 9 ) + foo(2)
149 ^^^^
86
150
151 Input In [1], in foo(i)
152 1 def foo(i):
153 2 x = [[[0]]]
154 ----> 3 return x[0][i][0]
155 ^^^^^^^
87
156
88 We are also removing support for Python up to 3.7 allowing internal code to use more
157 Corresponding location marked here with ``^`` will show up highlighted in
89 efficient ``pathlib``, and make better use of type annotations.
158 terminal and notebooks.
90
91 IMAGE : Pathlib, pathlib everywhere.
92
93 The completer has also seen significant updates and make use of newer Jedi API
94 offering faster and more reliable tab completion.
95
159
96 For the terminal users this also enable the auto-suggestion feature, described
97 below, which show "ghost text" ahead of your cursor you can accept without
98 having to press the tab key or ask the completer to suggest completions.
99
160
161 Autosuggestons
162 ~~~~~~~~~~~~~~
100
163
101 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>`__.
164 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>`__.
102
165
@@ -108,55 +171,55 b' or right arrow as described below.'
108
171
109 1. Start ipython
172 1. Start ipython
110
173
111 .. image:: ../_images/auto_suggest_prompt_no_text.png
174 .. image:: ../_images/8.0/auto_suggest_prompt_no_text.png
112
175
113 2. Run ``print("hello")``
176 2. Run ``print("hello")``
114
177
115 .. image:: ../_images/auto_suggest_print_hello_suggest.png
178 .. image:: ../_images/8.0/auto_suggest_print_hello_suggest.png
116
179
117 3. Press p to see the autosuggestion
180 3. Press p to see the autosuggestion
118
181
119 .. image:: ../_images/auto_suggest_print_hello_suggest.png
182 .. image:: ../_images/8.0/auto_suggest_print_hello_suggest.png
120
183
121 4. Press ctrl f, or ctrl e, or right arrow to accept the suggestion
184 4. Press ctrl f, or ctrl e, or right arrow to accept the suggestion
122
185
123 .. image:: ../_images/auto_suggest_print_hello.png
186 .. image:: ../_images/8.0/auto_suggest_print_hello.png
124
187
125 You can also complete word by word:
188 You can also complete word by word:
126
189
127 1. Run ``def say_hello(): print("hello")``
190 1. Run ``def say_hello(): print("hello")``
128
191
129 .. image:: ../_images/auto_suggest_second_prompt.png
192 .. image:: ../_images/8.0/auto_suggest_second_prompt.png
130
193
131 2. Press d to see the autosuggestion
194 2. Press d to see the autosuggestion
132
195
133 .. image:: ../_images/audo_suggest_d_phantom.png
196 .. image:: ../_images/8.0/auto_suggest_d_phantom.png
134
197
135 3. Press alt f to accept the first word of the suggestion
198 3. Press alt f to accept the first word of the suggestion
136
199
137 .. image:: ../_images/auto_suggest_def_phantom.png
200 .. image:: ../_images/8.0/auto_suggest_def_phantom.png
138
201
139 Importantly, this feature does not interfere with tab completion:
202 Importantly, this feature does not interfere with tab completion:
140
203
141 1. After running ``def say_hello(): print("hello")``, press d
204 1. After running ``def say_hello(): print("hello")``, press d
142
205
143 .. image:: ../_images/audo_suggest_d_phantom.png
206 .. image:: ../_images/8.0/auto_suggest_d_phantom.png
144
207
145 2. Press Tab to start tab completion
208 2. Press Tab to start tab completion
146
209
147 .. image:: ../_images/auto_suggest_d_completions.png
210 .. image:: ../_images/8.0/auto_suggest_d_completions.png
148
211
149 3A. Press Tab again to select the first option
212 3A. Press Tab again to select the first option
150
213
151 .. image:: ../_images/auto_suggest_def_completions.png
214 .. image:: ../_images/8.0/auto_suggest_def_completions.png
152
215
153 3B. Press alt f to accept to accept the first word of the suggestion
216 3B. Press alt f to accept to accept the first word of the suggestion
154
217
155 .. image:: ../_images/auto_suggest_def_phantom.png
218 .. image:: ../_images/8.0/auto_suggest_def_phantom.png
156
219
157 3C. Press ctrl f or ctrl e to accept the entire suggestion
220 3C. Press ctrl f or ctrl e to accept the entire suggestion
158
221
159 .. image:: ../_images/auto_suggest_match_parens.png
222 .. image:: ../_images/8.0/auto_suggest_match_parens.png
160
223
161 To install a version of ipython with autosuggestions enabled, run:
224 To install a version of ipython with autosuggestions enabled, run:
162
225
@@ -169,7 +232,7 b' Currently, autosuggestions are only shown in the emacs or vi insert editing mode'
169
232
170
233
171 Show pinfo information in ipdb using "?" and "??"
234 Show pinfo information in ipdb using "?" and "??"
172 -------------------------------------------------
235 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
173
236
174 In IPDB, it is now possible to show the information about an object using "?"
237 In IPDB, it is now possible to show the information about an object using "?"
175 and "??", in much the same way it can be done when using the IPython prompt::
238 and "??", in much the same way it can be done when using the IPython prompt::
@@ -187,7 +250,7 b' Previously, "pinfo" or "pinfo2" command had to be used for this purpose.'
187
250
188
251
189 Autoreload 3 feature
252 Autoreload 3 feature
190 ====================
253 ~~~~~~~~~~~~~~~~~~~~
191
254
192 Example: When an IPython session is ran with the 'autoreload' extension loaded,
255 Example: When an IPython session is ran with the 'autoreload' extension loaded,
193 you will now have the option '3' to select which means the following:
256 you will now have the option '3' to select which means the following:
@@ -202,14 +265,10 b' For more information please see unit test -'
202 extensions/tests/test_autoreload.py : 'test_autoload_newly_added_objects'
265 extensions/tests/test_autoreload.py : 'test_autoload_newly_added_objects'
203
266
204
267
205 Miscelanious
206 ------------
207
208 Minimum supported
209
268
210
269
211 History Range Glob feature
270 History Range Glob feature
212 ==========================
271 ~~~~~~~~~~~~~~~~~~~~~~~~~~
213
272
214 Previously, when using ``%history``, users could specify either
273 Previously, when using ``%history``, users could specify either
215 a range of sessions and lines, for example:
274 a range of sessions and lines, for example:
@@ -230,12 +289,10 b' However users could *not* specify both.'
230 If a user *did* specify both a range and a glob pattern,
289 If a user *did* specify both a range and a glob pattern,
231 then the glob pattern would be used (globbing *all* history) *and the range would be ignored*.
290 then the glob pattern would be used (globbing *all* history) *and the range would be ignored*.
232
291
233 ---
234
235 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.
292 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.
236
293
237 Don't start a multi line cell with sunken parenthesis
294 Don't start a multi line cell with sunken parenthesis
238 -----------------------------------------------------
295 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
239
296
240 From now on IPython will not ask for the next line of input when given a single
297 From now on IPython will not ask for the next line of input when given a single
241 line with more closing than opening brackets. For example, this means that if
298 line with more closing than opening brackets. For example, this means that if
@@ -243,12 +300,12 b" you (mis)type ']]' instead of '[]', a ``SyntaxError`` will show up, instead of"
243 the ``...:`` prompt continuation.
300 the ``...:`` prompt continuation.
244
301
245 IPython shell for ipdb interact
302 IPython shell for ipdb interact
246 -------------------------------
303 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
247
304
248 The ipdb ``interact`` starts an IPython shell instead of Python's built-in ``code.interact()``.
305 The ipdb ``interact`` starts an IPython shell instead of Python's built-in ``code.interact()``.
249
306
250 Automatic Vi prompt stripping
307 Automatic Vi prompt stripping
251 =============================
308 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
252
309
253 When pasting code into IPython, it will strip the leading prompt characters if
310 When pasting code into IPython, it will strip the leading prompt characters if
254 there are any. For example, you can paste the following code into the console -
311 there are any. For example, you can paste the following code into the console -
@@ -278,7 +335,7 b' IPython shell can be started in the Vi mode using ``ipython'
278 --TerminalInteractiveShell.editing_mode=vi``
335 --TerminalInteractiveShell.editing_mode=vi``
279
336
280 Empty History Ranges
337 Empty History Ranges
281 ====================
338 ~~~~~~~~~~~~~~~~~~~~
282
339
283 A number of magics that take history ranges can now be used with an empty
340 A number of magics that take history ranges can now be used with an empty
284 range. These magics are:
341 range. These magics are:
@@ -298,7 +355,7 b' when followed with :kbd:`F2`), send it to dpaste.org using ``%pastebin``, or'
298 view the whole thing syntax-highlighted with a single ``%pycat``.
355 view the whole thing syntax-highlighted with a single ``%pycat``.
299
356
300 Traceback improvements
357 Traceback improvements
301 ======================
358 ~~~~~~~~~~~~~~~~~~~~~~
302
359
303
360
304 UPDATE THIS IN INPUT.
361 UPDATE THIS IN INPUT.
@@ -328,27 +385,76 b' The error traceback is now correctly formatted, showing the cell number in which'
328 ...: return 3 / 0
385 ...: return 3 / 0
329 ...:
386 ...:
330
387
331 In [2]: foo()
388 Input In [2]: foo()
332 ---------------------------------------------------------------------------
389 ---------------------------------------------------------------------------
333 ZeroDivisionError Traceback (most recent call last)
390 ZeroDivisionError Traceback (most recent call last)
334 In [2], in <module>
391 input In [2], in <module>
335 ----> 1 foo()
392 ----> 1 foo()
336
393
337 In [1], in foo()
394 Input In [1], in foo()
338 1 def foo():
395 1 def foo():
339 ----> 2 return 3 / 0
396 ----> 2 return 3 / 0
340
397
341 ZeroDivisionError: division by zero
398 ZeroDivisionError: division by zero
342
399
343 Remove Deprecated Stuff
400 Miscellaneous
344 =======================
401 ~~~~~~~~~~~~~
345
402
403 - ``~`` is now expanded when part of a path in most magics :ghpull:`13385`
404 - ``%/%%timeit`` magic now adds comma every thousands to make reading long number easier :ghpull:`13379`
405 - ``"info"`` messages can now be customised to hide some fields :ghpull:`13343`
406 - ``collections.UserList`` now pretty-prints :ghpull:`13320`
407 - The debugger now have a persistent history, which should make it less
408 annoying to retype commands :ghpull:`13246`
409 - ``!pip`` ``!conda`` ``!cd`` or ``!ls`` are likely doing the wrong thing, we
410 now warn users if they use it. :ghpull:`12954`
411 - make ``%precision`` work for ``numpy.float64`` type :ghpull:`12902`
412
413
414
415
416 Numfocus Small Developer Grant
417 ------------------------------
418
419 To prepare for Python 3.10 we have also started working on removing reliance and
420 any dependency that is not Python 3.10 compatible; that include migrating our
421 test suite to pytest, and starting to remove nose. This also mean that the
422 ``iptest`` command is now gone, and all testing is via pytest.
423
424 This was in bog part thanks the NumFOCUS Small Developer grant, we were able to
425 allocate 4000 to hire `Nikita Kniazev @Kojoley <https://github.com/Kojoley>`__
426 who did a fantastic job at updating our code base, migrating to pytest, pushing
427 our coverage, and fixing a large number of bugs. I highly recommend contacting
428 them if you need help with C++ and Python projects
429
430 You can find all relevant issues and PRs with the SDG 2021 tag:
431
432 https://github.com/ipython/ipython/issues?q=label%3A%22Numfocus+SDG+2021%22+
433
434 Removing support for Older Python
435 ---------------------------------
436
437
438 We are also removing support for Python up to 3.7 allowing internal code to use more
439 efficient ``pathlib``, and make better use of type annotations.
440
441 .. image:: ../_images/8.0/pathlib_pathlib_everywhere.jpg
442 :alt: "Meme image of Toy story with Woody and Buzz, with the text 'pathlib, pathlib everywhere'"
443
444
445 IMAGE : Pathlib, pathlib everywhere.
446
447 We have about 34 PRs only to update some logic tu update some function from managing strings to
448 using Pathlib.
449
450 The completer has also seen significant updates and make use of newer Jedi API
451 offering faster and more reliable tab completion.
452
453 For the terminal users this also enable the auto-suggestion feature, described
454 below, which show "ghost text" ahead of your cursor you can accept without
455 having to press the tab key or ask the completer to suggest completions.
346
456
347 We no longer need to add `extensions` to the PYTHONPATH because that is being
348 handled by `load_extension`.
349
457
350 We are also removing Cythonmagic, sympyprinting and rmagic as they are now in
351 other packages and no longer need to be inside IPython.
352
458
353 .. DO NOT EDIT THIS LINE BEFORE RELEASE. FEATURE INSERTION POINT.
459 .. DO NOT EDIT THIS LINE BEFORE RELEASE. FEATURE INSERTION POINT.
354
460
General Comments 0
You need to be logged in to leave comments. Login now