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