##// END OF EJS Templates
Update what's new for 7.1.0
Matthias Bussonnier -
Show More
@@ -1,230 +1,303 b''
1 1 ============
2 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 78 .. _whatsnew700:
6 79
7 80 IPython 7.0.0
8 81 =============
9 82
10 83 Released Thursday September 27th, 2018
11 84
12 85 IPython 7 include major features improvement as you can read in the following
13 86 changelog. This is also the second major version of IPython to support only
14 87 Python 3 – starting at Python 3.4. Python 2 is still community supported
15 88 on the bugfix only 5.x branch, but we remind you that Python 2 "end of life"
16 89 is on Jan 1st 2020.
17 90
18 91 We were able to backport bug fixes to the 5.x branch thanks to our backport bot which
19 92 backported more than `70 Pull-Requests
20 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 95 IPython 6.x branch will likely not see any further release unless critical
23 96 bugs are found.
24 97
25 98 Make sure you have pip > 9.0 before upgrading. You should be able to update by simply running
26 99
27 100 .. code::
28 101
29 102 pip install ipython --upgrade
30 103
31 104 .. only:: ipydev
32 105
33 106 If you are trying to install or update an ``alpha``, ``beta``, or ``rc``
34 107 version, use pip ``--pre`` flag.
35 108
36 109 .. code::
37 110
38 111 pip install ipython --upgrade --pre
39 112
40 113
41 114 Or if you have conda installed:
42 115
43 116 .. code::
44 117
45 118 conda install ipython
46 119
47 120
48 121
49 122 Prompt Toolkit 2.0
50 123 ------------------
51 124
52 125 IPython 7.0+ now uses ``prompt_toolkit 2.0``, if you still need to use earlier
53 126 ``prompt_toolkit`` version you may need to pin IPython to ``<7.0``.
54 127
55 128 Autowait: Asynchronous REPL
56 129 ---------------------------
57 130
58 131 Staring with IPython 7.0 and on Python 3.6+, IPython can automatically await
59 132 code at top level, you should not need to access an event loop or runner
60 133 yourself. To know more read the :ref:`autoawait` section of our docs, see
61 134 :ghpull:`11265` or try the following code::
62 135
63 136 Python 3.6.0
64 137 Type 'copyright', 'credits' or 'license' for more information
65 138 IPython 7.0.0 -- An enhanced Interactive Python. Type '?' for help.
66 139
67 140 In [1]: import aiohttp
68 141 ...: result = aiohttp.get('https://api.github.com')
69 142
70 143 In [2]: response = await result
71 144 <pause for a few 100s ms>
72 145
73 146 In [3]: await response.json()
74 147 Out[3]:
75 148 {'authorizations_url': 'https://api.github.com/authorizations',
76 149 'code_search_url': 'https://api.github.com/search/code?q={query}{&page,per_page,sort,order}',
77 150 ...
78 151 }
79 152
80 153 .. note::
81 154
82 155 Async integration is experimental code, behavior may change or be removed
83 156 between Python and IPython versions without warnings.
84 157
85 158 Integration is by default with `asyncio`, but other libraries can be configured,
86 159 like ``curio`` or ``trio``, to improve concurrency in the REPL::
87 160
88 161 In [1]: %autoawait trio
89 162
90 163 In [2]: import trio
91 164
92 165 In [3]: async def child(i):
93 166 ...: print(" child %s goes to sleep"%i)
94 167 ...: await trio.sleep(2)
95 168 ...: print(" child %s wakes up"%i)
96 169
97 170 In [4]: print('parent start')
98 171 ...: async with trio.open_nursery() as n:
99 172 ...: for i in range(3):
100 173 ...: n.spawn(child, i)
101 174 ...: print('parent end')
102 175 parent start
103 176 child 2 goes to sleep
104 177 child 0 goes to sleep
105 178 child 1 goes to sleep
106 179 <about 2 seconds pause>
107 180 child 2 wakes up
108 181 child 1 wakes up
109 182 child 0 wakes up
110 183 parent end
111 184
112 185 See :ref:`autoawait` for more information.
113 186
114 187
115 188 Asynchronous code in a Notebook interface or any other frontend using the
116 189 Jupyter Protocol will need further updates of the IPykernel package.
117 190
118 191 Non-Asynchronous code
119 192 ~~~~~~~~~~~~~~~~~~~~~
120 193
121 194 As the internal API of IPython is now asynchronous, IPython needs to run under
122 195 an event loop. In order to allow many workflows, (like using the :magic:`%run`
123 196 magic, or copy_pasting code that explicitly starts/stop event loop), when
124 197 top-level code is detected as not being asynchronous, IPython code is advanced
125 198 via a pseudo-synchronous runner, and may not advance pending tasks.
126 199
127 200 Change to Nested Embed
128 201 ~~~~~~~~~~~~~~~~~~~~~~
129 202
130 203 The introduction of the ability to run async code had some effect on the
131 204 ``IPython.embed()`` API. By default embed will not allow you to run asynchronous
132 205 code unless a event loop is specified.
133 206
134 207 Effects on Magics
135 208 ~~~~~~~~~~~~~~~~~
136 209
137 210 Some magics will not work with Async, and will need updates. Contribution
138 211 welcome.
139 212
140 213 Expected Future changes
141 214 ~~~~~~~~~~~~~~~~~~~~~~~
142 215
143 216 We expect more internal but public IPython function to become ``async``, and
144 217 will likely end up having a persisting event loop while IPython is running.
145 218
146 219 Thanks
147 220 ~~~~~~
148 221
149 222 This took more than a year in the making, and the code was rebased a number of
150 223 time leading to commit authorship that may have been lost in the final
151 224 Pull-Request. Huge thanks to many people for contribution, discussion, code,
152 225 documentation, use-case: dalejung, danielballan, ellisonbg, fperez, gnestor,
153 226 minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many others.
154 227
155 228
156 229 Autoreload Improvement
157 230 ----------------------
158 231
159 232 The magic :magic:`%autoreload 2 <autoreload>` now captures new methods added to
160 233 classes. Earlier, only methods existing as of the initial import were being
161 234 tracked and updated.
162 235
163 236 This new feature helps dual environment development - Jupyter+IDE - where the
164 237 code gradually moves from notebook cells to package files, as it gets
165 238 structured.
166 239
167 240 **Example**: An instance of the class ``MyClass`` will be able to access the
168 241 method ``cube()`` after it is uncommented and the file ``file1.py`` saved on
169 242 disk.
170 243
171 244
172 245 ..code::
173 246
174 247 # notebook
175 248
176 249 from mymodule import MyClass
177 250 first = MyClass(5)
178 251
179 252 .. code::
180 253
181 254 # mymodule/file1.py
182 255
183 256 class MyClass:
184 257
185 258 def __init__(self, a=10):
186 259 self.a = a
187 260
188 261 def square(self):
189 262 print('compute square')
190 263 return self.a*self.a
191 264
192 265 # def cube(self):
193 266 # print('compute cube')
194 267 # return self.a*self.a*self.a
195 268
196 269
197 270
198 271
199 272 Misc
200 273 ----
201 274
202 275 The autoindent feature that was deprecated in 5.x was re-enabled and
203 276 un-deprecated in :ghpull:`11257`
204 277
205 278 Make :magic:`%run -n -i ... <run>` work correctly. Earlier, if :magic:`%run` was
206 279 passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308`
207 280
208 281
209 282 The :cellmagic:`%%script`` (as well as :cellmagic:`%%bash``,
210 283 :cellmagic:`%%ruby``... ) cell magics now raise by default if the return code of
211 284 the given code is non-zero (thus halting execution of further cells in a
212 285 notebook). The behavior can be disable by passing the ``--no-raise-error`` flag.
213 286
214 287
215 288 Deprecations
216 289 ------------
217 290
218 291 A couple of unused function and methods have been deprecated and will be removed
219 292 in future versions:
220 293
221 294 - ``IPython.utils.io.raw_print_err``
222 295 - ``IPython.utils.io.raw_print``
223 296
224 297
225 298 Backwards incompatible changes
226 299 ------------------------------
227 300
228 301 * The API for transforming input before it is parsed as Python code has been
229 302 completely redesigned, and any custom input transformations will need to be
230 303 rewritten. See :doc:`/config/inputtransforms` for details of the new API.
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now