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