Show More
@@ -1,615 +1,628 b'' | |||
|
1 | 1 | ============ |
|
2 | 2 | 7.x Series |
|
3 | 3 | ============ |
|
4 | 4 | |
|
5 | .. _version 790: | |
|
6 | ||
|
7 | IPython 7.9 is a small release with a couple of improvement and bug fixes. | |
|
8 | ||
|
9 | - Xterm terminal title should be restored on exit :ghpull:`11910` | |
|
10 | - special variables ``_``,``__``, ``___`` are not set anymore when cache size | |
|
11 | is 0 or less. :ghpull:`11877` | |
|
12 | - Autoreload should have regained some speed by using a new heuristic logic to | |
|
13 | find all objects needing reload. This should avoid large objects traversal | |
|
14 | like pandas dataframes. :ghpull:`11876` | |
|
15 | - Get ready for Python 4. :ghpull:`11874` | |
|
16 | ||
|
17 | ||
|
5 | 18 | .. _version780: |
|
6 | 19 | |
|
7 | 20 | IPython 7.8.0 |
|
8 | 21 | ============= |
|
9 | 22 | |
|
10 | 23 | IPython 7.8.0 contain a few bugfix and 2 new APIs: |
|
11 | 24 | |
|
12 | 25 | - Enable changing the font color for LaTeX rendering :ghpull:`11840` |
|
13 | 26 | - and Re-Expose some PDB API (see below) |
|
14 | 27 | |
|
15 | 28 | Expose Pdb API |
|
16 | 29 | -------------- |
|
17 | 30 | |
|
18 | 31 | Expose the built-in ``pdb.Pdb`` API. ``Pdb`` constructor arguments are generically |
|
19 | 32 | exposed, regardless of python version. |
|
20 | 33 | Newly exposed arguments: |
|
21 | 34 | |
|
22 | 35 | - ``skip`` - Python 3.1+ |
|
23 | 36 | - ``nosiginnt`` - Python 3.2+ |
|
24 | 37 | - ``readrc`` - Python 3.6+ |
|
25 | 38 | |
|
26 | 39 | Try it out:: |
|
27 | 40 | |
|
28 | 41 | from IPython.terminal.debugger import TerminalPdb |
|
29 | 42 | pdb = TerminalPdb(skip=["skipthismodule"]) |
|
30 | 43 | |
|
31 | 44 | |
|
32 | 45 | See :ghpull:`11840` |
|
33 | 46 | |
|
34 | 47 | .. _version770: |
|
35 | 48 | |
|
36 | 49 | IPython 7.7.0 |
|
37 | 50 | ============= |
|
38 | 51 | |
|
39 | 52 | IPython 7.7.0 contain multiple bug fixes and documentation updates; Here are a |
|
40 | 53 | few of the outstanding issue fixed: |
|
41 | 54 | |
|
42 | 55 | - Fix a bug introduced in 7.6 where the ``%matplotlib`` magic would fail on |
|
43 | 56 | previously acceptable arguments :ghpull:`11814`. |
|
44 | 57 | - Fix the manage location on freebsd :ghpull:`11808`. |
|
45 | 58 | - Fix error message about aliases after ``%reset`` call in ipykernel |
|
46 | 59 | :ghpull:`11806` |
|
47 | 60 | - Fix Duplication completions in emacs :ghpull:`11803` |
|
48 | 61 | |
|
49 | 62 | We are planning to adopt `NEP29 <https://github.com/numpy/numpy/pull/14086>`_ |
|
50 | 63 | (still currently in draft) which may make this minor version of IPython the |
|
51 | 64 | last one to support Python 3.5 and will make the code base more aggressive |
|
52 | 65 | toward removing compatibility with older versions of Python. |
|
53 | 66 | |
|
54 | 67 | GitHub now support to give only "Triage" permissions to users; if you'd like to |
|
55 | 68 | help close stale issues and labels issues please reach to us with your GitHub |
|
56 | 69 | Username and we'll add you to the triage team. It is a great way to start |
|
57 | 70 | contributing and a path toward getting commit rights. |
|
58 | 71 | |
|
59 | 72 | .. _version761: |
|
60 | 73 | |
|
61 | 74 | IPython 7.6.1 |
|
62 | 75 | ============= |
|
63 | 76 | |
|
64 | 77 | IPython 7.6.1 contain a critical bugfix in the ``%timeit`` magic, which would |
|
65 | 78 | crash on some inputs as a side effect of :ghpull:`11716`. See :ghpull:`11812` |
|
66 | 79 | |
|
67 | 80 | |
|
68 | 81 | .. _whatsnew760: |
|
69 | 82 | |
|
70 | 83 | IPython 7.6.0 |
|
71 | 84 | ============= |
|
72 | 85 | |
|
73 | 86 | IPython 7.6.0 contains a couple of bug fixes and number of small features |
|
74 | 87 | additions as well as some compatibility with the current development version of |
|
75 | 88 | Python 3.8. |
|
76 | 89 | |
|
77 | 90 | - Add a ``-l`` option to :magic:`psearch` to list the available search |
|
78 | 91 | types. :ghpull:`11672` |
|
79 | 92 | - Support ``PathLike`` for ``DisplayObject`` and ``Image``. :ghpull:`11764` |
|
80 | 93 | - Configurability of timeout in the test suite for slow platforms. |
|
81 | 94 | :ghpull:`11756` |
|
82 | 95 | - Accept any casing for matplotlib backend. :ghpull:`121748` |
|
83 | 96 | - Properly skip test that requires numpy to be installed :ghpull:`11723` |
|
84 | 97 | - More support for Python 3.8 and positional only arguments (pep570) |
|
85 | 98 | :ghpull:`11720` |
|
86 | 99 | - Unicode names for the completion are loaded lazily on first use which |
|
87 | 100 | should decrease startup time. :ghpull:`11693` |
|
88 | 101 | - Autoreload now update the types of reloaded objects; this for example allow |
|
89 | 102 | pickling of reloaded objects. :ghpull:`11644` |
|
90 | 103 | - Fix a bug where ``%%time`` magic would suppress cell output. :ghpull:`11716` |
|
91 | 104 | |
|
92 | 105 | |
|
93 | 106 | Prepare migration to pytest (instead of nose) for testing |
|
94 | 107 | --------------------------------------------------------- |
|
95 | 108 | |
|
96 | 109 | Most of the work between 7.5 and 7.6 was to prepare the migration from our |
|
97 | 110 | testing framework to pytest. Most of the test suite should now work by simply |
|
98 | 111 | issuing ``pytest`` from the root of the repository. |
|
99 | 112 | |
|
100 | 113 | The migration to pytest is just at its beginning. Many of our test still rely |
|
101 | 114 | on IPython-specific plugins for nose using pytest (doctest using IPython syntax |
|
102 | 115 | is one example of this where test appear as "passing", while no code has been |
|
103 | 116 | ran). Many test also need to be updated like ``yield-test`` to be properly |
|
104 | 117 | parametrized tests. |
|
105 | 118 | |
|
106 | 119 | Migration to pytest allowed me to discover a number of issues in our test |
|
107 | 120 | suite; which was hiding a number of subtle issues βΒ or not actually running |
|
108 | 121 | some of the tests in our test suite β I have thus corrected many of those; like |
|
109 | 122 | improperly closed resources; or used of deprecated features. I also made use of |
|
110 | 123 | the ``pytest --durations=...`` to find some of our slowest test and speed them |
|
111 | 124 | up (our test suite can now be up to 10% faster). Pytest as also a variety of |
|
112 | 125 | plugins and flags which will make the code quality of IPython and the testing |
|
113 | 126 | experience better. |
|
114 | 127 | |
|
115 | 128 | Misc |
|
116 | 129 | ---- |
|
117 | 130 | |
|
118 | 131 | We skipped the release of 7.6 at the end of May, but will attempt to get back |
|
119 | 132 | on schedule. We are starting to think about making introducing backward |
|
120 | 133 | incompatible change and start the 8.0 series. |
|
121 | 134 | |
|
122 | 135 | Special Thanks to Gabriel (@gpotter2 on GitHub), who among other took care many |
|
123 | 136 | of the remaining task for 7.4 and 7.5, like updating the website. |
|
124 | 137 | |
|
125 | 138 | .. _whatsnew750: |
|
126 | 139 | |
|
127 | 140 | IPython 7.5.0 |
|
128 | 141 | ============= |
|
129 | 142 | |
|
130 | 143 | IPython 7.5.0 consist mostly of bug-fixes, and documentation updates, with one |
|
131 | 144 | minor new feature. The `Audio` display element can now be assigned an element |
|
132 | 145 | id when displayed in browser. See :ghpull:`11670` |
|
133 | 146 | |
|
134 | 147 | The major outstanding bug fix correct a change of behavior that was introduce |
|
135 | 148 | in 7.4.0 where some cell magics would not be able to access or modify global |
|
136 | 149 | scope when using the ``@needs_local_scope`` decorator. This was typically |
|
137 | 150 | encountered with the ``%%time`` and ``%%timeit`` magics. See :ghissue:`11659` |
|
138 | 151 | and :ghpull:`11698`. |
|
139 | 152 | |
|
140 | 153 | .. _whatsnew740: |
|
141 | 154 | |
|
142 | 155 | IPython 7.4.0 |
|
143 | 156 | ============= |
|
144 | 157 | |
|
145 | 158 | Unicode name completions |
|
146 | 159 | ------------------------ |
|
147 | 160 | |
|
148 | 161 | Previously, we provided completion for a unicode name with its relative symbol. |
|
149 | 162 | With this, now IPython provides complete suggestions to unicode name symbols. |
|
150 | 163 | |
|
151 | 164 | As on the PR, if user types ``\LAT<tab>``, IPython provides a list of |
|
152 | 165 | possible completions. In this case, it would be something like:: |
|
153 | 166 | |
|
154 | 167 | 'LATIN CAPITAL LETTER A', |
|
155 | 168 | 'LATIN CAPITAL LETTER B', |
|
156 | 169 | 'LATIN CAPITAL LETTER C', |
|
157 | 170 | 'LATIN CAPITAL LETTER D', |
|
158 | 171 | .... |
|
159 | 172 | |
|
160 | 173 | This help to type unicode character that do not have short latex aliases, and |
|
161 | 174 | have long unicode names. for example ``Ν°``, ``\GREEK CAPITAL LETTER HETA``. |
|
162 | 175 | |
|
163 | 176 | This feature was contributed by Luciana Marques :ghpull:`11583`. |
|
164 | 177 | |
|
165 | 178 | Make audio normalization optional |
|
166 | 179 | --------------------------------- |
|
167 | 180 | |
|
168 | 181 | Added 'normalize' argument to `IPython.display.Audio`. This argument applies |
|
169 | 182 | when audio data is given as an array of samples. The default of `normalize=True` |
|
170 | 183 | preserves prior behavior of normalizing the audio to the maximum possible range. |
|
171 | 184 | Setting to `False` disables normalization. |
|
172 | 185 | |
|
173 | 186 | |
|
174 | 187 | Miscellaneous |
|
175 | 188 | ------------- |
|
176 | 189 | |
|
177 | 190 | - Fix improper acceptation of ``return`` outside of functions. :ghpull:`11641`. |
|
178 | 191 | - Fixed PyQt 5.11 backwards incompatibility causing sip import failure. |
|
179 | 192 | :ghpull:`11613`. |
|
180 | 193 | - Fix Bug where ``type?`` would crash IPython. :ghpull:`1608`. |
|
181 | 194 | - Allow to apply ``@needs_local_scope`` to cell magics for convenience. |
|
182 | 195 | :ghpull:`11542`. |
|
183 | 196 | |
|
184 | 197 | .. _whatsnew730: |
|
185 | 198 | |
|
186 | 199 | IPython 7.3.0 |
|
187 | 200 | ============= |
|
188 | 201 | |
|
189 | 202 | .. _whatsnew720: |
|
190 | 203 | |
|
191 | 204 | IPython 7.3.0 bring several bug fixes and small improvements that you will |
|
192 | 205 | described bellow. |
|
193 | 206 | |
|
194 | 207 | The biggest change to this release is the implementation of the ``%conda`` and |
|
195 | 208 | ``%pip`` magics, that will attempt to install packages in the **current |
|
196 | 209 | environment**. You may still need to restart your interpreter or kernel for the |
|
197 | 210 | change to be taken into account, but it should simplify installation of packages |
|
198 | 211 | into remote environment. Installing using pip/conda from the command line is |
|
199 | 212 | still the prefer method. |
|
200 | 213 | |
|
201 | 214 | The ``%pip`` magic was already present, but was only printing a warning; now it |
|
202 | 215 | will actually forward commands to pip. |
|
203 | 216 | |
|
204 | 217 | Misc bug fixes and improvements: |
|
205 | 218 | |
|
206 | 219 | - Compatibility with Python 3.8. |
|
207 | 220 | - Do not expand shell variable in execution magics, and added the |
|
208 | 221 | ``no_var_expand`` decorator for magic requiring a similar functionality |
|
209 | 222 | :ghpull:`11516` |
|
210 | 223 | - Add ``%pip`` and ``%conda`` magic :ghpull:`11524` |
|
211 | 224 | - Re-initialize posix aliases after a ``%reset`` :ghpull:`11528` |
|
212 | 225 | - Allow the IPython command line to run ``*.ipynb`` files :ghpull:`11529` |
|
213 | 226 | |
|
214 | 227 | IPython 7.2.0 |
|
215 | 228 | ============= |
|
216 | 229 | |
|
217 | 230 | IPython 7.2.0 brings minor bugfixes, improvements, and new configuration options: |
|
218 | 231 | |
|
219 | 232 | - Fix a bug preventing PySide2 GUI integration from working :ghpull:`11464` |
|
220 | 233 | - Run CI on Mac OS ! :ghpull:`11471` |
|
221 | 234 | - Fix IPython "Demo" mode. :ghpull:`11498` |
|
222 | 235 | - Fix ``%run`` magic with path in name :ghpull:`11499` |
|
223 | 236 | - Fix: add CWD to sys.path *after* stdlib :ghpull:`11502` |
|
224 | 237 | - Better rendering of signatures, especially long ones. :ghpull:`11505` |
|
225 | 238 | - Re-enable jedi by default if it's installed :ghpull:`11506` |
|
226 | 239 | - Add New ``minimal`` exception reporting mode (useful for educational purpose). See :ghpull:`11509` |
|
227 | 240 | |
|
228 | 241 | |
|
229 | 242 | Added ability to show subclasses when using pinfo and other utilities |
|
230 | 243 | --------------------------------------------------------------------- |
|
231 | 244 | |
|
232 | 245 | When using ``?``/``??`` on a class, IPython will now list the first 10 subclasses. |
|
233 | 246 | |
|
234 | 247 | Special Thanks to Chris Mentzel of the Moore Foundation for this feature. Chris |
|
235 | 248 | is one of the people who played a critical role in IPython/Jupyter getting |
|
236 | 249 | funding. |
|
237 | 250 | |
|
238 | 251 | We are grateful for all the help Chris has given us over the years, |
|
239 | 252 | and we're now proud to have code contributed by Chris in IPython. |
|
240 | 253 | |
|
241 | 254 | OSMagics.cd_force_quiet configuration option |
|
242 | 255 | -------------------------------------------- |
|
243 | 256 | |
|
244 | 257 | You can set this option to force the %cd magic to behave as if ``-q`` was passed: |
|
245 | 258 | :: |
|
246 | 259 | |
|
247 | 260 | In [1]: cd / |
|
248 | 261 | / |
|
249 | 262 | |
|
250 | 263 | In [2]: %config OSMagics.cd_force_quiet = True |
|
251 | 264 | |
|
252 | 265 | In [3]: cd /tmp |
|
253 | 266 | |
|
254 | 267 | In [4]: |
|
255 | 268 | |
|
256 | 269 | See :ghpull:`11491` |
|
257 | 270 | |
|
258 | 271 | In vi editing mode, whether the prompt includes the current vi mode can now be configured |
|
259 | 272 | ----------------------------------------------------------------------------------------- |
|
260 | 273 | |
|
261 | 274 | Set the ``TerminalInteractiveShell.prompt_includes_vi_mode`` to a boolean value |
|
262 | 275 | (default: True) to control this feature. See :ghpull:`11492` |
|
263 | 276 | |
|
264 | 277 | .. _whatsnew710: |
|
265 | 278 | |
|
266 | 279 | IPython 7.1.0 |
|
267 | 280 | ============= |
|
268 | 281 | |
|
269 | 282 | IPython 7.1.0 is the first minor release after 7.0.0 and mostly brings fixes to |
|
270 | 283 | new features, internal refactoring, and fixes for regressions that happened during the 6.x->7.x |
|
271 | 284 | transition. It also brings **Compatibility with Python 3.7.1**, as we're |
|
272 | 285 | unwillingly relying on a bug in CPython. |
|
273 | 286 | |
|
274 | 287 | New Core Dev: |
|
275 | 288 | |
|
276 | 289 | - We welcome Jonathan Slenders to the commiters. Jonathan has done a fantastic |
|
277 | 290 | work on prompt_toolkit, and we'd like to recognise his impact by giving him |
|
278 | 291 | commit rights. :ghissue:`11397` |
|
279 | 292 | |
|
280 | 293 | Notable Changes |
|
281 | 294 | |
|
282 | 295 | - Major update of "latex to unicode" tab completion map (see below) |
|
283 | 296 | |
|
284 | 297 | Notable New Features: |
|
285 | 298 | |
|
286 | 299 | - Restore functionality and documentation of the **sphinx directive**, which |
|
287 | 300 | is now stricter (fail on error by daefault), has new configuration options, |
|
288 | 301 | has a brand new documentation page :ref:`ipython_directive` (which needs |
|
289 | 302 | some cleanup). It is also now *tested* so we hope to have less regressions. |
|
290 | 303 | :ghpull:`11402` |
|
291 | 304 | |
|
292 | 305 | - ``IPython.display.Video`` now supports ``width`` and ``height`` arguments, |
|
293 | 306 | allowing a custom width and height to be set instead of using the video's |
|
294 | 307 | width and height. :ghpull:`11353` |
|
295 | 308 | |
|
296 | 309 | - Warn when using ``HTML('<iframe>')`` instead of ``IFrame`` :ghpull:`11350` |
|
297 | 310 | |
|
298 | 311 | - Allow Dynamic switching of editing mode between vi/emacs and show |
|
299 | 312 | normal/input mode in prompt when using vi. :ghpull:`11390`. Use ``%config |
|
300 | 313 | TerminalInteractiveShell.editing_mode = 'vi'`` or ``%config |
|
301 | 314 | TerminalInteractiveShell.editing_mode = 'emacs'`` to dynamically switch |
|
302 | 315 | between modes. |
|
303 | 316 | |
|
304 | 317 | |
|
305 | 318 | Notable Fixes: |
|
306 | 319 | |
|
307 | 320 | - Fix entering of **multi-line blocks in terminal** IPython, and various |
|
308 | 321 | crashes in the new input transformation machinery :ghpull:`11354`, |
|
309 | 322 | :ghpull:`11356`, :ghpull:`11358`. These also fix a **Compatibility bug |
|
310 | 323 | with Python 3.7.1**. |
|
311 | 324 | |
|
312 | 325 | - Fix moving through generator stack in ipdb :ghpull:`11266` |
|
313 | 326 | |
|
314 | 327 | - %Magic command arguments now support quoting. :ghpull:`11330` |
|
315 | 328 | |
|
316 | 329 | - Re-add ``rprint`` and ``rprinte`` aliases. :ghpull:`11331` |
|
317 | 330 | |
|
318 | 331 | - Remove implicit dependency on ``ipython_genutils`` :ghpull:`11317` |
|
319 | 332 | |
|
320 | 333 | - Make ``nonlocal`` raise ``SyntaxError`` instead of silently failing in async |
|
321 | 334 | mode. :ghpull:`11382` |
|
322 | 335 | |
|
323 | 336 | - Fix mishandling of magics and ``= !`` assignment just after a dedent in |
|
324 | 337 | nested code blocks :ghpull:`11418` |
|
325 | 338 | |
|
326 | 339 | - Fix instructions for custom shortcuts :ghpull:`11426` |
|
327 | 340 | |
|
328 | 341 | |
|
329 | 342 | Notable Internals improvements: |
|
330 | 343 | |
|
331 | 344 | - Use of ``os.scandir`` (Python 3 only) to speed up some file system operations. |
|
332 | 345 | :ghpull:`11365` |
|
333 | 346 | |
|
334 | 347 | - use ``perf_counter`` instead of ``clock`` for more precise |
|
335 | 348 | timing results with ``%time`` :ghpull:`11376` |
|
336 | 349 | |
|
337 | 350 | Many thanks to all the contributors and in particular to ``bartskowron`` and |
|
338 | 351 | ``tonyfast`` who handled some pretty complicated bugs in the input machinery. We |
|
339 | 352 | had a number of first time contributors and maybe hacktoberfest participants that |
|
340 | 353 | made significant contributions and helped us free some time to focus on more |
|
341 | 354 | complicated bugs. |
|
342 | 355 | |
|
343 | 356 | You |
|
344 | 357 | can see all the closed issues and Merged PR, new features and fixes `here |
|
345 | 358 | <https://github.com/ipython/ipython/issues?utf8=%E2%9C%93&q=+is%3Aclosed+milestone%3A7.1+>`_. |
|
346 | 359 | |
|
347 | 360 | Unicode Completion update |
|
348 | 361 | ------------------------- |
|
349 | 362 | |
|
350 | 363 | In IPython 7.1 the Unicode completion map has been updated and synchronized with |
|
351 | 364 | the Julia language. |
|
352 | 365 | |
|
353 | 366 | Added and removed character characters: |
|
354 | 367 | |
|
355 | 368 | ``\jmath`` (``Θ·``), ``\\underleftrightarrow`` (U+034D, combining) have been |
|
356 | 369 | added, while ``\\textasciicaron`` have been removed |
|
357 | 370 | |
|
358 | 371 | Some sequences have seen their prefix removed: |
|
359 | 372 | |
|
360 | 373 | - 6 characters ``\text...<tab>`` should now be inputed with ``\...<tab>`` directly, |
|
361 | 374 | - 45 characters ``\Elz...<tab>`` should now be inputed with ``\...<tab>`` directly, |
|
362 | 375 | - 65 characters ``\B...<tab>`` should now be inputed with ``\...<tab>`` directly, |
|
363 | 376 | - 450 characters ``\m...<tab>`` should now be inputed with ``\...<tab>`` directly, |
|
364 | 377 | |
|
365 | 378 | Some sequences have seen their prefix shortened: |
|
366 | 379 | |
|
367 | 380 | - 5 characters ``\mitBbb...<tab>`` should now be inputed with ``\bbi...<tab>`` directly, |
|
368 | 381 | - 52 characters ``\mit...<tab>`` should now be inputed with ``\i...<tab>`` directly, |
|
369 | 382 | - 216 characters ``\mbfit...<tab>`` should now be inputed with ``\bi...<tab>`` directly, |
|
370 | 383 | - 222 characters ``\mbf...<tab>`` should now be inputed with ``\b...<tab>`` directly, |
|
371 | 384 | |
|
372 | 385 | A couple of characters had their sequence simplified: |
|
373 | 386 | |
|
374 | 387 | - ``Γ°``, type ``\dh<tab>``, instead of ``\eth<tab>`` |
|
375 | 388 | - ``Δ§``, type ``\hbar<tab>``, instead of ``\Elzxh<tab>`` |
|
376 | 389 | - ``ΙΈ``, type ``\ltphi<tab>``, instead of ``\textphi<tab>`` |
|
377 | 390 | - ``Ο΄``, type ``\varTheta<tab>``, instead of ``\textTheta<tab>`` |
|
378 | 391 | - ``β``, type ``\eulermascheroni<tab>``, instead of ``\Eulerconst<tab>`` |
|
379 | 392 | - ``β``, type ``\planck<tab>``, instead of ``\Planckconst<tab>`` |
|
380 | 393 | |
|
381 | 394 | - U+0336 (COMBINING LONG STROKE OVERLAY), type ``\strike<tab>``, instead of ``\Elzbar<tab>``. |
|
382 | 395 | |
|
383 | 396 | A couple of sequences have been updated: |
|
384 | 397 | |
|
385 | 398 | - ``\varepsilon`` now gives ``Ι`` (GREEK SMALL LETTER EPSILON) instead of ``Ξ΅`` (GREEK LUNATE EPSILON SYMBOL), |
|
386 | 399 | - ``\underbar`` now gives U+0331 (COMBINING MACRON BELOW) instead of U+0332 (COMBINING LOW LINE). |
|
387 | 400 | |
|
388 | 401 | |
|
389 | 402 | .. _whatsnew700: |
|
390 | 403 | |
|
391 | 404 | IPython 7.0.0 |
|
392 | 405 | ============= |
|
393 | 406 | |
|
394 | 407 | Released Thursday September 27th, 2018 |
|
395 | 408 | |
|
396 | 409 | IPython 7 includes major feature improvements. |
|
397 | 410 | This is also the second major version of IPython to support only |
|
398 | 411 | Python 3 βΒ starting at Python 3.4. Python 2 is still community-supported |
|
399 | 412 | on the bugfix only 5.x branch, but we remind you that Python 2 "end of life" |
|
400 | 413 | is on Jan 1st 2020. |
|
401 | 414 | |
|
402 | 415 | We were able to backport bug fixes to the 5.x branch thanks to our backport bot which |
|
403 | 416 | backported more than `70 Pull-Requests |
|
404 | 417 | <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>`_ |
|
405 | 418 | |
|
406 | 419 | The IPython 6.x branch will likely not see any further release unless critical |
|
407 | 420 | bugs are found. |
|
408 | 421 | |
|
409 | 422 | Make sure you have pip > 9.0 before upgrading. You should be able to update by running: |
|
410 | 423 | |
|
411 | 424 | .. code:: |
|
412 | 425 | |
|
413 | 426 | pip install ipython --upgrade |
|
414 | 427 | |
|
415 | 428 | .. only:: ipydev |
|
416 | 429 | |
|
417 | 430 | If you are trying to install or update an ``alpha``, ``beta``, or ``rc`` |
|
418 | 431 | version, use pip ``--pre`` flag. |
|
419 | 432 | |
|
420 | 433 | .. code:: |
|
421 | 434 | |
|
422 | 435 | pip install ipython --upgrade --pre |
|
423 | 436 | |
|
424 | 437 | |
|
425 | 438 | Or, if you have conda installed: |
|
426 | 439 | |
|
427 | 440 | .. code:: |
|
428 | 441 | |
|
429 | 442 | conda install ipython |
|
430 | 443 | |
|
431 | 444 | |
|
432 | 445 | |
|
433 | 446 | Prompt Toolkit 2.0 |
|
434 | 447 | ------------------ |
|
435 | 448 | |
|
436 | 449 | IPython 7.0+ now uses ``prompt_toolkit 2.0``. If you still need to use an earlier |
|
437 | 450 | ``prompt_toolkit`` version, you may need to pin IPython to ``<7.0``. |
|
438 | 451 | |
|
439 | 452 | Autowait: Asynchronous REPL |
|
440 | 453 | --------------------------- |
|
441 | 454 | |
|
442 | 455 | Staring with IPython 7.0 on Python 3.6+, IPython can automatically ``await`` |
|
443 | 456 | top level code. You should not need to access an event loop or runner |
|
444 | 457 | yourself. To learn more, read the :ref:`autoawait` section of our docs, see |
|
445 | 458 | :ghpull:`11265`, or try the following code:: |
|
446 | 459 | |
|
447 | 460 | Python 3.6.0 |
|
448 | 461 | Type 'copyright', 'credits' or 'license' for more information |
|
449 | 462 | IPython 7.0.0 -- An enhanced Interactive Python. Type '?' for help. |
|
450 | 463 | |
|
451 | 464 | In [1]: import aiohttp |
|
452 | 465 | ...: result = aiohttp.get('https://api.github.com') |
|
453 | 466 | |
|
454 | 467 | In [2]: response = await result |
|
455 | 468 | <pause for a few 100s ms> |
|
456 | 469 | |
|
457 | 470 | In [3]: await response.json() |
|
458 | 471 | Out[3]: |
|
459 | 472 | {'authorizations_url': 'https://api.github.com/authorizations', |
|
460 | 473 | 'code_search_url': 'https://api.github.com/search/code?q={query}{&page,per_page,sort,order}', |
|
461 | 474 | ... |
|
462 | 475 | } |
|
463 | 476 | |
|
464 | 477 | .. note:: |
|
465 | 478 | |
|
466 | 479 | Async integration is experimental code, behavior may change or be removed |
|
467 | 480 | between Python and IPython versions without warnings. |
|
468 | 481 | |
|
469 | 482 | Integration is by default with `asyncio`, but other libraries can be configured -- |
|
470 | 483 | like ``curio`` or ``trio`` -- to improve concurrency in the REPL:: |
|
471 | 484 | |
|
472 | 485 | In [1]: %autoawait trio |
|
473 | 486 | |
|
474 | 487 | In [2]: import trio |
|
475 | 488 | |
|
476 | 489 | In [3]: async def child(i): |
|
477 | 490 | ...: print(" child %s goes to sleep"%i) |
|
478 | 491 | ...: await trio.sleep(2) |
|
479 | 492 | ...: print(" child %s wakes up"%i) |
|
480 | 493 | |
|
481 | 494 | In [4]: print('parent start') |
|
482 | 495 | ...: async with trio.open_nursery() as n: |
|
483 | 496 | ...: for i in range(3): |
|
484 | 497 | ...: n.spawn(child, i) |
|
485 | 498 | ...: print('parent end') |
|
486 | 499 | parent start |
|
487 | 500 | child 2 goes to sleep |
|
488 | 501 | child 0 goes to sleep |
|
489 | 502 | child 1 goes to sleep |
|
490 | 503 | <about 2 seconds pause> |
|
491 | 504 | child 2 wakes up |
|
492 | 505 | child 1 wakes up |
|
493 | 506 | child 0 wakes up |
|
494 | 507 | parent end |
|
495 | 508 | |
|
496 | 509 | See :ref:`autoawait` for more information. |
|
497 | 510 | |
|
498 | 511 | |
|
499 | 512 | Asynchronous code in a Notebook interface or any other frontend using the |
|
500 | 513 | Jupyter Protocol will require further updates to the IPykernel package. |
|
501 | 514 | |
|
502 | 515 | Non-Asynchronous code |
|
503 | 516 | ~~~~~~~~~~~~~~~~~~~~~ |
|
504 | 517 | |
|
505 | 518 | As the internal API of IPython is now asynchronous, IPython needs to run under |
|
506 | 519 | an event loop. In order to allow many workflows, (like using the :magic:`%run` |
|
507 | 520 | magic, or copy-pasting code that explicitly starts/stop event loop), when |
|
508 | 521 | top-level code is detected as not being asynchronous, IPython code is advanced |
|
509 | 522 | via a pseudo-synchronous runner, and may not advance pending tasks. |
|
510 | 523 | |
|
511 | 524 | Change to Nested Embed |
|
512 | 525 | ~~~~~~~~~~~~~~~~~~~~~~ |
|
513 | 526 | |
|
514 | 527 | The introduction of the ability to run async code had some effect on the |
|
515 | 528 | ``IPython.embed()`` API. By default, embed will not allow you to run asynchronous |
|
516 | 529 | code unless an event loop is specified. |
|
517 | 530 | |
|
518 | 531 | Effects on Magics |
|
519 | 532 | ~~~~~~~~~~~~~~~~~ |
|
520 | 533 | |
|
521 | 534 | Some magics will not work with async until they're updated. |
|
522 | 535 | Contributions welcome. |
|
523 | 536 | |
|
524 | 537 | Expected Future changes |
|
525 | 538 | ~~~~~~~~~~~~~~~~~~~~~~~ |
|
526 | 539 | |
|
527 | 540 | We expect more internal but public IPython functions to become ``async``, and |
|
528 | 541 | will likely end up having a persistent event loop while IPython is running. |
|
529 | 542 | |
|
530 | 543 | Thanks |
|
531 | 544 | ~~~~~~ |
|
532 | 545 | |
|
533 | 546 | This release took more than a year in the making. |
|
534 | 547 | The code was rebased a number of |
|
535 | 548 | times; leading to commit authorship that may have been lost in the final |
|
536 | 549 | Pull-Request. Huge thanks to many people for contribution, discussion, code, |
|
537 | 550 | documentation, use-cases: dalejung, danielballan, ellisonbg, fperez, gnestor, |
|
538 | 551 | minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many others. |
|
539 | 552 | |
|
540 | 553 | |
|
541 | 554 | Autoreload Improvement |
|
542 | 555 | ---------------------- |
|
543 | 556 | |
|
544 | 557 | The magic :magic:`%autoreload 2 <autoreload>` now captures new methods added to |
|
545 | 558 | classes. Earlier, only methods existing as of the initial import were being |
|
546 | 559 | tracked and updated. |
|
547 | 560 | |
|
548 | 561 | This new feature helps dual environment development - Jupyter+IDE - where the |
|
549 | 562 | code gradually moves from notebook cells to package files as it gets |
|
550 | 563 | structured. |
|
551 | 564 | |
|
552 | 565 | **Example**: An instance of the class ``MyClass`` will be able to access the |
|
553 | 566 | method ``cube()`` after it is uncommented and the file ``file1.py`` is saved on |
|
554 | 567 | disk. |
|
555 | 568 | |
|
556 | 569 | |
|
557 | 570 | .. code:: |
|
558 | 571 | |
|
559 | 572 | # notebook |
|
560 | 573 | |
|
561 | 574 | from mymodule import MyClass |
|
562 | 575 | first = MyClass(5) |
|
563 | 576 | |
|
564 | 577 | .. code:: |
|
565 | 578 | |
|
566 | 579 | # mymodule/file1.py |
|
567 | 580 | |
|
568 | 581 | class MyClass: |
|
569 | 582 | |
|
570 | 583 | def __init__(self, a=10): |
|
571 | 584 | self.a = a |
|
572 | 585 | |
|
573 | 586 | def square(self): |
|
574 | 587 | print('compute square') |
|
575 | 588 | return self.a*self.a |
|
576 | 589 | |
|
577 | 590 | # def cube(self): |
|
578 | 591 | # print('compute cube') |
|
579 | 592 | # return self.a*self.a*self.a |
|
580 | 593 | |
|
581 | 594 | |
|
582 | 595 | |
|
583 | 596 | |
|
584 | 597 | Misc |
|
585 | 598 | ---- |
|
586 | 599 | |
|
587 | 600 | The autoindent feature that was deprecated in 5.x was re-enabled and |
|
588 | 601 | un-deprecated in :ghpull:`11257` |
|
589 | 602 | |
|
590 | 603 | Make :magic:`%run -n -i ... <run>` work correctly. Earlier, if :magic:`%run` was |
|
591 | 604 | passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308` |
|
592 | 605 | |
|
593 | 606 | |
|
594 | 607 | The :cellmagic:`%%script` (as well as :cellmagic:`%%bash`, |
|
595 | 608 | :cellmagic:`%%ruby`... ) cell magics now raise by default if the return code of |
|
596 | 609 | the given code is non-zero (thus halting execution of further cells in a |
|
597 | 610 | notebook). The behavior can be disable by passing the ``--no-raise-error`` flag. |
|
598 | 611 | |
|
599 | 612 | |
|
600 | 613 | Deprecations |
|
601 | 614 | ------------ |
|
602 | 615 | |
|
603 | 616 | A couple of unused functions and methods have been deprecated and will be removed |
|
604 | 617 | in future versions: |
|
605 | 618 | |
|
606 | 619 | - ``IPython.utils.io.raw_print_err`` |
|
607 | 620 | - ``IPython.utils.io.raw_print`` |
|
608 | 621 | |
|
609 | 622 | |
|
610 | 623 | Backwards incompatible changes |
|
611 | 624 | ------------------------------ |
|
612 | 625 | |
|
613 | 626 | * The API for transforming input before it is parsed as Python code has been |
|
614 | 627 | completely redesigned: any custom input transformations will need to be |
|
615 | 628 | 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