##// END OF EJS Templates
update what's new
Matthias Bussonnier -
Show More
@@ -1,435 +1,436 b''
1 1 ============
2 2 7.x Series
3 3 ============
4 4
5 5 .. _whatsnew730:
6 6
7 7 IPython 7.3.0
8 8 =============
9 9
10 10 .. _whatsnew720:
11 11
12 12 IPython 7.3.0 bring several bug fixes and small improvements that you will
13 13 described bellow.
14 14
15 15 The biggest change to this release is the implementation of the ``%conda`` and
16 16 ``%pip`` magics, that will attempt to install packages in the **current
17 17 environment**. You may still need to restart your interpreter or kernel for the
18 18 change to be taken into account, but it should simplify installation of packages
19 19 into remote environment. Installing using pip/conda from the command line is
20 20 still the prefer method.
21 21
22 22 The ``%pip`` magic was already present, but was only printing a warning; now it
23 23 will actually forward commands to pip.
24 24
25 25 Misc bug fixes and improvements:
26 26
27 - Compatibility with Python 3.8.
27 28 - Do not expand shell variable in execution magics, and added the
28 29 ``no_var_expand`` decorator for magic requiring a similar functionality
29 30 :ghpull:`11516`
30 31 - Add ``%pip`` and ``%conda`` magic :ghpull:`11524`
31 32 - Re-initialize posix aliases after a ``%reset`` :ghpull:`11528`
32 33 - Allow the IPython command line to run ``*.ipynb`` files :ghpull:`11529`
33 34
34 35 IPython 7.2.0
35 36 =============
36 37
37 38 IPython 7.2.0 brings minor bugfixes, improvements, and new configuration options:
38 39
39 40 - Fix a bug preventing PySide2 GUI integration from working :ghpull:`11464`
40 41 - Run CI on Mac OS ! :ghpull:`11471`
41 42 - Fix IPython "Demo" mode. :ghpull:`11498`
42 43 - Fix ``%run`` magic with path in name :ghpull:`11499`
43 44 - Fix: add CWD to sys.path *after* stdlib :ghpull:`11502`
44 45 - Better rendering of signatures, especially long ones. :ghpull:`11505`
45 46 - Re-enable jedi by default if it's installed :ghpull:`11506`
46 47 - Add New ``minimal`` exception reporting mode (useful for educational purpose). See :ghpull:`11509`
47 48
48 49
49 50 Added ability to show subclasses when using pinfo and other utilities
50 51 ---------------------------------------------------------------------
51 52
52 53 When using ``?``/``??`` on a class, IPython will now list the first 10 subclasses.
53 54
54 55 Special Thanks to Chris Mentzel of the Moore Foundation for this feature. Chris
55 56 is one of the people who played a critical role in IPython/Jupyter getting
56 57 funding.
57 58
58 59 We are grateful for all the help Chris has given us over the years,
59 60 and we're now proud to have code contributed by Chris in IPython.
60 61
61 62 OSMagics.cd_force_quiet configuration option
62 63 --------------------------------------------
63 64
64 65 You can set this option to force the %cd magic to behave as if ``-q`` was passed:
65 66 ::
66 67
67 68 In [1]: cd /
68 69 /
69 70
70 71 In [2]: %config OSMagics.cd_force_quiet = True
71 72
72 73 In [3]: cd /tmp
73 74
74 75 In [4]:
75 76
76 77 See :ghpull:`11491`
77 78
78 79 In vi editing mode, whether the prompt includes the current vi mode can now be configured
79 80 -----------------------------------------------------------------------------------------
80 81
81 82 Set the ``TerminalInteractiveShell.prompt_includes_vi_mode`` to a boolean value
82 83 (default: True) to control this feature. See :ghpull:`11492`
83 84
84 85 .. _whatsnew710:
85 86
86 87 IPython 7.1.0
87 88 =============
88 89
89 90 IPython 7.1.0 is the first minor release after 7.0.0 and mostly brings fixes to
90 91 new features, internal refactoring, and fixes for regressions that happened during the 6.x->7.x
91 92 transition. It also brings **Compatibility with Python 3.7.1**, as we're
92 93 unwillingly relying on a bug in CPython.
93 94
94 95 New Core Dev:
95 96
96 97 - We welcome Jonathan Slenders to the commiters. Jonathan has done a fantastic
97 98 work on prompt_toolkit, and we'd like to recognise his impact by giving him
98 99 commit rights. :ghissue:`11397`
99 100
100 101 Notable Changes
101 102
102 103 - Major update of "latex to unicode" tab completion map (see below)
103 104
104 105 Notable New Features:
105 106
106 107 - Restore functionality and documentation of the **sphinx directive**, which
107 108 is now stricter (fail on error by daefault), has new configuration options,
108 109 has a brand new documentation page :ref:`ipython_directive` (which needs
109 110 some cleanup). It is also now *tested* so we hope to have less regressions.
110 111 :ghpull:`11402`
111 112
112 113 - ``IPython.display.Video`` now supports ``width`` and ``height`` arguments,
113 114 allowing a custom width and height to be set instead of using the video's
114 115 width and height. :ghpull:`11353`
115 116
116 117 - Warn when using ``HTML('<iframe>')`` instead of ``IFrame`` :ghpull:`11350`
117 118
118 119 - Allow Dynamic switching of editing mode between vi/emacs and show
119 120 normal/input mode in prompt when using vi. :ghpull:`11390`. Use ``%config
120 121 TerminalInteractiveShell.editing_mode = 'vi'`` or ``%config
121 122 TerminalInteractiveShell.editing_mode = 'emacs'`` to dynamically switch
122 123 between modes.
123 124
124 125
125 126 Notable Fixes:
126 127
127 128 - Fix entering of **multi-line blocks in terminal** IPython, and various
128 129 crashes in the new input transformation machinery :ghpull:`11354`,
129 130 :ghpull:`11356`, :ghpull:`11358`. These also fix a **Compatibility bug
130 131 with Python 3.7.1**.
131 132
132 133 - Fix moving through generator stack in ipdb :ghpull:`11266`
133 134
134 135 - %Magic command arguments now support quoting. :ghpull:`11330`
135 136
136 137 - Re-add ``rprint`` and ``rprinte`` aliases. :ghpull:`11331`
137 138
138 139 - Remove implicit dependency on ``ipython_genutils`` :ghpull:`11317`
139 140
140 141 - Make ``nonlocal`` raise ``SyntaxError`` instead of silently failing in async
141 142 mode. :ghpull:`11382`
142 143
143 144 - Fix mishandling of magics and ``= !`` assignment just after a dedent in
144 145 nested code blocks :ghpull:`11418`
145 146
146 147 - Fix instructions for custom shortcuts :ghpull:`11426`
147 148
148 149
149 150 Notable Internals improvements:
150 151
151 152 - Use of ``os.scandir`` (Python 3 only) to speed up some file system operations.
152 153 :ghpull:`11365`
153 154
154 155 - use ``perf_counter`` instead of ``clock`` for more precise
155 156 timing results with ``%time`` :ghpull:`11376`
156 157
157 158 Many thanks to all the contributors and in particular to ``bartskowron`` and
158 159 ``tonyfast`` who handled some pretty complicated bugs in the input machinery. We
159 160 had a number of first time contributors and maybe hacktoberfest participants that
160 161 made significant contributions and helped us free some time to focus on more
161 162 complicated bugs.
162 163
163 164 You
164 165 can see all the closed issues and Merged PR, new features and fixes `here
165 166 <https://github.com/ipython/ipython/issues?utf8=%E2%9C%93&q=+is%3Aclosed+milestone%3A7.1+>`_.
166 167
167 168 Unicode Completion update
168 169 -------------------------
169 170
170 171 In IPython 7.1 the Unicode completion map has been updated and synchronized with
171 172 the Julia language.
172 173
173 174 Added and removed character characters:
174 175
175 176 ``\jmath`` (``Θ·``), ``\\underleftrightarrow`` (U+034D, combining) have been
176 177 added, while ``\\textasciicaron`` have been removed
177 178
178 179 Some sequences have seen their prefix removed:
179 180
180 181 - 6 characters ``\text...<tab>`` should now be inputed with ``\...<tab>`` directly,
181 182 - 45 characters ``\Elz...<tab>`` should now be inputed with ``\...<tab>`` directly,
182 183 - 65 characters ``\B...<tab>`` should now be inputed with ``\...<tab>`` directly,
183 184 - 450 characters ``\m...<tab>`` should now be inputed with ``\...<tab>`` directly,
184 185
185 186 Some sequences have seen their prefix shortened:
186 187
187 188 - 5 characters ``\mitBbb...<tab>`` should now be inputed with ``\bbi...<tab>`` directly,
188 189 - 52 characters ``\mit...<tab>`` should now be inputed with ``\i...<tab>`` directly,
189 190 - 216 characters ``\mbfit...<tab>`` should now be inputed with ``\bi...<tab>`` directly,
190 191 - 222 characters ``\mbf...<tab>`` should now be inputed with ``\b...<tab>`` directly,
191 192
192 193 A couple of characters had their sequence simplified:
193 194
194 195 - ``Γ°``, type ``\dh<tab>``, instead of ``\eth<tab>``
195 196 - ``Δ§``, type ``\hbar<tab>``, instead of ``\Elzxh<tab>``
196 197 - ``ΙΈ``, type ``\ltphi<tab>``, instead of ``\textphi<tab>``
197 198 - ``Ο΄``, type ``\varTheta<tab>``, instead of ``\textTheta<tab>``
198 199 - ``ℇ``, type ``\eulermascheroni<tab>``, instead of ``\Eulerconst<tab>``
199 200 - ``β„Ž``, type ``\planck<tab>``, instead of ``\Planckconst<tab>``
200 201
201 202 - U+0336 (COMBINING LONG STROKE OVERLAY), type ``\strike<tab>``, instead of ``\Elzbar<tab>``.
202 203
203 204 A couple of sequences have been updated:
204 205
205 206 - ``\varepsilon`` now gives ``Ι›`` (GREEK SMALL LETTER EPSILON) instead of ``Ξ΅`` (GREEK LUNATE EPSILON SYMBOL),
206 207 - ``\underbar`` now gives U+0331 (COMBINING MACRON BELOW) instead of U+0332 (COMBINING LOW LINE).
207 208
208 209
209 210 .. _whatsnew700:
210 211
211 212 IPython 7.0.0
212 213 =============
213 214
214 215 Released Thursday September 27th, 2018
215 216
216 217 IPython 7 includes major feature improvements.
217 218 This is also the second major version of IPython to support only
218 219 Python 3 – starting at Python 3.4. Python 2 is still community-supported
219 220 on the bugfix only 5.x branch, but we remind you that Python 2 "end of life"
220 221 is on Jan 1st 2020.
221 222
222 223 We were able to backport bug fixes to the 5.x branch thanks to our backport bot which
223 224 backported more than `70 Pull-Requests
224 225 <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>`_
225 226
226 227 The IPython 6.x branch will likely not see any further release unless critical
227 228 bugs are found.
228 229
229 230 Make sure you have pip > 9.0 before upgrading. You should be able to update by running:
230 231
231 232 .. code::
232 233
233 234 pip install ipython --upgrade
234 235
235 236 .. only:: ipydev
236 237
237 238 If you are trying to install or update an ``alpha``, ``beta``, or ``rc``
238 239 version, use pip ``--pre`` flag.
239 240
240 241 .. code::
241 242
242 243 pip install ipython --upgrade --pre
243 244
244 245
245 246 Or, if you have conda installed:
246 247
247 248 .. code::
248 249
249 250 conda install ipython
250 251
251 252
252 253
253 254 Prompt Toolkit 2.0
254 255 ------------------
255 256
256 257 IPython 7.0+ now uses ``prompt_toolkit 2.0``. If you still need to use an earlier
257 258 ``prompt_toolkit`` version, you may need to pin IPython to ``<7.0``.
258 259
259 260 Autowait: Asynchronous REPL
260 261 ---------------------------
261 262
262 263 Staring with IPython 7.0 on Python 3.6+, IPython can automatically ``await``
263 264 top level code. You should not need to access an event loop or runner
264 265 yourself. To learn more, read the :ref:`autoawait` section of our docs, see
265 266 :ghpull:`11265`, or try the following code::
266 267
267 268 Python 3.6.0
268 269 Type 'copyright', 'credits' or 'license' for more information
269 270 IPython 7.0.0 -- An enhanced Interactive Python. Type '?' for help.
270 271
271 272 In [1]: import aiohttp
272 273 ...: result = aiohttp.get('https://api.github.com')
273 274
274 275 In [2]: response = await result
275 276 <pause for a few 100s ms>
276 277
277 278 In [3]: await response.json()
278 279 Out[3]:
279 280 {'authorizations_url': 'https://api.github.com/authorizations',
280 281 'code_search_url': 'https://api.github.com/search/code?q={query}{&page,per_page,sort,order}',
281 282 ...
282 283 }
283 284
284 285 .. note::
285 286
286 287 Async integration is experimental code, behavior may change or be removed
287 288 between Python and IPython versions without warnings.
288 289
289 290 Integration is by default with `asyncio`, but other libraries can be configured --
290 291 like ``curio`` or ``trio`` -- to improve concurrency in the REPL::
291 292
292 293 In [1]: %autoawait trio
293 294
294 295 In [2]: import trio
295 296
296 297 In [3]: async def child(i):
297 298 ...: print(" child %s goes to sleep"%i)
298 299 ...: await trio.sleep(2)
299 300 ...: print(" child %s wakes up"%i)
300 301
301 302 In [4]: print('parent start')
302 303 ...: async with trio.open_nursery() as n:
303 304 ...: for i in range(3):
304 305 ...: n.spawn(child, i)
305 306 ...: print('parent end')
306 307 parent start
307 308 child 2 goes to sleep
308 309 child 0 goes to sleep
309 310 child 1 goes to sleep
310 311 <about 2 seconds pause>
311 312 child 2 wakes up
312 313 child 1 wakes up
313 314 child 0 wakes up
314 315 parent end
315 316
316 317 See :ref:`autoawait` for more information.
317 318
318 319
319 320 Asynchronous code in a Notebook interface or any other frontend using the
320 321 Jupyter Protocol will require further updates to the IPykernel package.
321 322
322 323 Non-Asynchronous code
323 324 ~~~~~~~~~~~~~~~~~~~~~
324 325
325 326 As the internal API of IPython is now asynchronous, IPython needs to run under
326 327 an event loop. In order to allow many workflows, (like using the :magic:`%run`
327 328 magic, or copy-pasting code that explicitly starts/stop event loop), when
328 329 top-level code is detected as not being asynchronous, IPython code is advanced
329 330 via a pseudo-synchronous runner, and may not advance pending tasks.
330 331
331 332 Change to Nested Embed
332 333 ~~~~~~~~~~~~~~~~~~~~~~
333 334
334 335 The introduction of the ability to run async code had some effect on the
335 336 ``IPython.embed()`` API. By default, embed will not allow you to run asynchronous
336 337 code unless an event loop is specified.
337 338
338 339 Effects on Magics
339 340 ~~~~~~~~~~~~~~~~~
340 341
341 342 Some magics will not work with async until they're updated.
342 343 Contributions welcome.
343 344
344 345 Expected Future changes
345 346 ~~~~~~~~~~~~~~~~~~~~~~~
346 347
347 348 We expect more internal but public IPython functions to become ``async``, and
348 349 will likely end up having a persistent event loop while IPython is running.
349 350
350 351 Thanks
351 352 ~~~~~~
352 353
353 354 This release took more than a year in the making.
354 355 The code was rebased a number of
355 356 times; leading to commit authorship that may have been lost in the final
356 357 Pull-Request. Huge thanks to many people for contribution, discussion, code,
357 358 documentation, use-cases: dalejung, danielballan, ellisonbg, fperez, gnestor,
358 359 minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many others.
359 360
360 361
361 362 Autoreload Improvement
362 363 ----------------------
363 364
364 365 The magic :magic:`%autoreload 2 <autoreload>` now captures new methods added to
365 366 classes. Earlier, only methods existing as of the initial import were being
366 367 tracked and updated.
367 368
368 369 This new feature helps dual environment development - Jupyter+IDE - where the
369 370 code gradually moves from notebook cells to package files as it gets
370 371 structured.
371 372
372 373 **Example**: An instance of the class ``MyClass`` will be able to access the
373 374 method ``cube()`` after it is uncommented and the file ``file1.py`` is saved on
374 375 disk.
375 376
376 377
377 378 .. code::
378 379
379 380 # notebook
380 381
381 382 from mymodule import MyClass
382 383 first = MyClass(5)
383 384
384 385 .. code::
385 386
386 387 # mymodule/file1.py
387 388
388 389 class MyClass:
389 390
390 391 def __init__(self, a=10):
391 392 self.a = a
392 393
393 394 def square(self):
394 395 print('compute square')
395 396 return self.a*self.a
396 397
397 398 # def cube(self):
398 399 # print('compute cube')
399 400 # return self.a*self.a*self.a
400 401
401 402
402 403
403 404
404 405 Misc
405 406 ----
406 407
407 408 The autoindent feature that was deprecated in 5.x was re-enabled and
408 409 un-deprecated in :ghpull:`11257`
409 410
410 411 Make :magic:`%run -n -i ... <run>` work correctly. Earlier, if :magic:`%run` was
411 412 passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308`
412 413
413 414
414 415 The :cellmagic:`%%script` (as well as :cellmagic:`%%bash`,
415 416 :cellmagic:`%%ruby`... ) cell magics now raise by default if the return code of
416 417 the given code is non-zero (thus halting execution of further cells in a
417 418 notebook). The behavior can be disable by passing the ``--no-raise-error`` flag.
418 419
419 420
420 421 Deprecations
421 422 ------------
422 423
423 424 A couple of unused functions and methods have been deprecated and will be removed
424 425 in future versions:
425 426
426 427 - ``IPython.utils.io.raw_print_err``
427 428 - ``IPython.utils.io.raw_print``
428 429
429 430
430 431 Backwards incompatible changes
431 432 ------------------------------
432 433
433 434 * The API for transforming input before it is parsed as Python code has been
434 435 completely redesigned: any custom input transformations will need to be
435 436 rewritten. See :doc:`/config/inputtransforms` for details of the new API.
General Comments 0
You need to be logged in to leave comments. Login now