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