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