##// END OF EJS Templates
Update what's new for 7.1.0
Matthias Bussonnier -
Show More
@@ -1,230 +1,303 b''
1 ============
1 ============
2 7.x Series
2 7.x Series
3 ============
3 ============
4
4
5 .. _whatsnew710:
6
7 IPython 7.1.0
8 =============
9
10
11 IPython 7.1.0 is the first minor release after 7.0.0 and mostly bring fixes to
12 new feature, internal refactor and regressions that happen during the 6.x->7.x
13 transition. It also bring **Compatibility with Python 3.7.1**, as were
14 unwillingly relying on a bug in CPython.
15
16 New Core Dev:
17
18 - We welcome Jonathan Slenders to the commiters. Jonathan has done a fantastic
19 work on Prompt toolkit, and we'd like to recognise his impact by giving him
20 commit rights. :ghissue:`11397`
21
22 Notable New Features:
23
24 - Restore functionality and documentation of the **sphinx directive**, which is
25 now stricter (fail on error by default), gained configuration options, have a
26 brand new documentation page :ref:`ipython_directive`, which need some cleanup.
27 It is also now *tested* so we hope to have less regressions.
28 :ghpull:`11402`
29
30 - ``IPython.display.Video`` now supports ``width`` and ``height`` arguments,
31 allowing a custom width and height to be set instead of using the video's
32 width and height. :ghpull:`11353`
33
34 - Warn when using ``HTML('<iframe>')`` instead of ``IFrame`` :ghpull:`11350`
35
36 - Allow Dynamic switching of editing mode between vi/emacs and show
37 normal/input mode in prompt when using vi. :ghpull:`11390`. Use ``%config
38 TerminalInteractiveShell.editing_mode = 'vi'`` or ``%config
39 TerminalInteractiveShell.editing_mode = 'emacs'`` to dynamically spwitch
40
41
42 Notable Fixes:
43
44 - Fix entering of **multi-line block in terminal** IPython, and various crashes
45 in the new input transformation machinery :ghpull:`11354`, :ghpull:`11356`, :ghpull:`11358`, these
46 ones also fix a **Compatibility but with Python 3.7.1**.
47
48 - Fix moving through generator stack in ipdb :ghpull:`11266`
49
50 - Magics arguments now support quoting. :ghpull:`11330`
51
52 - Re-add ``rprint`` and ``rprinte`` aliases. :ghpull:`11331`
53
54 - Remove implicit dependency to ``ipython_genutils`` :ghpull:`11317`
55
56 - Make ``nonlocal`` raise ``SyntaxError`` instead of silently failing in async
57 mode. :ghpull:`11382`
58
59
60 Notable Internals improvements:
61
62 - Use of ``os.scandir`` (Python 3 only) to speedup some file system operations.
63 :ghpull:`11365`
64
65 - use ``perf_counter`` instead of ``clock`` for more precise
66 timing result with ``%time`` :ghpull:`11376`
67
68 Many thanks to all the contributors and in particular to ``bartskowron``, and
69 ``tonyfast`` who handled a pretty complicated bugs in the input machinery. We
70 had a number of first time contributors and maybe hacktoberfest participant that
71 made significant contributions, and helped us free some time to focus on more
72 complicated bugs.
73
74 You
75 can see all the closed issues and Merged PR, new features and fixes `here
76 <https://github.com/ipython/ipython/issues?utf8=%E2%9C%93&q=+is%3Aclosed+milestone%3A7.1+>`_.
77
5 .. _whatsnew700:
78 .. _whatsnew700:
6
79
7 IPython 7.0.0
80 IPython 7.0.0
8 =============
81 =============
9
82
10 Released Thursday September 27th, 2018
83 Released Thursday September 27th, 2018
11
84
12 IPython 7 include major features improvement as you can read in the following
85 IPython 7 include major features improvement as you can read in the following
13 changelog. This is also the second major version of IPython to support only
86 changelog. This is also the second major version of IPython to support only
14 Python 3 – starting at Python 3.4. Python 2 is still community supported
87 Python 3 – starting at Python 3.4. Python 2 is still community supported
15 on the bugfix only 5.x branch, but we remind you that Python 2 "end of life"
88 on the bugfix only 5.x branch, but we remind you that Python 2 "end of life"
16 is on Jan 1st 2020.
89 is on Jan 1st 2020.
17
90
18 We were able to backport bug fixes to the 5.x branch thanks to our backport bot which
91 We were able to backport bug fixes to the 5.x branch thanks to our backport bot which
19 backported more than `70 Pull-Requests
92 backported more than `70 Pull-Requests
20 <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 manually work, and this is an area of the project were you can easily contribute by looking for `PRs still needed backport <https://github.com/ipython/ipython/issues?q=label%3A%22Still+Needs+Manual+Backport%22+is%3Aclosed+sort%3Aupdated-desc>`_
93 <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 manually work, and this is an area of the project were you can easily contribute by looking for `PRs still needed backport <https://github.com/ipython/ipython/issues?q=label%3A%22Still+Needs+Manual+Backport%22+is%3Aclosed+sort%3Aupdated-desc>`_
21
94
22 IPython 6.x branch will likely not see any further release unless critical
95 IPython 6.x branch will likely not see any further release unless critical
23 bugs are found.
96 bugs are found.
24
97
25 Make sure you have pip > 9.0 before upgrading. You should be able to update by simply running
98 Make sure you have pip > 9.0 before upgrading. You should be able to update by simply running
26
99
27 .. code::
100 .. code::
28
101
29 pip install ipython --upgrade
102 pip install ipython --upgrade
30
103
31 .. only:: ipydev
104 .. only:: ipydev
32
105
33 If you are trying to install or update an ``alpha``, ``beta``, or ``rc``
106 If you are trying to install or update an ``alpha``, ``beta``, or ``rc``
34 version, use pip ``--pre`` flag.
107 version, use pip ``--pre`` flag.
35
108
36 .. code::
109 .. code::
37
110
38 pip install ipython --upgrade --pre
111 pip install ipython --upgrade --pre
39
112
40
113
41 Or if you have conda installed:
114 Or if you have conda installed:
42
115
43 .. code::
116 .. code::
44
117
45 conda install ipython
118 conda install ipython
46
119
47
120
48
121
49 Prompt Toolkit 2.0
122 Prompt Toolkit 2.0
50 ------------------
123 ------------------
51
124
52 IPython 7.0+ now uses ``prompt_toolkit 2.0``, if you still need to use earlier
125 IPython 7.0+ now uses ``prompt_toolkit 2.0``, if you still need to use earlier
53 ``prompt_toolkit`` version you may need to pin IPython to ``<7.0``.
126 ``prompt_toolkit`` version you may need to pin IPython to ``<7.0``.
54
127
55 Autowait: Asynchronous REPL
128 Autowait: Asynchronous REPL
56 ---------------------------
129 ---------------------------
57
130
58 Staring with IPython 7.0 and on Python 3.6+, IPython can automatically await
131 Staring with IPython 7.0 and on Python 3.6+, IPython can automatically await
59 code at top level, you should not need to access an event loop or runner
132 code at top level, you should not need to access an event loop or runner
60 yourself. To know more read the :ref:`autoawait` section of our docs, see
133 yourself. To know more read the :ref:`autoawait` section of our docs, see
61 :ghpull:`11265` or try the following code::
134 :ghpull:`11265` or try the following code::
62
135
63 Python 3.6.0
136 Python 3.6.0
64 Type 'copyright', 'credits' or 'license' for more information
137 Type 'copyright', 'credits' or 'license' for more information
65 IPython 7.0.0 -- An enhanced Interactive Python. Type '?' for help.
138 IPython 7.0.0 -- An enhanced Interactive Python. Type '?' for help.
66
139
67 In [1]: import aiohttp
140 In [1]: import aiohttp
68 ...: result = aiohttp.get('https://api.github.com')
141 ...: result = aiohttp.get('https://api.github.com')
69
142
70 In [2]: response = await result
143 In [2]: response = await result
71 <pause for a few 100s ms>
144 <pause for a few 100s ms>
72
145
73 In [3]: await response.json()
146 In [3]: await response.json()
74 Out[3]:
147 Out[3]:
75 {'authorizations_url': 'https://api.github.com/authorizations',
148 {'authorizations_url': 'https://api.github.com/authorizations',
76 'code_search_url': 'https://api.github.com/search/code?q={query}{&page,per_page,sort,order}',
149 'code_search_url': 'https://api.github.com/search/code?q={query}{&page,per_page,sort,order}',
77 ...
150 ...
78 }
151 }
79
152
80 .. note::
153 .. note::
81
154
82 Async integration is experimental code, behavior may change or be removed
155 Async integration is experimental code, behavior may change or be removed
83 between Python and IPython versions without warnings.
156 between Python and IPython versions without warnings.
84
157
85 Integration is by default with `asyncio`, but other libraries can be configured,
158 Integration is by default with `asyncio`, but other libraries can be configured,
86 like ``curio`` or ``trio``, to improve concurrency in the REPL::
159 like ``curio`` or ``trio``, to improve concurrency in the REPL::
87
160
88 In [1]: %autoawait trio
161 In [1]: %autoawait trio
89
162
90 In [2]: import trio
163 In [2]: import trio
91
164
92 In [3]: async def child(i):
165 In [3]: async def child(i):
93 ...: print(" child %s goes to sleep"%i)
166 ...: print(" child %s goes to sleep"%i)
94 ...: await trio.sleep(2)
167 ...: await trio.sleep(2)
95 ...: print(" child %s wakes up"%i)
168 ...: print(" child %s wakes up"%i)
96
169
97 In [4]: print('parent start')
170 In [4]: print('parent start')
98 ...: async with trio.open_nursery() as n:
171 ...: async with trio.open_nursery() as n:
99 ...: for i in range(3):
172 ...: for i in range(3):
100 ...: n.spawn(child, i)
173 ...: n.spawn(child, i)
101 ...: print('parent end')
174 ...: print('parent end')
102 parent start
175 parent start
103 child 2 goes to sleep
176 child 2 goes to sleep
104 child 0 goes to sleep
177 child 0 goes to sleep
105 child 1 goes to sleep
178 child 1 goes to sleep
106 <about 2 seconds pause>
179 <about 2 seconds pause>
107 child 2 wakes up
180 child 2 wakes up
108 child 1 wakes up
181 child 1 wakes up
109 child 0 wakes up
182 child 0 wakes up
110 parent end
183 parent end
111
184
112 See :ref:`autoawait` for more information.
185 See :ref:`autoawait` for more information.
113
186
114
187
115 Asynchronous code in a Notebook interface or any other frontend using the
188 Asynchronous code in a Notebook interface or any other frontend using the
116 Jupyter Protocol will need further updates of the IPykernel package.
189 Jupyter Protocol will need further updates of the IPykernel package.
117
190
118 Non-Asynchronous code
191 Non-Asynchronous code
119 ~~~~~~~~~~~~~~~~~~~~~
192 ~~~~~~~~~~~~~~~~~~~~~
120
193
121 As the internal API of IPython is now asynchronous, IPython needs to run under
194 As the internal API of IPython is now asynchronous, IPython needs to run under
122 an event loop. In order to allow many workflows, (like using the :magic:`%run`
195 an event loop. In order to allow many workflows, (like using the :magic:`%run`
123 magic, or copy_pasting code that explicitly starts/stop event loop), when
196 magic, or copy_pasting code that explicitly starts/stop event loop), when
124 top-level code is detected as not being asynchronous, IPython code is advanced
197 top-level code is detected as not being asynchronous, IPython code is advanced
125 via a pseudo-synchronous runner, and may not advance pending tasks.
198 via a pseudo-synchronous runner, and may not advance pending tasks.
126
199
127 Change to Nested Embed
200 Change to Nested Embed
128 ~~~~~~~~~~~~~~~~~~~~~~
201 ~~~~~~~~~~~~~~~~~~~~~~
129
202
130 The introduction of the ability to run async code had some effect on the
203 The introduction of the ability to run async code had some effect on the
131 ``IPython.embed()`` API. By default embed will not allow you to run asynchronous
204 ``IPython.embed()`` API. By default embed will not allow you to run asynchronous
132 code unless a event loop is specified.
205 code unless a event loop is specified.
133
206
134 Effects on Magics
207 Effects on Magics
135 ~~~~~~~~~~~~~~~~~
208 ~~~~~~~~~~~~~~~~~
136
209
137 Some magics will not work with Async, and will need updates. Contribution
210 Some magics will not work with Async, and will need updates. Contribution
138 welcome.
211 welcome.
139
212
140 Expected Future changes
213 Expected Future changes
141 ~~~~~~~~~~~~~~~~~~~~~~~
214 ~~~~~~~~~~~~~~~~~~~~~~~
142
215
143 We expect more internal but public IPython function to become ``async``, and
216 We expect more internal but public IPython function to become ``async``, and
144 will likely end up having a persisting event loop while IPython is running.
217 will likely end up having a persisting event loop while IPython is running.
145
218
146 Thanks
219 Thanks
147 ~~~~~~
220 ~~~~~~
148
221
149 This took more than a year in the making, and the code was rebased a number of
222 This took more than a year in the making, and the code was rebased a number of
150 time leading to commit authorship that may have been lost in the final
223 time leading to commit authorship that may have been lost in the final
151 Pull-Request. Huge thanks to many people for contribution, discussion, code,
224 Pull-Request. Huge thanks to many people for contribution, discussion, code,
152 documentation, use-case: dalejung, danielballan, ellisonbg, fperez, gnestor,
225 documentation, use-case: dalejung, danielballan, ellisonbg, fperez, gnestor,
153 minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many others.
226 minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many others.
154
227
155
228
156 Autoreload Improvement
229 Autoreload Improvement
157 ----------------------
230 ----------------------
158
231
159 The magic :magic:`%autoreload 2 <autoreload>` now captures new methods added to
232 The magic :magic:`%autoreload 2 <autoreload>` now captures new methods added to
160 classes. Earlier, only methods existing as of the initial import were being
233 classes. Earlier, only methods existing as of the initial import were being
161 tracked and updated.
234 tracked and updated.
162
235
163 This new feature helps dual environment development - Jupyter+IDE - where the
236 This new feature helps dual environment development - Jupyter+IDE - where the
164 code gradually moves from notebook cells to package files, as it gets
237 code gradually moves from notebook cells to package files, as it gets
165 structured.
238 structured.
166
239
167 **Example**: An instance of the class ``MyClass`` will be able to access the
240 **Example**: An instance of the class ``MyClass`` will be able to access the
168 method ``cube()`` after it is uncommented and the file ``file1.py`` saved on
241 method ``cube()`` after it is uncommented and the file ``file1.py`` saved on
169 disk.
242 disk.
170
243
171
244
172 ..code::
245 ..code::
173
246
174 # notebook
247 # notebook
175
248
176 from mymodule import MyClass
249 from mymodule import MyClass
177 first = MyClass(5)
250 first = MyClass(5)
178
251
179 .. code::
252 .. code::
180
253
181 # mymodule/file1.py
254 # mymodule/file1.py
182
255
183 class MyClass:
256 class MyClass:
184
257
185 def __init__(self, a=10):
258 def __init__(self, a=10):
186 self.a = a
259 self.a = a
187
260
188 def square(self):
261 def square(self):
189 print('compute square')
262 print('compute square')
190 return self.a*self.a
263 return self.a*self.a
191
264
192 # def cube(self):
265 # def cube(self):
193 # print('compute cube')
266 # print('compute cube')
194 # return self.a*self.a*self.a
267 # return self.a*self.a*self.a
195
268
196
269
197
270
198
271
199 Misc
272 Misc
200 ----
273 ----
201
274
202 The autoindent feature that was deprecated in 5.x was re-enabled and
275 The autoindent feature that was deprecated in 5.x was re-enabled and
203 un-deprecated in :ghpull:`11257`
276 un-deprecated in :ghpull:`11257`
204
277
205 Make :magic:`%run -n -i ... <run>` work correctly. Earlier, if :magic:`%run` was
278 Make :magic:`%run -n -i ... <run>` work correctly. Earlier, if :magic:`%run` was
206 passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308`
279 passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308`
207
280
208
281
209 The :cellmagic:`%%script`` (as well as :cellmagic:`%%bash``,
282 The :cellmagic:`%%script`` (as well as :cellmagic:`%%bash``,
210 :cellmagic:`%%ruby``... ) cell magics now raise by default if the return code of
283 :cellmagic:`%%ruby``... ) cell magics now raise by default if the return code of
211 the given code is non-zero (thus halting execution of further cells in a
284 the given code is non-zero (thus halting execution of further cells in a
212 notebook). The behavior can be disable by passing the ``--no-raise-error`` flag.
285 notebook). The behavior can be disable by passing the ``--no-raise-error`` flag.
213
286
214
287
215 Deprecations
288 Deprecations
216 ------------
289 ------------
217
290
218 A couple of unused function and methods have been deprecated and will be removed
291 A couple of unused function and methods have been deprecated and will be removed
219 in future versions:
292 in future versions:
220
293
221 - ``IPython.utils.io.raw_print_err``
294 - ``IPython.utils.io.raw_print_err``
222 - ``IPython.utils.io.raw_print``
295 - ``IPython.utils.io.raw_print``
223
296
224
297
225 Backwards incompatible changes
298 Backwards incompatible changes
226 ------------------------------
299 ------------------------------
227
300
228 * The API for transforming input before it is parsed as Python code has been
301 * The API for transforming input before it is parsed as Python code has been
229 completely redesigned, and any custom input transformations will need to be
302 completely redesigned, and any custom input transformations will need to be
230 rewritten. See :doc:`/config/inputtransforms` for details of the new API.
303 rewritten. See :doc:`/config/inputtransforms` for details of the new API.
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