##// END OF EJS Templates
update release process
Matthias Bussonnier -
Show More
@@ -1,321 +1,322 b''
1 .. _core_developer_guide:
1 .. _core_developer_guide:
2
2
3 =================================
3 =================================
4 Guide for IPython core Developers
4 Guide for IPython core Developers
5 =================================
5 =================================
6
6
7 This guide documents the development of IPython itself. Alternatively,
7 This guide documents the development of IPython itself. Alternatively,
8 developers of third party tools and libraries that use IPython should see the
8 developers of third party tools and libraries that use IPython should see the
9 :doc:`../development/index`.
9 :doc:`../development/index`.
10
10
11
11
12 For instructions on how to make a developer install see :ref:`devinstall`.
12 For instructions on how to make a developer install see :ref:`devinstall`.
13
13
14 Backporting Pull requests
14 Backporting Pull requests
15 -------------------------
15 -------------------------
16
16
17 All pull requests should usually be made against ``master``, if a Pull Request
17 All pull requests should usually be made against ``master``, if a Pull Request
18 need to be backported to an earlier release; then it should be tagged with the
18 need to be backported to an earlier release; then it should be tagged with the
19 correct ``milestone``.
19 correct ``milestone``.
20
20
21 If you tag a pull request with a milestone **before** merging the pull request,
21 If you tag a pull request with a milestone **before** merging the pull request,
22 and the base ref is `master`, then our backport bot should automatically create
22 and the base ref is ``master``, then our backport bot should automatically create
23 a corresponding pull-request that backport on the correct branch.
23 a corresponding pull-request that backport on the correct branch.
24
24
25 If you are an admin on the IPython repository you can also just mention the
25 If you have write access to the IPython repository you can also just mention the
26 **backport bot** to do the work for you. The bot is evolving so instructions may
26 **backport bot** to do the work for you. The bot is evolving so instructions may
27 be different. At the time of this writing you can use::
27 be different. At the time of this writing you can use::
28
28
29 @meeseeksdev[bot] backport [to <branchname>]
29 @meeseeksdev[bot] backport [to] <branchname>
30
30
31 The bot will attempt to backport the current pull-request and issue a PR if
31 The bot will attempt to backport the current pull-request and issue a PR if
32 possible. If the milestone is set on the issue you can omit the branch to
32 possible.
33 backport to.
34
33
35 .. note::
34 .. note::
36
35
37 The ``@`` and ``[bot]`` when mentioning the bot should be optional and can
36 The ``@`` and ``[bot]`` when mentioning the bot should be optional and can
38 be omitted.
37 be omitted.
39
38
40 If the pull request cannot be automatically backported, the bot should tell you
39 If the pull request cannot be automatically backported, the bot should tell you
41 so on the PR and apply a "Need manual backport" tag to the origin PR.
40 so on the PR and apply a "Need manual backport" tag to the origin PR.
42
41
43
42
44 Backport with ghpro
43 Backport with ghpro
45 -------------------
44 -------------------
46
45
47 We can also use `ghpro <https://pypi.python.org/pypi/ghpro>`_
46 We can also use `ghpro <https://pypi.python.org/pypi/ghpro>`_
48 to automatically list and apply the PR on other branches. For example:
47 to automatically list and apply the PR on other branches. For example:
49
48
50 .. code-block:: bash
49 .. code-block:: bash
51
50
52 $ backport-pr todo --milestone 5.2
51 $ backport-pr todo --milestone 5.2
53 [...snip..]
52 [...snip..]
54 The following PRs have been backported
53 The following PRs have been backported
55 9848
54 9848
56 9851
55 9851
57 9953
56 9953
58 9955
57 9955
59 The following PRs should be backported:
58 The following PRs should be backported:
60 9417
59 9417
61 9863
60 9863
62 9925
61 9925
63 9947
62 9947
64
63
65 $ backport-pr apply 5.x 9947
64 $ backport-pr apply 5.x 9947
66 [...snip...]
65 [...snip...]
67
66
68
67
69 .. _release_process:
68 .. _release_process:
70
69
71 =======================
70 =======================
72 IPython release process
71 IPython release process
73 =======================
72 =======================
74
73
75 This document contains the process that is used to create an IPython release.
74 This document contains the process that is used to create an IPython release.
76
75
77 Conveniently, the ``release`` script in the ``tools`` directory of the ``IPython``
76 Conveniently, the ``release`` script in the ``tools`` directory of the ``IPython``
78 repository automates most of the release process. This document serves as a
77 repository automates most of the release process. This document serves as a
79 handy reminder and checklist for the release manager.
78 handy reminder and checklist for the release manager.
80
79
81 During the release process, you might need the extra following dependencies:
80 During the release process, you might need the extra following dependencies:
82
81
83 - ``keyring`` to access your GitHub authentication tokens
82 - ``keyring`` to access your GitHub authentication tokens
84 - ``graphviz`` to generate some graphs in the documentation
83 - ``graphviz`` to generate some graphs in the documentation
85 - ``ghpro`` to generate the stats
84 - ``ghpro`` to generate the stats
86
85
87 Make sure you have all the required dependencies to run the tests as well.
86 Make sure you have all the required dependencies to run the tests as well.
88
87
89
88
90 1. Set Environment variables
89 1. Set Environment variables
91 ----------------------------
90 ----------------------------
92
91
93 Set environment variables to document previous release tag, current
92 Set environment variables to document previous release tag, current
94 release milestone, current release version, and git tag.
93 release milestone, current release version, and git tag.
95
94
96 These variables may be used later to copy/paste as answers to the script
95 These variables may be used later to copy/paste as answers to the script
97 questions instead of typing the appropriate command when the time comes. These
96 questions instead of typing the appropriate command when the time comes. These
98 variables are not used by the scripts directly; therefore, there is no need to
97 variables are not used by the scripts directly; therefore, there is no need to
99 ``export`` them. The format for bash is as follows, but note that these values
98 ``export`` them. The format for bash is as follows, but note that these values
100 are just an example valid only for the 5.0 release; you'll need to update them
99 are just an example valid only for the 5.0 release; you'll need to update them
101 for the release you are actually making::
100 for the release you are actually making::
102
101
103 PREV_RELEASE=4.2.1
102 PREV_RELEASE=4.2.1
104 MILESTONE=5.0
103 MILESTONE=5.0
105 VERSION=5.0.0
104 VERSION=5.0.0
106 BRANCH=master
105 BRANCH=master
107
106
108
107
109 2. Create GitHub stats and finish release note
108 2. Create GitHub stats and finish release note
110 ----------------------------------------------
109 ----------------------------------------------
111
110
112 .. note::
111 .. note::
113
112
114 This step is optional if making a Beta or RC release.
113 This step is optional if making a Beta or RC release.
115
114
116 .. note::
115 .. note::
117
116
118 Before generating the GitHub stats, verify that all closed issues and pull
117 Before generating the GitHub stats, verify that all closed issues and pull
119 requests have `appropriate milestones
118 requests have `appropriate milestones
120 <https://github.com/ipython/ipython/wiki/Dev:-GitHub-workflow#milestones>`_.
119 <https://github.com/ipython/ipython/wiki/Dev:-GitHub-workflow#milestones>`_.
121 `This search
120 `This search
122 <https://github.com/ipython/ipython/issues?q=is%3Aclosed+no%3Amilestone+is%3Aissue>`_
121 <https://github.com/ipython/ipython/issues?q=is%3Aclosed+no%3Amilestone+is%3Aissue>`_
123 should return no results before creating the GitHub stats.
122 should return no results before creating the GitHub stats.
124
123
125 If a major release:
124 If a major release:
126
125
127 - merge any pull request notes into what's new::
126 - merge any pull request notes into what's new::
128
127
129 python tools/update_whatsnew.py
128 python tools/update_whatsnew.py
130
129
131 - update ``docs/source/whatsnew/development.rst``, to ensure it covers
130 - update ``docs/source/whatsnew/development.rst``, to ensure it covers
132 the major release features
131 the major release features
133
132
134 - move the contents of ``development.rst`` to ``versionX.rst`` where ``X`` is
133 - move the contents of ``development.rst`` to ``versionX.rst`` where ``X`` is
135 the numerical release version
134 the numerical release version
136
135
137 - generate summary of GitHub contributions, which can be done with::
136 - generate summary of GitHub contributions, which can be done with::
138
137
139 python tools/github_stats.py --milestone $MILESTONE > stats.rst
138 python tools/github_stats.py --milestone $MILESTONE > stats.rst
140
139
141 which may need some manual cleanup of ``stats.rst``. Add the cleaned
140 which may need some manual cleanup of ``stats.rst``. Add the cleaned
142 ``stats.rst`` results to ``docs/source/whatsnew/github-stats-X.rst``
141 ``stats.rst`` results to ``docs/source/whatsnew/github-stats-X.rst``
143 where ``X`` is the numerical release version (don't forget to add it to
142 where ``X`` is the numerical release version (don't forget to add it to
144 the git repository as well). If creating a major release, make a new
143 the git repository as well). If creating a major release, make a new
145 ``github-stats-X.rst`` file; if creating a minor release, the content
144 ``github-stats-X.rst`` file; if creating a minor release, the content
146 from ``stats.rst`` may simply be added to the top of an existing
145 from ``stats.rst`` may simply be added to the top of an existing
147 ``github-stats-X.rst`` file.
146 ``github-stats-X.rst`` file.
148
147
149 - Edit ``docs/source/whatsnew/index.rst`` to list the new ``github-stats-X``
148 - Edit ``docs/source/whatsnew/index.rst`` to list the new ``github-stats-X``
150 file you just created.
149 file you just created.
151
150
152 - Remove temporarily the first entry called ``development`` (you'll need to
151 - You do not need to temporarily remove the first entry called
153 add it back after release).
152 ``development``, nor re-add it after the release, it will automatically be
153 hidden when releasing a stable version of IPython (if ``_version_extra``
154 in ``release.py`` is an empty string.
154
155
155 Make sure that the stats file has a header or it won't be rendered in
156 Make sure that the stats file has a header or it won't be rendered in
156 the final documentation.
157 the final documentation.
157
158
158 To find duplicates and update `.mailmap`, use::
159 To find duplicates and update `.mailmap`, use::
159
160
160 git log --format="%aN <%aE>" $PREV_RELEASE... | sort -u -f
161 git log --format="%aN <%aE>" $PREV_RELEASE... | sort -u -f
161
162
162 If a minor release you might need to do some of the above points manually, and
163 If a minor release you might need to do some of the above points manually, and
163 forward port the changes.
164 forward port the changes.
164
165
165 3. Make sure the repository is clean
166 3. Make sure the repository is clean
166 ------------------------------------
167 ------------------------------------
167
168
168 of any file that could be problematic.
169 of any file that could be problematic.
169 Remove all non-tracked files with:
170 Remove all non-tracked files with:
170
171
171 .. code::
172 .. code::
172
173
173 git clean -xfdi
174 git clean -xfdi
174
175
175 This will ask for confirmation before removing all untracked files. Make
176 This will ask for confirmation before removing all untracked files. Make
176 sure the ``dist/`` folder is clean to avoid any stale builds from
177 sure the ``dist/`` folder is clean to avoid any stale builds from
177 previous build attempts.
178 previous build attempts.
178
179
179
180
180 4. Update the release version number
181 4. Update the release version number
181 ------------------------------------
182 ------------------------------------
182
183
183 Edit ``IPython/core/release.py`` to have the current version.
184 Edit ``IPython/core/release.py`` to have the current version.
184
185
185 in particular, update version number and ``_version_extra`` content in
186 in particular, update version number and ``_version_extra`` content in
186 ``IPython/core/release.py``.
187 ``IPython/core/release.py``.
187
188
188 Step 5 will validate your changes automatically, but you might still want to
189 Step 5 will validate your changes automatically, but you might still want to
189 make sure the version number matches pep440.
190 make sure the version number matches pep440.
190
191
191 In particular, ``rc`` and ``beta`` are not separated by ``.`` or the ``sdist``
192 In particular, ``rc`` and ``beta`` are not separated by ``.`` or the ``sdist``
192 and ``bdist`` will appear as different releases. For example, a valid version
193 and ``bdist`` will appear as different releases. For example, a valid version
193 number for a release candidate (rc) release is: ``1.3rc1``. Notice that there
194 number for a release candidate (rc) release is: ``1.3rc1``. Notice that there
194 is no separator between the '3' and the 'r'. Check the environment variable
195 is no separator between the '3' and the 'r'. Check the environment variable
195 ``$VERSION`` as well.
196 ``$VERSION`` as well.
196
197
197 You will likely just have to modify/comment/uncomment one of the lines setting
198 You will likely just have to modify/comment/uncomment one of the lines setting
198 ``_version_extra``
199 ``_version_extra``
199
200
200
201
201 5. Run the `tools/build_release` script
202 5. Run the `tools/build_release` script
202 ---------------------------------------
203 ---------------------------------------
203
204
204 Running ``tools/build_release`` does all the file checking and building that
205 Running ``tools/build_release`` does all the file checking and building that
205 the real release script will do. This makes test installations, checks that
206 the real release script will do. This makes test installations, checks that
206 the build procedure runs OK, and tests other steps in the release process.
207 the build procedure runs OK, and tests other steps in the release process.
207
208
208 The ``build_release`` script will in particular verify that the version number
209 The ``build_release`` script will in particular verify that the version number
209 match PEP 440, in order to avoid surprise at the time of build upload.
210 match PEP 440, in order to avoid surprise at the time of build upload.
210
211
211 We encourage creating a test build of the docs as well.
212 We encourage creating a test build of the docs as well.
212
213
213 6. Create and push the new tag
214 6. Create and push the new tag
214 ------------------------------
215 ------------------------------
215
216
216 Commit the changes to release.py::
217 Commit the changes to release.py::
217
218
218 git commit -am "release $VERSION"
219 git commit -am "release $VERSION"
219 git push origin $BRANCH
220 git push origin $BRANCH
220
221
221 Create and push the tag::
222 Create and push the tag::
222
223
223 git tag -am "release $VERSION" "$VERSION"
224 git tag -am "release $VERSION" "$VERSION"
224 git push origin --tags
225 git push origin --tags
225
226
226 Update release.py back to ``x.y-dev`` or ``x.y-maint``, and re-add the
227 Update release.py back to ``x.y-dev`` or ``x.y-maint``, and re-add the
227 ``development`` entry in ``docs/source/whatsnew/index.rst`` and push::
228 ``development`` entry in ``docs/source/whatsnew/index.rst`` and push::
228
229
229 git commit -am "back to development"
230 git commit -am "back to development"
230 git push origin $BRANCH
231 git push origin $BRANCH
231
232
232 Now checkout the tag we just made::
233 Now checkout the tag we just made::
233
234
234 git checkout $VERSION
235 git checkout $VERSION
235
236
236 7. Run the release script
237 7. Run the release script
237 -------------------------
238 -------------------------
238
239
239 Run the ``release`` script, this step requires having a current wheel, Python
240 Run the ``release`` script, this step requires having a current wheel, Python
240 >=3.4 and Python 2.7.::
241 >=3.4 and Python 2.7.::
241
242
242 ./tools/release
243 ./tools/release
243
244
244 This makes the tarballs and wheels, and puts them under the ``dist/``
245 This makes the tarballs and wheels, and puts them under the ``dist/``
245 folder. Be sure to test the ``wheels`` and the ``sdist`` locally before
246 folder. Be sure to test the ``wheels`` and the ``sdist`` locally before
246 uploading them to PyPI. We do not use an universal wheel as each wheel
247 uploading them to PyPI. We do not use an universal wheel as each wheel
247 installs an ``ipython2`` or ``ipython3`` script, depending on the version of
248 installs an ``ipython2`` or ``ipython3`` script, depending on the version of
248 Python it is built for. Using an universal wheel would prevent this.
249 Python it is built for. Using an universal wheel would prevent this.
249
250
250 Use the following to actually upload the result of the build::
251 Use the following to actually upload the result of the build::
251
252
252 ./tools/release upload
253 ./tools/release upload
253
254
254 It should posts them to ``archive.ipython.org`` and to PyPI.
255 It should posts them to ``archive.ipython.org`` and to PyPI.
255
256
256 PyPI/Warehouse will automatically hide previous releases. If you are uploading
257 PyPI/Warehouse will automatically hide previous releases. If you are uploading
257 a non-stable version, make sure to log-in to PyPI and un-hide previous version.
258 a non-stable version, make sure to log-in to PyPI and un-hide previous version.
258
259
259
260
260 8. Draft a short release announcement
261 8. Draft a short release announcement
261 -------------------------------------
262 -------------------------------------
262
263
263 The announcement should include:
264 The announcement should include:
264
265
265 - release highlights
266 - release highlights
266 - a link to the html version of the *What's new* section of the documentation
267 - a link to the html version of the *What's new* section of the documentation
267 - a link to upgrade or installation tips (if necessary)
268 - a link to upgrade or installation tips (if necessary)
268
269
269 Post the announcement to the mailing list and or blog, and link from Twitter.
270 Post the announcement to the mailing list and or blog, and link from Twitter.
270
271
271 .. note::
272 .. note::
272
273
273 If you are doing a RC or Beta, you can likely skip the next steps.
274 If you are doing a RC or Beta, you can likely skip the next steps.
274
275
275 9. Update milestones on GitHub
276 9. Update milestones on GitHub
276 -------------------------------
277 -------------------------------
277
278
278 These steps will bring milestones up to date:
279 These steps will bring milestones up to date:
279
280
280 - close the just released milestone
281 - close the just released milestone
281 - open a new milestone for the next release (x, y+1), if the milestone doesn't
282 - open a new milestone for the next release (x, y+1), if the milestone doesn't
282 exist already
283 exist already
283
284
284 10. Update the IPython website
285 10. Update the IPython website
285 ------------------------------
286 ------------------------------
286
287
287 The IPython website should document the new release:
288 The IPython website should document the new release:
288
289
289 - add release announcement (news, announcements)
290 - add release announcement (news, announcements)
290 - update current version and download links
291 - update current version and download links
291 - update links on the documentation page (especially if a major release)
292 - update links on the documentation page (especially if a major release)
292
293
293 11. Update readthedocs
294 11. Update readthedocs
294 ----------------------
295 ----------------------
295
296
296 Make sure to update readthedocs and set the latest tag as stable, as well as
297 Make sure to update readthedocs and set the latest tag as stable, as well as
297 checking that previous release is still building under its own tag.
298 checking that previous release is still building under its own tag.
298
299
299 12. Update the Conda-Forge feedstock
300 12. Update the Conda-Forge feedstock
300 ------------------------------------
301 ------------------------------------
301
302
302 Follow the instructions on `the repository <https://github.com/conda-forge/ipython-feedstock>`_
303 Follow the instructions on `the repository <https://github.com/conda-forge/ipython-feedstock>`_
303
304
304 13. Celebrate!
305 13. Celebrate!
305 --------------
306 --------------
306
307
307 Celebrate the release and please thank the contributors for their work. Great
308 Celebrate the release and please thank the contributors for their work. Great
308 job!
309 job!
309
310
310
311
311
312
312 Old Documentation
313 Old Documentation
313 =================
314 =================
314
315
315 Out of date documentation is still available and have been kept for archival purposes.
316 Out of date documentation is still available and have been kept for archival purposes.
316
317
317 .. note::
318 .. note::
318
319
319 Developers documentation used to be on the IPython wiki, but are now out of
320 Developers documentation used to be on the IPython wiki, but are now out of
320 date. The wiki is though still available for historical reasons: `Old IPython
321 date. The wiki is though still available for historical reasons: `Old IPython
321 GitHub Wiki. <https://github.com/ipython/ipython/wiki/Dev:-Index>`_
322 GitHub Wiki. <https://github.com/ipython/ipython/wiki/Dev:-Index>`_
@@ -1,46 +1,62 b''
1 .. Developers should add in this file, during each release cycle, information
1 .. Developers should add in this file, during each release cycle, information
2 .. about important changes they've made, in a summary format that's meant for
2 .. about important changes they've made, in a summary format that's meant for
3 .. end users. For each release we normally have three sections: features, bug
3 .. end users. For each release we normally have three sections: features, bug
4 .. fixes and api breakage.
4 .. fixes and api breakage.
5 .. Please remember to credit the authors of the contributions by name,
5 .. Please remember to credit the authors of the contributions by name,
6 .. especially when they are new users or developers who do not regularly
6 .. especially when they are new users or developers who do not regularly
7 .. participate in IPython's development.
7 .. participate in IPython's development.
8
8
9 .. _whatsnew_index:
9 .. _whatsnew_index:
10
10
11 =====================
11 =====================
12 What's new in IPython
12 What's new in IPython
13 =====================
13 =====================
14
14
15 .. this will appear in the docs if we are nto releasing a versin (ie is
16 .. _version_extra in release.py is empty stringA
17
18 .. only:: ipydev
19
20 Developpement version in-progress features:
21
22 .. toctree::
23 development
24
25 .. this make a hidden toctree that avoid sphinx to complain about documents
26 .. included nowhere when building docs for stable
27 .. only:: ipystable
28 .. toctree::
29 :hidden:
30 development
31
15 This section documents the changes that have been made in various versions of
32 This section documents the changes that have been made in various versions of
16 IPython. Users should consult these pages to learn about new features, bug
33 IPython. Users should consult these pages to learn about new features, bug
17 fixes and backwards incompatibilities. Developers should summarize the
34 fixes and backwards incompatibilities. Developers should summarize the
18 development work they do here in a user friendly format.
35 development work they do here in a user friendly format.
19
36
20 .. toctree::
37 .. toctree::
21 :maxdepth: 1
38 :maxdepth: 1
22
39
23 development
24 version7
40 version7
25 version6
41 version6
26 github-stats-6
42 github-stats-6
27 version5
43 version5
28 github-stats-5
44 github-stats-5
29 version4
45 version4
30 github-stats-4
46 github-stats-4
31 version3
47 version3
32 github-stats-3
48 github-stats-3
33 version3_widget_migration
49 version3_widget_migration
34 version2.0
50 version2.0
35 github-stats-2.0
51 github-stats-2.0
36 version1.0
52 version1.0
37 github-stats-1.0
53 github-stats-1.0
38 version0.13
54 version0.13
39 github-stats-0.13
55 github-stats-0.13
40 version0.12
56 version0.12
41 github-stats-0.12
57 github-stats-0.12
42 version0.11
58 version0.11
43 github-stats-0.11
59 github-stats-0.11
44 version0.10
60 version0.10
45 version0.9
61 version0.9
46 version0.8
62 version0.8
@@ -1,214 +1,215 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, Feedback on API/changes and
12 IPython 7.0 is currently in Beta, Feedback on API/changes and
13 addition/updates to this cahngelog are welcomed.
13 addition/updates to this cahngelog are welcomed.
14
14
15 Released .... ...., 2017
15 Released .... ...., 2017
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 stop support only
18 changelog. This is also the second major version of IPython to stop support only
19 Python 3 – starting at Python 3.4. Python 2 is still still community supported
19 Python 3 – starting at Python 3.4. Python 2 is still still community supported
20 on the bugfix only 5.x branch, but we remind you that Python 2 EOL is Jan 1st
20 on the bugfix only 5.x branch, but we remind you that Python 2 EOL is Jan 1st
21 2020.
21 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 we critical
27 IPython 6.x branch will likely not see any further release unless we 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 runngin
30 Make sure you have pip > 9.0 before upgrading. You should be able to update by simply runngin
31
31
32 .. code::
32 .. code::
33
33
34 pip install ipython --upgrade
34 pip install ipython --upgrade
35
35
36 Or if you have conda installed:
36 Or if you have conda installed:
37
37
38 .. code::
38 .. code::
39
39
40 conda install ipython
40 conda install ipython
41
41
42
42
43
43
44 Prompt Toolkit 2.0
44 Prompt Toolkit 2.0
45 ------------------
45 ------------------
46
46
47 IPython 7.0+ now use ``prompt_toolkit 2.0``, if you still need to use earlier
47 IPython 7.0+ now use ``prompt_toolkit 2.0``, if you still need to use earlier
48 ``prompt_toolkit`` version you may need to pin IPython to ``<7.0``.
48 ``prompt_toolkit`` version you may need to pin IPython to ``<7.0``.
49
49
50 Autowait: Asynchronous REPL
50 Autowait: Asynchronous REPL
51 ---------------------------
51 ---------------------------
52
52
53 Staring with IPython 7.0 and on Python 3.6+, IPython can automatically await
53 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
54 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
55 yourself. To know more read the :ref:`autoawait` section of our docs, see
56 :ghpull:`11265` or try the following code::
56 :ghpull:`11265` or try the following code::
57
57
58 Python 3.6.0
58 Python 3.6.0
59 Type 'copyright', 'credits' or 'license' for more information
59 Type 'copyright', 'credits' or 'license' for more information
60 IPython 7.0.0 -- An enhanced Interactive Python. Type '?' for help.
60 IPython 7.0.0 -- An enhanced Interactive Python. Type '?' for help.
61
61
62 In [1]: import aiohttp
62 In [1]: import aiohttp
63 ...: result = aiohttp.get('https://api.github.com')
63 ...: result = aiohttp.get('https://api.github.com')
64
64
65 In [2]: response = await result
65 In [2]: response = await result
66 <pause for a few 100s ms>
66 <pause for a few 100s ms>
67
67
68 In [3]: await response.json()
68 In [3]: await response.json()
69 Out[3]:
69 Out[3]:
70 {'authorizations_url': 'https://api.github.com/authorizations',
70 {'authorizations_url': 'https://api.github.com/authorizations',
71 'code_search_url': 'https://api.github.com/search/code?q={query}{&page,per_page,sort,order}',
71 'code_search_url': 'https://api.github.com/search/code?q={query}{&page,per_page,sort,order}',
72 ...
72 ...
73 }
73 }
74
74
75 .. note::
75 .. note::
76
76
77 Async integration is experimental code, behavior may change or be removed
77 Async integration is experimental code, behavior may change or be removed
78 between Python and IPython versions without warnings.
78 between Python and IPython versions without warnings.
79
79
80 Integration is by default with `asyncio`, but other libraries can be configured,
80 Integration is by default with `asyncio`, but other libraries can be configured,
81 like ``curio`` or ``trio``, to improve concurrency in the REPL::
81 like ``curio`` or ``trio``, to improve concurrency in the REPL::
82
82
83 In [1]: %autoawait trio
83 In [1]: %autoawait trio
84
84
85 In [2]: import trio
85 In [2]: import trio
86
86
87 In [3]: async def child(i):
87 In [3]: async def child(i):
88 ...: print(" child %s goes to sleep"%i)
88 ...: print(" child %s goes to sleep"%i)
89 ...: await trio.sleep(2)
89 ...: await trio.sleep(2)
90 ...: print(" child %s wakes up"%i)
90 ...: print(" child %s wakes up"%i)
91
91
92 In [4]: print('parent start')
92 In [4]: print('parent start')
93 ...: async with trio.open_nursery() as n:
93 ...: async with trio.open_nursery() as n:
94 ...: for i in range(3):
94 ...: for i in range(3):
95 ...: n.spawn(child, i)
95 ...: n.spawn(child, i)
96 ...: print('parent end')
96 ...: print('parent end')
97 parent start
97 parent start
98 child 2 goes to sleep
98 child 2 goes to sleep
99 child 0 goes to sleep
99 child 0 goes to sleep
100 child 1 goes to sleep
100 child 1 goes to sleep
101 <about 2 seconds pause>
101 <about 2 seconds pause>
102 child 2 wakes up
102 child 2 wakes up
103 child 1 wakes up
103 child 1 wakes up
104 child 0 wakes up
104 child 0 wakes up
105 parent end
105 parent end
106
106
107 See :ref:`autoawait` for more information.
107 See :ref:`autoawait` for more information.
108
108
109
109
110 Asynchronous code in a Notebook interface or any other frontend using the
110 Asynchronous code in a Notebook interface or any other frontend using the
111 Jupyter Protocol will need further updates of the IPykernel package.
111 Jupyter Protocol will need further updates of the IPykernel package.
112
112
113 Non-Asynchronous code
113 Non-Asynchronous code
114 ~~~~~~~~~~~~~~~~~~~~~
114 ~~~~~~~~~~~~~~~~~~~~~
115
115
116 As the internal API of IPython are now asynchronous, IPython need to run under
116 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,
117 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
118 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
119 is detected as not being asynchronous, IPython code is advanced via a
120 pseudo-synchronous runner, and will not may not advance pending tasks.
120 pseudo-synchronous runner, and will not may not advance pending tasks.
121
121
122 Change to Nested Embed
122 Change to Nested Embed
123 ~~~~~~~~~~~~~~~~~~~~~~
123 ~~~~~~~~~~~~~~~~~~~~~~
124
124
125 The introduction of the ability to run async code had some effect on the
125 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
126 ``IPython.embed()`` API. By default embed will not allow you to run asynchronous
127 code unless a event loop is specified.
127 code unless a event loop is specified.
128
128
129 Effects on Magics
129 Effects on Magics
130 ~~~~~~~~~~~~~~~~~
130 ~~~~~~~~~~~~~~~~~
131
131
132 Some magics will not work with Async, and will need updates. Contribution
132 Some magics will not work with Async, and will need updates. Contribution
133 welcome.
133 welcome.
134
134
135 Expected Future changes
135 Expected Future changes
136 ~~~~~~~~~~~~~~~~~~~~~~~
136 ~~~~~~~~~~~~~~~~~~~~~~~
137
137
138 We expect more internal but public IPython function to become ``async``, and
138 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.
139 will likely end up having a persisting event loop while IPython is running.
140
140
141 Thanks
141 Thanks
142 ~~~~~~
142 ~~~~~~
143
143
144 This took more than a year in the making, and the code was rebased a number of
144 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
145 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,
146 Pull-Request. Huge thanks to many people for contribution, discussion, code,
147 documentation, use-case: dalejung, danielballan, ellisonbg, fperez, gnestor,
147 documentation, use-case: dalejung, danielballan, ellisonbg, fperez, gnestor,
148 minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many other.
148 minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many other.
149
149
150
150
151 Autoreload Improvment
151 Autoreload Improvment
152 ---------------------
152 ---------------------
153
153
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.
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.
155
155
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.
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.
157
157
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.
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.
159
159
160
160
161 ..code::
161 ..code::
162
162
163 # notebook
163 # notebook
164
164
165 from mymodule import MyClass
165 from mymodule import MyClass
166 first = MyClass(5)
166 first = MyClass(5)
167
167
168 .. code::
168 .. code::
169
169 # mymodule/file1.py
170 # mymodule/file1.py
170
171
171 class MyClass:
172 class MyClass:
172
173
173 def __init__(self, a=10):
174 def __init__(self, a=10):
174 self.a = a
175 self.a = a
175
176
176 def square(self):
177 def square(self):
177 print('compute square')
178 print('compute square')
178 return self.a*self.a
179 return self.a*self.a
179
180
180 # def cube(self):
181 # def cube(self):
181 # print('compute cube')
182 # print('compute cube')
182 # return self.a*self.a*self.a
183 # return self.a*self.a*self.a
183
184
184
185
185
186
186
187
187 Misc
188 Misc
188 ----
189 ----
189
190
190 The autoindent feature that was deprecated in 5.x was re-enabled and
191 The autoindent feature that was deprecated in 5.x was re-enabled and
191 un-deprecated in :ghpull:`11257`
192 un-deprecated in :ghpull:`11257`
192
193
193 Make ``%run -n -i ...`` work correctly. Earlier, if ``%run`` was passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308`
194 Make ``%run -n -i ...`` work correctly. Earlier, if ``%run`` was passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308`
194
195
195
196
196
197
197
198
198
199
199 Deprecations
200 Deprecations
200 ------------
201 ------------
201
202
202 A couple of unused function and methods have been deprecated and will be removed
203 A couple of unused function and methods have been deprecated and will be removed
203 in future versions:
204 in future versions:
204
205
205 - ``IPython.utils.io.raw_print_err``
206 - ``IPython.utils.io.raw_print_err``
206 - ``IPython.utils.io.raw_print``
207 - ``IPython.utils.io.raw_print``
207
208
208
209
209 Backwards incompatible changes
210 Backwards incompatible changes
210 ------------------------------
211 ------------------------------
211
212
212 * The API for transforming input before it is parsed as Python code has been
213 * The API for transforming input before it is parsed as Python code has been
213 completely redesigned, and any custom input transformations will need to be
214 completely redesigned, and any custom input transformations will need to be
214 rewritten. See :doc:`/config/inputtransforms` for details of the new API.
215 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