Show More
@@ -0,0 +1,60 b'' | |||
|
1 | """ | |
|
2 | Un-targz and retargz a targz file to ensure reproducible build. | |
|
3 | ||
|
4 | usage: | |
|
5 | ||
|
6 | $ export SOURCE_DATE_EPOCH=$(date +%s) | |
|
7 | ... | |
|
8 | $ python retar.py <tarfile.gz> | |
|
9 | ||
|
10 | The process of creating an sdist can be non-reproducible: | |
|
11 | - directory created during the process get a mtime of the creation date; | |
|
12 | - gziping files embed the timestamp of fo zip creation. | |
|
13 | ||
|
14 | This will untar-retar; ensuring that all mtime > SOURCE_DATE_EPOCH will be set | |
|
15 | equal to SOURCE_DATE_EPOCH. | |
|
16 | ||
|
17 | """ | |
|
18 | ||
|
19 | import tarfile | |
|
20 | import sys | |
|
21 | import os | |
|
22 | import gzip | |
|
23 | import io | |
|
24 | ||
|
25 | if len(sys.argv) > 2: | |
|
26 | raise ValueError("Too many arguments") | |
|
27 | ||
|
28 | ||
|
29 | timestamp = int(os.environ["SOURCE_DATE_EPOCH"]) | |
|
30 | ||
|
31 | old_buf = io.BytesIO() | |
|
32 | with open(sys.argv[1], "rb") as f: | |
|
33 | old_buf.write(f.read()) | |
|
34 | old_buf.seek(0) | |
|
35 | old = tarfile.open(fileobj=old_buf, mode="r:gz") | |
|
36 | ||
|
37 | buf = io.BytesIO() | |
|
38 | new = tarfile.open(fileobj=buf, mode="w", format=tarfile.GNU_FORMAT) | |
|
39 | for i, m in enumerate(old): | |
|
40 | data = None | |
|
41 | # mutation does not work, copy | |
|
42 | if m.name.endswith('.DS_Store'): | |
|
43 | continue | |
|
44 | m2 = tarfile.TarInfo(m.name) | |
|
45 | m2.mtime = min(timestamp, m.mtime) | |
|
46 | m2.size = m.size | |
|
47 | m2.type = m.type | |
|
48 | m2.linkname = m.linkname | |
|
49 | if m.isdir(): | |
|
50 | data = old.extractfile(m) | |
|
51 | new.addfile(m2, data) | |
|
52 | else: | |
|
53 | new.addfile(m2) | |
|
54 | new.close() | |
|
55 | old.close() | |
|
56 | ||
|
57 | buf.seek(0) | |
|
58 | with open(sys.argv[1], "wb") as f: | |
|
59 | with gzip.GzipFile('', "wb", fileobj=f, mtime=timestamp) as gzf: | |
|
60 | gzf.write(buf.read()) |
@@ -1,303 +1,320 b'' | |||
|
1 | 1 | .. _core_developer_guide: |
|
2 | 2 | |
|
3 | 3 | ================================= |
|
4 | 4 | Guide for IPython core Developers |
|
5 | 5 | ================================= |
|
6 | 6 | |
|
7 | 7 | This guide documents the development of IPython itself. Alternatively, |
|
8 | 8 | developers of third party tools and libraries that use IPython should see the |
|
9 | 9 | :doc:`../development/index`. |
|
10 | 10 | |
|
11 | 11 | |
|
12 | 12 | For instructions on how to make a developer install see :ref:`devinstall`. |
|
13 | 13 | |
|
14 | 14 | Backporting Pull requests |
|
15 | 15 | ========================= |
|
16 | 16 | |
|
17 | 17 | All pull requests should usually be made against ``master``, if a Pull Request |
|
18 | 18 | need to be backported to an earlier release; then it should be tagged with the |
|
19 | 19 | correct ``milestone``. |
|
20 | 20 | |
|
21 | 21 | If you tag a pull request with a milestone **before** merging the pull request, |
|
22 | 22 | and the base ref is ``master``, then our backport bot should automatically create |
|
23 | 23 | a corresponding pull-request that backport on the correct branch. |
|
24 | 24 | |
|
25 | 25 | If you have write access to the IPython repository you can also just mention the |
|
26 | 26 | **backport bot** to do the work for you. The bot is evolving so instructions may |
|
27 | 27 | be different. At the time of this writing you can use:: |
|
28 | 28 | |
|
29 | 29 | @meeseeksdev[bot] backport [to] <branchname> |
|
30 | 30 | |
|
31 | 31 | The bot will attempt to backport the current pull-request and issue a PR if |
|
32 | 32 | possible. |
|
33 | 33 | |
|
34 | 34 | .. note:: |
|
35 | 35 | |
|
36 | 36 | The ``@`` and ``[bot]`` when mentioning the bot should be optional and can |
|
37 | 37 | be omitted. |
|
38 | 38 | |
|
39 | 39 | If the pull request cannot be automatically backported, the bot should tell you |
|
40 | 40 | so on the PR and apply a "Need manual backport" tag to the origin PR. |
|
41 | 41 | |
|
42 | 42 | .. _release_process: |
|
43 | 43 | |
|
44 | 44 | IPython release process |
|
45 | 45 | ======================= |
|
46 | 46 | |
|
47 | 47 | This document contains the process that is used to create an IPython release. |
|
48 | 48 | |
|
49 | 49 | Conveniently, the ``release`` script in the ``tools`` directory of the ``IPython`` |
|
50 | 50 | repository automates most of the release process. This document serves as a |
|
51 | 51 | handy reminder and checklist for the release manager. |
|
52 | 52 | |
|
53 | 53 | During the release process, you might need the extra following dependencies: |
|
54 | 54 | |
|
55 | 55 | - ``keyring`` to access your GitHub authentication tokens |
|
56 | 56 | - ``graphviz`` to generate some graphs in the documentation |
|
57 | 57 | - ``ghpro`` to generate the stats |
|
58 | 58 | |
|
59 | 59 | Make sure you have all the required dependencies to run the tests as well. |
|
60 | 60 | |
|
61 | 61 | You can try to ``source tools/release_helper.sh`` when releasing via bash, it |
|
62 | 62 | should guide you through most of the process. |
|
63 | 63 | |
|
64 | 64 | |
|
65 | 65 | 1. Set Environment variables |
|
66 | 66 | ---------------------------- |
|
67 | 67 | |
|
68 | 68 | Set environment variables to document previous release tag, current |
|
69 | 69 | release milestone, current release version, and git tag. |
|
70 | 70 | |
|
71 | 71 | These variables may be used later to copy/paste as answers to the script |
|
72 | 72 | questions instead of typing the appropriate command when the time comes. These |
|
73 | 73 | variables are not used by the scripts directly; therefore, there is no need to |
|
74 | 74 | ``export`` them. The format for bash is as follows, but note that these values |
|
75 | 75 | are just an example valid only for the 5.0 release; you'll need to update them |
|
76 | 76 | for the release you are actually making:: |
|
77 | 77 | |
|
78 | 78 | PREV_RELEASE=4.2.1 |
|
79 | 79 | MILESTONE=5.0 |
|
80 | 80 | VERSION=5.0.0 |
|
81 | 81 | BRANCH=master |
|
82 | 82 | |
|
83 | For `reproducibility of builds <https://reproducible-builds.org/specs/source-date-epoch/>`_, | |
|
84 | we recommend setting ``SOURCE_DATE_EPOCH`` prior to running the build; record the used value | |
|
85 | of ``SOURCE_DATE_EPOCH`` as it may not be available from build artifact. You | |
|
86 | should be able to use ``date +%s`` to get a formatted timestamp:: | |
|
87 | ||
|
88 | SOURCE_DATE_EPOCH=$(date +%s) | |
|
89 | ||
|
83 | 90 | |
|
84 | 91 | 2. Create GitHub stats and finish release note |
|
85 | 92 | ---------------------------------------------- |
|
86 | 93 | |
|
87 | 94 | .. note:: |
|
88 | 95 | |
|
89 | 96 | This step is optional if making a Beta or RC release. |
|
90 | 97 | |
|
91 | 98 | .. note:: |
|
92 | 99 | |
|
93 | 100 | Before generating the GitHub stats, verify that all closed issues and pull |
|
94 | 101 | requests have `appropriate milestones |
|
95 | 102 | <https://github.com/ipython/ipython/wiki/Dev:-GitHub-workflow#milestones>`_. |
|
96 | 103 | `This search |
|
97 | 104 | <https://github.com/ipython/ipython/issues?q=is%3Aclosed+no%3Amilestone+is%3Aissue>`_ |
|
98 | 105 | should return no results before creating the GitHub stats. |
|
99 | 106 | |
|
100 | 107 | If a major release: |
|
101 | 108 | |
|
102 | 109 | - merge any pull request notes into what's new:: |
|
103 | 110 | |
|
104 | 111 | python tools/update_whatsnew.py |
|
105 | 112 | |
|
106 | 113 | - update ``docs/source/whatsnew/development.rst``, to ensure it covers |
|
107 | 114 | the major release features |
|
108 | 115 | |
|
109 | 116 | - move the contents of ``development.rst`` to ``versionX.rst`` where ``X`` is |
|
110 | 117 | the numerical release version |
|
111 | 118 | |
|
112 | 119 | - generate summary of GitHub contributions, which can be done with:: |
|
113 | 120 | |
|
114 | 121 | python tools/github_stats.py --milestone $MILESTONE > stats.rst |
|
115 | 122 | |
|
116 | 123 | which may need some manual cleanup of ``stats.rst``. Add the cleaned |
|
117 | 124 | ``stats.rst`` results to ``docs/source/whatsnew/github-stats-X.rst`` |
|
118 | 125 | where ``X`` is the numerical release version (don't forget to add it to |
|
119 | 126 | the git repository as well). If creating a major release, make a new |
|
120 | 127 | ``github-stats-X.rst`` file; if creating a minor release, the content |
|
121 | 128 | from ``stats.rst`` may simply be added to the top of an existing |
|
122 | 129 | ``github-stats-X.rst`` file. |
|
123 | 130 | |
|
124 | 131 | - Edit ``docs/source/whatsnew/index.rst`` to list the new ``github-stats-X`` |
|
125 | 132 | file you just created. |
|
126 | 133 | |
|
127 | 134 | - You do not need to temporarily remove the first entry called |
|
128 | 135 | ``development``, nor re-add it after the release, it will automatically be |
|
129 | 136 | hidden when releasing a stable version of IPython (if ``_version_extra`` |
|
130 | 137 | in ``release.py`` is an empty string. |
|
131 | 138 | |
|
132 | 139 | Make sure that the stats file has a header or it won't be rendered in |
|
133 | 140 | the final documentation. |
|
134 | 141 | |
|
135 | 142 | To find duplicates and update `.mailmap`, use:: |
|
136 | 143 | |
|
137 | 144 | git log --format="%aN <%aE>" $PREV_RELEASE... | sort -u -f |
|
138 | 145 | |
|
139 | 146 | If a minor release you might need to do some of the above points manually, and |
|
140 | 147 | forward port the changes. |
|
141 | 148 | |
|
142 | 149 | 3. Make sure the repository is clean |
|
143 | 150 | ------------------------------------ |
|
144 | 151 | |
|
145 | 152 | of any file that could be problematic. |
|
146 | 153 | Remove all non-tracked files with: |
|
147 | 154 | |
|
148 | 155 | .. code:: |
|
149 | 156 | |
|
150 | 157 | git clean -xfdi |
|
151 | 158 | |
|
152 | 159 | This will ask for confirmation before removing all untracked files. Make |
|
153 | 160 | sure the ``dist/`` folder is clean to avoid any stale builds from |
|
154 | 161 | previous build attempts. |
|
155 | 162 | |
|
156 | 163 | |
|
157 | 164 | 4. Update the release version number |
|
158 | 165 | ------------------------------------ |
|
159 | 166 | |
|
160 | 167 | Edit ``IPython/core/release.py`` to have the current version. |
|
161 | 168 | |
|
162 | 169 | in particular, update version number and ``_version_extra`` content in |
|
163 | 170 | ``IPython/core/release.py``. |
|
164 | 171 | |
|
165 | 172 | Step 5 will validate your changes automatically, but you might still want to |
|
166 | 173 | make sure the version number matches pep440. |
|
167 | 174 | |
|
168 | 175 | In particular, ``rc`` and ``beta`` are not separated by ``.`` or the ``sdist`` |
|
169 | 176 | and ``bdist`` will appear as different releases. For example, a valid version |
|
170 | 177 | number for a release candidate (rc) release is: ``1.3rc1``. Notice that there |
|
171 | 178 | is no separator between the '3' and the 'r'. Check the environment variable |
|
172 | 179 | ``$VERSION`` as well. |
|
173 | 180 | |
|
174 | 181 | You will likely just have to modify/comment/uncomment one of the lines setting |
|
175 | 182 | ``_version_extra`` |
|
176 | 183 | |
|
177 | 184 | |
|
178 | 185 | 5. Run the `tools/build_release` script |
|
179 | 186 | --------------------------------------- |
|
180 | 187 | |
|
181 | 188 | Running ``tools/build_release`` does all the file checking and building that |
|
182 | 189 | the real release script will do. This makes test installations, checks that |
|
183 | 190 | the build procedure runs OK, and tests other steps in the release process. |
|
184 | 191 | |
|
185 | 192 | The ``build_release`` script will in particular verify that the version number |
|
186 | 193 | match PEP 440, in order to avoid surprise at the time of build upload. |
|
187 | 194 | |
|
188 | 195 | We encourage creating a test build of the docs as well. |
|
189 | 196 | |
|
190 | 197 | 6. Create and push the new tag |
|
191 | 198 | ------------------------------ |
|
192 | 199 | |
|
193 | 200 | Commit the changes to release.py:: |
|
194 | 201 | |
|
195 | 202 | git commit -am "release $VERSION" -S |
|
196 | 203 | git push origin $BRANCH |
|
197 | 204 | |
|
198 | 205 | (omit the ``-S`` if you are no signing the package) |
|
199 | 206 | |
|
200 | 207 | Create and push the tag:: |
|
201 | 208 | |
|
202 | 209 | git tag -am "release $VERSION" "$VERSION" -s |
|
203 | 210 | git push origin $VERSION |
|
204 | 211 | |
|
205 | 212 | (omit the ``-s`` if you are no signing the package) |
|
206 | 213 | |
|
207 | 214 | Update release.py back to ``x.y-dev`` or ``x.y-maint`` commit and push:: |
|
208 | 215 | |
|
209 | 216 | git commit -am "back to development" -S |
|
210 | 217 | git push origin $BRANCH |
|
211 | 218 | |
|
212 | 219 | (omit the ``-S`` if you are no signing the package) |
|
213 | 220 | |
|
214 | 221 | Now checkout the tag we just made:: |
|
215 | 222 | |
|
216 | 223 | git checkout $VERSION |
|
217 | 224 | |
|
218 | 225 | 7. Run the release script |
|
219 | 226 | ------------------------- |
|
220 | 227 | |
|
221 | 228 | Run the ``release`` script, this step requires having a current wheel, Python |
|
222 | 229 | >=3.4 and Python 2.7.:: |
|
223 | 230 | |
|
224 | 231 | ./tools/release |
|
225 | 232 | |
|
226 | 233 | This makes the tarballs and wheels, and puts them under the ``dist/`` |
|
227 | 234 | folder. Be sure to test the ``wheels`` and the ``sdist`` locally before |
|
228 | 235 | uploading them to PyPI. We do not use an universal wheel as each wheel |
|
229 | 236 | installs an ``ipython2`` or ``ipython3`` script, depending on the version of |
|
230 | 237 | Python it is built for. Using an universal wheel would prevent this. |
|
231 | 238 | |
|
239 | Check the shasum of files with:: | |
|
240 | ||
|
241 | shasum -a 256 dist/* | |
|
242 | ||
|
243 | and takes notes of them you might need them to update the conda-forge recipes. | |
|
244 | Rerun the command and check the hash have not changed:: | |
|
245 | ||
|
246 | ./tools/release | |
|
247 | shasum -a 256 dist/* | |
|
248 | ||
|
232 | 249 | Use the following to actually upload the result of the build:: |
|
233 | 250 | |
|
234 | 251 | ./tools/release upload |
|
235 | 252 | |
|
236 | 253 | It should posts them to ``archive.ipython.org`` and to PyPI. |
|
237 | 254 | |
|
238 | 255 | PyPI/Warehouse will automatically hide previous releases. If you are uploading |
|
239 | 256 | a non-stable version, make sure to log-in to PyPI and un-hide previous version. |
|
240 | 257 | |
|
241 | 258 | |
|
242 | 259 | 8. Draft a short release announcement |
|
243 | 260 | ------------------------------------- |
|
244 | 261 | |
|
245 | 262 | The announcement should include: |
|
246 | 263 | |
|
247 | 264 | - release highlights |
|
248 | 265 | - a link to the html version of the *What's new* section of the documentation |
|
249 | 266 | - a link to upgrade or installation tips (if necessary) |
|
250 | 267 | |
|
251 | 268 | Post the announcement to the mailing list and or blog, and link from Twitter. |
|
252 | 269 | |
|
253 | 270 | .. note:: |
|
254 | 271 | |
|
255 | 272 | If you are doing a RC or Beta, you can likely skip the next steps. |
|
256 | 273 | |
|
257 | 274 | 9. Update milestones on GitHub |
|
258 | 275 | ------------------------------- |
|
259 | 276 | |
|
260 | 277 | These steps will bring milestones up to date: |
|
261 | 278 | |
|
262 | 279 | - close the just released milestone |
|
263 | 280 | - open a new milestone for the next release (x, y+1), if the milestone doesn't |
|
264 | 281 | exist already |
|
265 | 282 | |
|
266 | 283 | 10. Update the IPython website |
|
267 | 284 | ------------------------------ |
|
268 | 285 | |
|
269 | 286 | The IPython website should document the new release: |
|
270 | 287 | |
|
271 | 288 | - add release announcement (news, announcements) |
|
272 | 289 | - update current version and download links |
|
273 | 290 | - update links on the documentation page (especially if a major release) |
|
274 | 291 | |
|
275 | 292 | 11. Update readthedocs |
|
276 | 293 | ---------------------- |
|
277 | 294 | |
|
278 | 295 | Make sure to update readthedocs and set the latest tag as stable, as well as |
|
279 | 296 | checking that previous release is still building under its own tag. |
|
280 | 297 | |
|
281 | 298 | 12. Update the Conda-Forge feedstock |
|
282 | 299 | ------------------------------------ |
|
283 | 300 | |
|
284 | 301 | Follow the instructions on `the repository <https://github.com/conda-forge/ipython-feedstock>`_ |
|
285 | 302 | |
|
286 | 303 | 13. Celebrate! |
|
287 | 304 | -------------- |
|
288 | 305 | |
|
289 | 306 | Celebrate the release and please thank the contributors for their work. Great |
|
290 | 307 | job! |
|
291 | 308 | |
|
292 | 309 | |
|
293 | 310 | |
|
294 | 311 | Old Documentation |
|
295 | 312 | ================= |
|
296 | 313 | |
|
297 | 314 | Out of date documentation is still available and have been kept for archival purposes. |
|
298 | 315 | |
|
299 | 316 | .. note:: |
|
300 | 317 | |
|
301 | 318 | Developers documentation used to be on the IPython wiki, but are now out of |
|
302 | 319 | date. The wiki is though still available for historical reasons: `Old IPython |
|
303 | 320 | GitHub Wiki. <https://github.com/ipython/ipython/wiki/Dev:-Index>`_ |
@@ -1,906 +1,990 b'' | |||
|
1 | 1 | ============ |
|
2 | 2 | 7.x Series |
|
3 | 3 | ============ |
|
4 | 4 | |
|
5 | .. _version 715: | |
|
6 | ||
|
7 | IPython 7.15 | |
|
8 | ============ | |
|
9 | ||
|
10 | IPython 7.15 brings a number of bug fixes and user facing improvements. | |
|
11 | ||
|
12 | Misc Noticeable changes: | |
|
13 | ------------------------ | |
|
14 | ||
|
15 | - Long completion name have better elision in terminal :ghpull:`12284` | |
|
16 | - I've started to test on Python 3.9 :ghpull:`12307` and fix some errors. | |
|
17 | - Hi DPI scaling of figures when using qt eventloop :ghpull:`12314` | |
|
18 | - Document the ability to have systemwide configuration for IPython. | |
|
19 | :ghpull:`12328` | |
|
20 | - Fix issues with input autoformatting :ghpull:`12336` | |
|
21 | ||
|
22 | Reproducible Build | |
|
23 | ------------------ | |
|
24 | ||
|
25 | Starting with IPython 7.15, I am attempting to provide reproducible builds, | |
|
26 | that is to say you should be able from the source tree to generate an sdist | |
|
27 | and wheel that are identical byte for byte with the publish version on PyPI. | |
|
28 | ||
|
29 | I've only tested on a couple of machines so far and the process is relatively | |
|
30 | straightforward, so this mean that IPython not only have a deterministic build | |
|
31 | process, but also I have either removed, or put under control all effects of | |
|
32 | the build environments on the final artifact. I encourage you to attempt the | |
|
33 | build process on your machine as documented in :ref:`core_developer_guide` | |
|
34 | and let me know if you do not obtain an identical artifact. | |
|
35 | ||
|
36 | While reproducible builds is critical to check that the supply chain of (open | |
|
37 | source) software has not been compromised, it can also help to speedup many | |
|
38 | of the build processes in large environment (conda, apt...) by allowing | |
|
39 | better caching of intermediate build steps. | |
|
40 | ||
|
41 | Learn more on `<https://reproducible-builds.org/>`_. `Reflections on trusting | |
|
42 | trust <https://dl.acm.org/doi/10.1145/358198.358210>`_ is also one of the | |
|
43 | cornerstone and recommended reads on this subject. | |
|
44 | ||
|
45 | .. note:: | |
|
46 | ||
|
47 | The build commit from which the sdist is generated is also `signed | |
|
48 | <https://en.wikipedia.org/wiki/Digital_signature>`_, so you should be able to | |
|
49 | check it has not been compromised, and the git repository is a `merkle-tree | |
|
50 | <https://en.wikipedia.org/wiki/Merkle_tree>`_, you can check the consistency | |
|
51 | with `git-fsck <https://git-scm.com/docs/git-fsck>`_ which you likely `want | |
|
52 | to enable by default | |
|
53 | <https://gist.github.com/mbbx6spp/14b86437e794bffb4120>`_. | |
|
54 | ||
|
55 | NEP29: Last version to support Python 3.6 | |
|
56 | ----------------------------------------- | |
|
57 | ||
|
58 | IPython 7.15 will be the Last IPython version to officially support Python | |
|
59 | 3.6, as stated by `NumPy Enhancement Proposal 29 | |
|
60 | <https://numpy.org/neps/nep-0029-deprecation_policy.html>`_. Starting with | |
|
61 | next minor version of IPython I may stop testing on Python 3.6 and may stop | |
|
62 | publishing release artifacts that install on Python 3.6 | |
|
63 | ||
|
64 | Highlighted features | |
|
65 | -------------------- | |
|
66 | ||
|
67 | Highlighted features are not new, but seem to not be widely known, this | |
|
68 | section will help you discover in more narrative form what you can do with | |
|
69 | IPython. | |
|
70 | ||
|
71 | Increase Tab Completion Menu Height | |
|
72 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
|
73 | ||
|
74 | In terminal IPython it is possible to increase the hight of the tab-completion | |
|
75 | menu. To do so set the value of | |
|
76 | :configtrait:`TerminalInteractiveShell.space_for_menu`, this will reserve more | |
|
77 | space at the bottom of the screen for various kind of menus in IPython including | |
|
78 | tab completion and searching in history. | |
|
79 | ||
|
80 | Autoformat Code in the terminal | |
|
81 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
|
82 | ||
|
83 | If you have a preferred code formatter, you can configure IPython to | |
|
84 | reformat your code. Set the value of | |
|
85 | :configtrait:`TerminalInteractiveShell.autoformatter` to for example ``'black'`` | |
|
86 | and IPython will auto format your code when possible. | |
|
87 | ||
|
88 | ||
|
5 | 89 | .. _version 714: |
|
6 | 90 | |
|
7 | 91 | IPython 7.14 |
|
8 | 92 | ============ |
|
9 | 93 | |
|
10 | 94 | IPython 7.14 is a minor release that fix a couple of bugs and prepare |
|
11 | 95 | compatibility with new or future versions of some libraries. |
|
12 | 96 | |
|
13 | 97 | Important changes: |
|
14 | 98 | ------------------ |
|
15 | 99 | |
|
16 | 100 | - Fix compatibility with Sphinx 3+ :ghpull:`12235` |
|
17 | 101 | - Remove deprecated matplotlib parameter usage, compatibility with matplotlib |
|
18 | 102 | 3.3+ :`122250` |
|
19 | 103 | |
|
20 | 104 | Misc Changes |
|
21 | 105 | ------------ |
|
22 | 106 | |
|
23 | 107 | - set ``.py`` extension when editing current buffer in vi/emacs. :ghpull:`12167` |
|
24 | 108 | - support for unicode identifiers in ``?``/``??`` :ghpull:`12208` |
|
25 | 109 | - add extra options to the ``Video`` Rich objects :ghpull:`12212` |
|
26 | 110 | - add pretty-printing to ``SimpleNamespace`` :ghpull:`12230` |
|
27 | 111 | |
|
28 | 112 | Pending deprecated imports |
|
29 | 113 | -------------------------- |
|
30 | 114 | |
|
31 | 115 | Many object present in ``IPython.core.display`` are there for internal use only, |
|
32 | 116 | and should already been imported from ``IPython.display`` by users and external |
|
33 | 117 | libraries. Trying to import those from ``IPython.core.display`` is still possible |
|
34 | 118 | but will trigger a |
|
35 | 119 | deprecation warning in later versions of IPython and will become errors in the |
|
36 | 120 | future. |
|
37 | 121 | |
|
38 | 122 | This will simplify compatibility with other Python kernels (like Xeus-Python), |
|
39 | 123 | and simplify code base. |
|
40 | 124 | |
|
41 | 125 | |
|
42 | 126 | |
|
43 | 127 | |
|
44 | 128 | .. _version 713: |
|
45 | 129 | |
|
46 | 130 | IPython 7.13 |
|
47 | 131 | ============ |
|
48 | 132 | |
|
49 | 133 | IPython 7.13 is the final release of the 7.x branch since master is diverging |
|
50 | 134 | toward an 8.0. Exiting new features have already been merged in 8.0 and will |
|
51 | 135 | not be available on the 7.x branch. All the changes below have been backported |
|
52 | 136 | from the master branch. |
|
53 | 137 | |
|
54 | 138 | |
|
55 | 139 | - Fix inability to run PDB when inside an event loop :ghpull:`12141` |
|
56 | 140 | - Fix ability to interrupt some processes on windows :ghpull:`12137` |
|
57 | 141 | - Fix debugger shortcuts :ghpull:`12132` |
|
58 | 142 | - improve tab completion when inside a string by removing irrelevant elements :ghpull:`12128` |
|
59 | 143 | - Fix display of filename tab completion when the path is long :ghpull:`12122` |
|
60 | 144 | - Many removal of Python 2 specific code path :ghpull:`12110` |
|
61 | 145 | - displaying wav files do not require NumPy anymore, and is 5x to 30x faster :ghpull:`12113` |
|
62 | 146 | |
|
63 | 147 | See the list of all closed issues and pull request on `github |
|
64 | 148 | <https://github.com/ipython/ipython/pulls?q=is%3Aclosed+milestone%3A7.13>`_. |
|
65 | 149 | |
|
66 | 150 | .. _version 712: |
|
67 | 151 | |
|
68 | 152 | IPython 7.12 |
|
69 | 153 | ============ |
|
70 | 154 | |
|
71 | 155 | IPython 7.12 is a minor update that mostly brings code cleanup, removal of |
|
72 | 156 | longtime deprecated function and a couple update to documentation cleanup as well. |
|
73 | 157 | |
|
74 | 158 | Notable changes are the following: |
|
75 | 159 | |
|
76 | 160 | - Exit non-zero when ipython is given a file path to run that doesn't exist :ghpull:`12074` |
|
77 | 161 | - Test PR on ARM64 with Travis-CI :ghpull:`12073` |
|
78 | 162 | - Update CI to work with latest Pytest :ghpull:`12086` |
|
79 | 163 | - Add infrastructure to run ipykernel eventloop via trio :ghpull:`12097` |
|
80 | 164 | - Support git blame ignore revs :ghpull:`12091` |
|
81 | 165 | - Start multi-line ``__repr__`` s on their own line :ghpull:`12099` |
|
82 | 166 | |
|
83 | 167 | .. _version 7111: |
|
84 | 168 | |
|
85 | 169 | IPython 7.11.1 |
|
86 | 170 | ============== |
|
87 | 171 | |
|
88 | 172 | A couple of deprecated functions (no-op) have been reintroduces in py3compat as |
|
89 | 173 | Cython was still relying on them, and will be removed in a couple of versions. |
|
90 | 174 | |
|
91 | 175 | .. _version 711: |
|
92 | 176 | |
|
93 | 177 | IPython 7.11 |
|
94 | 178 | ============ |
|
95 | 179 | |
|
96 | 180 | IPython 7.11 received a couple of compatibility fixes and code cleanup. |
|
97 | 181 | |
|
98 | 182 | A number of function in the ``py3compat`` have been removed; a number of types |
|
99 | 183 | in the IPython code base are now non-ambiguous and now always ``unicode`` |
|
100 | 184 | instead of ``Union[Unicode,bytes]``; many of the relevant code path have thus |
|
101 | 185 | been simplified/cleaned and types annotation added. |
|
102 | 186 | |
|
103 | 187 | IPython support several verbosity level from exceptions. ``xmode plain`` now |
|
104 | 188 | support chained exceptions. :ghpull:`11999` |
|
105 | 189 | |
|
106 | 190 | We are starting to remove ``shell=True`` in some usages of subprocess. While not directly |
|
107 | 191 | a security issue (as IPython is made to run arbitrary code anyway) it is not good |
|
108 | 192 | practice and we'd like to show the example. :ghissue:`12023`. This discussion |
|
109 | 193 | was started by ``@mschwager`` thanks to a new auditing tool they are working on |
|
110 | 194 | with duo-labs (`dlint <https://github.com/duo-labs/dlint>`_). |
|
111 | 195 | |
|
112 | 196 | Work around some bugs in Python 3.9 tokenizer :ghpull:`12057` |
|
113 | 197 | |
|
114 | 198 | IPython will now print its version after a crash. :ghpull:`11986` |
|
115 | 199 | |
|
116 | 200 | This is likely the last release from the 7.x series that will see new feature. |
|
117 | 201 | The master branch will soon accept large code changes and thrilling new |
|
118 | 202 | features; the 7.x branch will only start to accept critical bug fixes, and |
|
119 | 203 | update dependencies. |
|
120 | 204 | |
|
121 | 205 | .. _version 7102: |
|
122 | 206 | |
|
123 | 207 | IPython 7.10.2 |
|
124 | 208 | ============== |
|
125 | 209 | |
|
126 | 210 | IPython 7.10.2 fix a couple of extra incompatibility between IPython, ipdb, |
|
127 | 211 | asyncio and Prompt Toolkit 3. |
|
128 | 212 | |
|
129 | 213 | .. _version 7101: |
|
130 | 214 | |
|
131 | 215 | IPython 7.10.1 |
|
132 | 216 | ============== |
|
133 | 217 | |
|
134 | 218 | IPython 7.10.1 fix a couple of incompatibilities with Prompt toolkit 3 (please |
|
135 | 219 | update Prompt toolkit to 3.0.2 at least), and fixes some interaction with |
|
136 | 220 | headless IPython. |
|
137 | 221 | |
|
138 | 222 | .. _version 7100: |
|
139 | 223 | |
|
140 | 224 | IPython 7.10.0 |
|
141 | 225 | ============== |
|
142 | 226 | |
|
143 | 227 | IPython 7.10 is the first double digit minor release in the last decade, and |
|
144 | 228 | first since the release of IPython 1.0, previous double digit minor release was |
|
145 | 229 | in August 2009. |
|
146 | 230 | |
|
147 | 231 | We've been trying to give you regular release on the last Friday of every month |
|
148 | 232 | for a guaranty of rapid access to bug fixes and new features. |
|
149 | 233 | |
|
150 | 234 | Unlike the previous first few releases that have seen only a couple of code |
|
151 | 235 | changes, 7.10 bring a number of changes, new features and bugfixes. |
|
152 | 236 | |
|
153 | 237 | Stop Support for Python 3.5 β Adopt NEP 29 |
|
154 | 238 | ------------------------------------------ |
|
155 | 239 | |
|
156 | 240 | IPython has decided to follow the informational `NEP 29 |
|
157 | 241 | <https://numpy.org/neps/nep-0029-deprecation_policy.html>`_ which layout a clear |
|
158 | 242 | policy as to which version of (C)Python and NumPy are supported. |
|
159 | 243 | |
|
160 | 244 | We thus dropped support for Python 3.5, and cleaned up a number of code path |
|
161 | 245 | that were Python-version dependant. If you are on 3.5 or earlier pip should |
|
162 | 246 | automatically give you the latest compatible version of IPython so you do not |
|
163 | 247 | need to pin to a given version. |
|
164 | 248 | |
|
165 | 249 | Support for Prompt Toolkit 3.0 |
|
166 | 250 | ------------------------------ |
|
167 | 251 | |
|
168 | 252 | Prompt Toolkit 3.0 was release a week before IPython 7.10 and introduces a few |
|
169 | 253 | breaking changes. We believe IPython 7.10 should be compatible with both Prompt |
|
170 | 254 | Toolkit 2.x and 3.x, though it has not been extensively tested with 3.x so |
|
171 | 255 | please report any issues. |
|
172 | 256 | |
|
173 | 257 | |
|
174 | 258 | Prompt Rendering Performance improvements |
|
175 | 259 | ----------------------------------------- |
|
176 | 260 | |
|
177 | 261 | Pull Request :ghpull:`11933` introduced an optimisation in the prompt rendering |
|
178 | 262 | logic that should decrease the resource usage of IPython when using the |
|
179 | 263 | _default_ configuration but could potentially introduce a regression of |
|
180 | 264 | functionalities if you are using a custom prompt. |
|
181 | 265 | |
|
182 | 266 | We know assume if you haven't changed the default keybindings that the prompt |
|
183 | 267 | **will not change** during the duration of your input β which is for example |
|
184 | 268 | not true when using vi insert mode that switches between `[ins]` and `[nor]` |
|
185 | 269 | for the current mode. |
|
186 | 270 | |
|
187 | 271 | If you are experiencing any issue let us know. |
|
188 | 272 | |
|
189 | 273 | Code autoformatting |
|
190 | 274 | ------------------- |
|
191 | 275 | |
|
192 | 276 | The IPython terminal can now auto format your code just before entering a new |
|
193 | 277 | line or executing a command. To do so use the |
|
194 | 278 | ``--TerminalInteractiveShell.autoformatter`` option and set it to ``'black'``; |
|
195 | 279 | if black is installed IPython will use black to format your code when possible. |
|
196 | 280 | |
|
197 | 281 | IPython cannot always properly format your code; in particular it will |
|
198 | 282 | auto formatting with *black* will only work if: |
|
199 | 283 | |
|
200 | 284 | - Your code does not contains magics or special python syntax. |
|
201 | 285 | |
|
202 | 286 | - There is no code after your cursor. |
|
203 | 287 | |
|
204 | 288 | The Black API is also still in motion; so this may not work with all versions of |
|
205 | 289 | black. |
|
206 | 290 | |
|
207 | 291 | It should be possible to register custom formatter, though the API is till in |
|
208 | 292 | flux. |
|
209 | 293 | |
|
210 | 294 | Arbitrary Mimetypes Handing in Terminal (Aka inline images in terminal) |
|
211 | 295 | ----------------------------------------------------------------------- |
|
212 | 296 | |
|
213 | 297 | When using IPython terminal it is now possible to register function to handle |
|
214 | 298 | arbitrary mimetypes. While rendering non-text based representation was possible in |
|
215 | 299 | many jupyter frontend; it was not possible in terminal IPython, as usually |
|
216 | 300 | terminal are limited to displaying text. As many terminal these days provide |
|
217 | 301 | escape sequences to display non-text; bringing this loved feature to IPython CLI |
|
218 | 302 | made a lot of sens. This functionality will not only allow inline images; but |
|
219 | 303 | allow opening of external program; for example ``mplayer`` to "display" sound |
|
220 | 304 | files. |
|
221 | 305 | |
|
222 | 306 | So far only the hooks necessary for this are in place, but no default mime |
|
223 | 307 | renderers added; so inline images will only be available via extensions. We will |
|
224 | 308 | progressively enable these features by default in the next few releases, and |
|
225 | 309 | contribution is welcomed. |
|
226 | 310 | |
|
227 | 311 | We welcome any feedback on the API. See :ref:`shell_mimerenderer` for more |
|
228 | 312 | informations. |
|
229 | 313 | |
|
230 | 314 | This is originally based on work form in :ghpull:`10610` from @stephanh42 |
|
231 | 315 | started over two years ago, and still a lot need to be done. |
|
232 | 316 | |
|
233 | 317 | MISC |
|
234 | 318 | ---- |
|
235 | 319 | |
|
236 | 320 | - Completions can define their own ordering :ghpull:`11855` |
|
237 | 321 | - Enable Plotting in the same cell than the one that import matplotlib |
|
238 | 322 | :ghpull:`11916` |
|
239 | 323 | - Allow to store and restore multiple variables at once :ghpull:`11930` |
|
240 | 324 | |
|
241 | 325 | You can see `all pull-requests <https://github.com/ipython/ipython/pulls?q=is%3Apr+milestone%3A7.10+is%3Aclosed>`_ for this release. |
|
242 | 326 | |
|
243 | 327 | API Changes |
|
244 | 328 | ----------- |
|
245 | 329 | |
|
246 | 330 | Change of API and exposed objects automatically detected using `frappuccino <https://pypi.org/project/frappuccino/>`_ (still in beta): |
|
247 | 331 | |
|
248 | 332 | The following items are new in IPython 7.10:: |
|
249 | 333 | |
|
250 | 334 | + IPython.terminal.shortcuts.reformat_text_before_cursor(buffer, document, shell) |
|
251 | 335 | + IPython.terminal.interactiveshell.PTK3 |
|
252 | 336 | + IPython.terminal.interactiveshell.black_reformat_handler(text_before_cursor) |
|
253 | 337 | + IPython.terminal.prompts.RichPromptDisplayHook.write_format_data(self, format_dict, md_dict='None') |
|
254 | 338 | |
|
255 | 339 | The following items have been removed in 7.10:: |
|
256 | 340 | |
|
257 | 341 | - IPython.lib.pretty.DICT_IS_ORDERED |
|
258 | 342 | |
|
259 | 343 | The following signatures differ between versions:: |
|
260 | 344 | |
|
261 | 345 | - IPython.extensions.storemagic.restore_aliases(ip) |
|
262 | 346 | + IPython.extensions.storemagic.restore_aliases(ip, alias='None') |
|
263 | 347 | |
|
264 | 348 | Special Thanks |
|
265 | 349 | -------------- |
|
266 | 350 | |
|
267 | 351 | - @stephanh42 who started the work on inline images in terminal 2 years ago |
|
268 | 352 | - @augustogoulart who spent a lot of time triaging issues and responding to |
|
269 | 353 | users. |
|
270 | 354 | - @con-f-use who is my (@Carreau) first sponsor on GitHub, as a reminder if you |
|
271 | 355 | like IPython, Jupyter and many other library of the SciPy stack you can |
|
272 | 356 | donate to numfocus.org non profit |
|
273 | 357 | |
|
274 | 358 | .. _version 790: |
|
275 | 359 | |
|
276 | 360 | IPython 7.9.0 |
|
277 | 361 | ============= |
|
278 | 362 | |
|
279 | 363 | IPython 7.9 is a small release with a couple of improvement and bug fixes. |
|
280 | 364 | |
|
281 | 365 | - Xterm terminal title should be restored on exit :ghpull:`11910` |
|
282 | 366 | - special variables ``_``,``__``, ``___`` are not set anymore when cache size |
|
283 | 367 | is 0 or less. :ghpull:`11877` |
|
284 | 368 | - Autoreload should have regained some speed by using a new heuristic logic to |
|
285 | 369 | find all objects needing reload. This should avoid large objects traversal |
|
286 | 370 | like pandas dataframes. :ghpull:`11876` |
|
287 | 371 | - Get ready for Python 4. :ghpull:`11874` |
|
288 | 372 | - `%env` Magic now has heuristic to hide potentially sensitive values :ghpull:`11896` |
|
289 | 373 | |
|
290 | 374 | This is a small release despite a number of Pull Request Pending that need to |
|
291 | 375 | be reviewed/worked on. Many of the core developers have been busy outside of |
|
292 | 376 | IPython/Jupyter and we thanks all contributor for their patience; we'll work on |
|
293 | 377 | these as soon as we have time. |
|
294 | 378 | |
|
295 | 379 | |
|
296 | 380 | .. _version780: |
|
297 | 381 | |
|
298 | 382 | IPython 7.8.0 |
|
299 | 383 | ============= |
|
300 | 384 | |
|
301 | 385 | IPython 7.8.0 contain a few bugfix and 2 new APIs: |
|
302 | 386 | |
|
303 | 387 | - Enable changing the font color for LaTeX rendering :ghpull:`11840` |
|
304 | 388 | - and Re-Expose some PDB API (see below) |
|
305 | 389 | |
|
306 | 390 | Expose Pdb API |
|
307 | 391 | -------------- |
|
308 | 392 | |
|
309 | 393 | Expose the built-in ``pdb.Pdb`` API. ``Pdb`` constructor arguments are generically |
|
310 | 394 | exposed, regardless of python version. |
|
311 | 395 | Newly exposed arguments: |
|
312 | 396 | |
|
313 | 397 | - ``skip`` - Python 3.1+ |
|
314 | 398 | - ``nosiginnt`` - Python 3.2+ |
|
315 | 399 | - ``readrc`` - Python 3.6+ |
|
316 | 400 | |
|
317 | 401 | Try it out:: |
|
318 | 402 | |
|
319 | 403 | from IPython.terminal.debugger import TerminalPdb |
|
320 | 404 | pdb = TerminalPdb(skip=["skipthismodule"]) |
|
321 | 405 | |
|
322 | 406 | |
|
323 | 407 | See :ghpull:`11840` |
|
324 | 408 | |
|
325 | 409 | .. _version770: |
|
326 | 410 | |
|
327 | 411 | IPython 7.7.0 |
|
328 | 412 | ============= |
|
329 | 413 | |
|
330 | 414 | IPython 7.7.0 contain multiple bug fixes and documentation updates; Here are a |
|
331 | 415 | few of the outstanding issue fixed: |
|
332 | 416 | |
|
333 | 417 | - Fix a bug introduced in 7.6 where the ``%matplotlib`` magic would fail on |
|
334 | 418 | previously acceptable arguments :ghpull:`11814`. |
|
335 | 419 | - Fix the manage location on freebsd :ghpull:`11808`. |
|
336 | 420 | - Fix error message about aliases after ``%reset`` call in ipykernel |
|
337 | 421 | :ghpull:`11806` |
|
338 | 422 | - Fix Duplication completions in emacs :ghpull:`11803` |
|
339 | 423 | |
|
340 | 424 | We are planning to adopt `NEP29 <https://github.com/numpy/numpy/pull/14086>`_ |
|
341 | 425 | (still currently in draft) which may make this minor version of IPython the |
|
342 | 426 | last one to support Python 3.5 and will make the code base more aggressive |
|
343 | 427 | toward removing compatibility with older versions of Python. |
|
344 | 428 | |
|
345 | 429 | GitHub now support to give only "Triage" permissions to users; if you'd like to |
|
346 | 430 | help close stale issues and labels issues please reach to us with your GitHub |
|
347 | 431 | Username and we'll add you to the triage team. It is a great way to start |
|
348 | 432 | contributing and a path toward getting commit rights. |
|
349 | 433 | |
|
350 | 434 | .. _version761: |
|
351 | 435 | |
|
352 | 436 | IPython 7.6.1 |
|
353 | 437 | ============= |
|
354 | 438 | |
|
355 | 439 | IPython 7.6.1 contain a critical bugfix in the ``%timeit`` magic, which would |
|
356 | 440 | crash on some inputs as a side effect of :ghpull:`11716`. See :ghpull:`11812` |
|
357 | 441 | |
|
358 | 442 | |
|
359 | 443 | .. _whatsnew760: |
|
360 | 444 | |
|
361 | 445 | IPython 7.6.0 |
|
362 | 446 | ============= |
|
363 | 447 | |
|
364 | 448 | IPython 7.6.0 contains a couple of bug fixes and number of small features |
|
365 | 449 | additions as well as some compatibility with the current development version of |
|
366 | 450 | Python 3.8. |
|
367 | 451 | |
|
368 | 452 | - Add a ``-l`` option to :magic:`psearch` to list the available search |
|
369 | 453 | types. :ghpull:`11672` |
|
370 | 454 | - Support ``PathLike`` for ``DisplayObject`` and ``Image``. :ghpull:`11764` |
|
371 | 455 | - Configurability of timeout in the test suite for slow platforms. |
|
372 | 456 | :ghpull:`11756` |
|
373 | 457 | - Accept any casing for matplotlib backend. :ghpull:`121748` |
|
374 | 458 | - Properly skip test that requires numpy to be installed :ghpull:`11723` |
|
375 | 459 | - More support for Python 3.8 and positional only arguments (pep570) |
|
376 | 460 | :ghpull:`11720` |
|
377 | 461 | - Unicode names for the completion are loaded lazily on first use which |
|
378 | 462 | should decrease startup time. :ghpull:`11693` |
|
379 | 463 | - Autoreload now update the types of reloaded objects; this for example allow |
|
380 | 464 | pickling of reloaded objects. :ghpull:`11644` |
|
381 | 465 | - Fix a bug where ``%%time`` magic would suppress cell output. :ghpull:`11716` |
|
382 | 466 | |
|
383 | 467 | |
|
384 | 468 | Prepare migration to pytest (instead of nose) for testing |
|
385 | 469 | --------------------------------------------------------- |
|
386 | 470 | |
|
387 | 471 | Most of the work between 7.5 and 7.6 was to prepare the migration from our |
|
388 | 472 | testing framework to pytest. Most of the test suite should now work by simply |
|
389 | 473 | issuing ``pytest`` from the root of the repository. |
|
390 | 474 | |
|
391 | 475 | The migration to pytest is just at its beginning. Many of our test still rely |
|
392 | 476 | on IPython-specific plugins for nose using pytest (doctest using IPython syntax |
|
393 | 477 | is one example of this where test appear as "passing", while no code has been |
|
394 | 478 | ran). Many test also need to be updated like ``yield-test`` to be properly |
|
395 | 479 | parametrized tests. |
|
396 | 480 | |
|
397 | 481 | Migration to pytest allowed me to discover a number of issues in our test |
|
398 | 482 | suite; which was hiding a number of subtle issues βΒ or not actually running |
|
399 | 483 | some of the tests in our test suite β I have thus corrected many of those; like |
|
400 | 484 | improperly closed resources; or used of deprecated features. I also made use of |
|
401 | 485 | the ``pytest --durations=...`` to find some of our slowest test and speed them |
|
402 | 486 | up (our test suite can now be up to 10% faster). Pytest as also a variety of |
|
403 | 487 | plugins and flags which will make the code quality of IPython and the testing |
|
404 | 488 | experience better. |
|
405 | 489 | |
|
406 | 490 | Misc |
|
407 | 491 | ---- |
|
408 | 492 | |
|
409 | 493 | We skipped the release of 7.6 at the end of May, but will attempt to get back |
|
410 | 494 | on schedule. We are starting to think about making introducing backward |
|
411 | 495 | incompatible change and start the 8.0 series. |
|
412 | 496 | |
|
413 | 497 | Special Thanks to Gabriel (@gpotter2 on GitHub), who among other took care many |
|
414 | 498 | of the remaining task for 7.4 and 7.5, like updating the website. |
|
415 | 499 | |
|
416 | 500 | .. _whatsnew750: |
|
417 | 501 | |
|
418 | 502 | IPython 7.5.0 |
|
419 | 503 | ============= |
|
420 | 504 | |
|
421 | 505 | IPython 7.5.0 consist mostly of bug-fixes, and documentation updates, with one |
|
422 | 506 | minor new feature. The `Audio` display element can now be assigned an element |
|
423 | 507 | id when displayed in browser. See :ghpull:`11670` |
|
424 | 508 | |
|
425 | 509 | The major outstanding bug fix correct a change of behavior that was introduce |
|
426 | 510 | in 7.4.0 where some cell magics would not be able to access or modify global |
|
427 | 511 | scope when using the ``@needs_local_scope`` decorator. This was typically |
|
428 | 512 | encountered with the ``%%time`` and ``%%timeit`` magics. See :ghissue:`11659` |
|
429 | 513 | and :ghpull:`11698`. |
|
430 | 514 | |
|
431 | 515 | .. _whatsnew740: |
|
432 | 516 | |
|
433 | 517 | IPython 7.4.0 |
|
434 | 518 | ============= |
|
435 | 519 | |
|
436 | 520 | Unicode name completions |
|
437 | 521 | ------------------------ |
|
438 | 522 | |
|
439 | 523 | Previously, we provided completion for a unicode name with its relative symbol. |
|
440 | 524 | With this, now IPython provides complete suggestions to unicode name symbols. |
|
441 | 525 | |
|
442 | 526 | As on the PR, if user types ``\LAT<tab>``, IPython provides a list of |
|
443 | 527 | possible completions. In this case, it would be something like:: |
|
444 | 528 | |
|
445 | 529 | 'LATIN CAPITAL LETTER A', |
|
446 | 530 | 'LATIN CAPITAL LETTER B', |
|
447 | 531 | 'LATIN CAPITAL LETTER C', |
|
448 | 532 | 'LATIN CAPITAL LETTER D', |
|
449 | 533 | .... |
|
450 | 534 | |
|
451 | 535 | This help to type unicode character that do not have short latex aliases, and |
|
452 | 536 | have long unicode names. for example ``Ν°``, ``\GREEK CAPITAL LETTER HETA``. |
|
453 | 537 | |
|
454 | 538 | This feature was contributed by Luciana Marques :ghpull:`11583`. |
|
455 | 539 | |
|
456 | 540 | Make audio normalization optional |
|
457 | 541 | --------------------------------- |
|
458 | 542 | |
|
459 | 543 | Added 'normalize' argument to `IPython.display.Audio`. This argument applies |
|
460 | 544 | when audio data is given as an array of samples. The default of `normalize=True` |
|
461 | 545 | preserves prior behavior of normalizing the audio to the maximum possible range. |
|
462 | 546 | Setting to `False` disables normalization. |
|
463 | 547 | |
|
464 | 548 | |
|
465 | 549 | Miscellaneous |
|
466 | 550 | ------------- |
|
467 | 551 | |
|
468 | 552 | - Fix improper acceptation of ``return`` outside of functions. :ghpull:`11641`. |
|
469 | 553 | - Fixed PyQt 5.11 backwards incompatibility causing sip import failure. |
|
470 | 554 | :ghpull:`11613`. |
|
471 | 555 | - Fix Bug where ``type?`` would crash IPython. :ghpull:`1608`. |
|
472 | 556 | - Allow to apply ``@needs_local_scope`` to cell magics for convenience. |
|
473 | 557 | :ghpull:`11542`. |
|
474 | 558 | |
|
475 | 559 | .. _whatsnew730: |
|
476 | 560 | |
|
477 | 561 | IPython 7.3.0 |
|
478 | 562 | ============= |
|
479 | 563 | |
|
480 | 564 | .. _whatsnew720: |
|
481 | 565 | |
|
482 | 566 | IPython 7.3.0 bring several bug fixes and small improvements that you will |
|
483 | 567 | described bellow. |
|
484 | 568 | |
|
485 | 569 | The biggest change to this release is the implementation of the ``%conda`` and |
|
486 | 570 | ``%pip`` magics, that will attempt to install packages in the **current |
|
487 | 571 | environment**. You may still need to restart your interpreter or kernel for the |
|
488 | 572 | change to be taken into account, but it should simplify installation of packages |
|
489 | 573 | into remote environment. Installing using pip/conda from the command line is |
|
490 | 574 | still the prefer method. |
|
491 | 575 | |
|
492 | 576 | The ``%pip`` magic was already present, but was only printing a warning; now it |
|
493 | 577 | will actually forward commands to pip. |
|
494 | 578 | |
|
495 | 579 | Misc bug fixes and improvements: |
|
496 | 580 | |
|
497 | 581 | - Compatibility with Python 3.8. |
|
498 | 582 | - Do not expand shell variable in execution magics, and added the |
|
499 | 583 | ``no_var_expand`` decorator for magic requiring a similar functionality |
|
500 | 584 | :ghpull:`11516` |
|
501 | 585 | - Add ``%pip`` and ``%conda`` magic :ghpull:`11524` |
|
502 | 586 | - Re-initialize posix aliases after a ``%reset`` :ghpull:`11528` |
|
503 | 587 | - Allow the IPython command line to run ``*.ipynb`` files :ghpull:`11529` |
|
504 | 588 | |
|
505 | 589 | IPython 7.2.0 |
|
506 | 590 | ============= |
|
507 | 591 | |
|
508 | 592 | IPython 7.2.0 brings minor bugfixes, improvements, and new configuration options: |
|
509 | 593 | |
|
510 | 594 | - Fix a bug preventing PySide2 GUI integration from working :ghpull:`11464` |
|
511 | 595 | - Run CI on Mac OS ! :ghpull:`11471` |
|
512 | 596 | - Fix IPython "Demo" mode. :ghpull:`11498` |
|
513 | 597 | - Fix ``%run`` magic with path in name :ghpull:`11499` |
|
514 | 598 | - Fix: add CWD to sys.path *after* stdlib :ghpull:`11502` |
|
515 | 599 | - Better rendering of signatures, especially long ones. :ghpull:`11505` |
|
516 | 600 | - Re-enable jedi by default if it's installed :ghpull:`11506` |
|
517 | 601 | - Add New ``minimal`` exception reporting mode (useful for educational purpose). See :ghpull:`11509` |
|
518 | 602 | |
|
519 | 603 | |
|
520 | 604 | Added ability to show subclasses when using pinfo and other utilities |
|
521 | 605 | --------------------------------------------------------------------- |
|
522 | 606 | |
|
523 | 607 | When using ``?``/``??`` on a class, IPython will now list the first 10 subclasses. |
|
524 | 608 | |
|
525 | 609 | Special Thanks to Chris Mentzel of the Moore Foundation for this feature. Chris |
|
526 | 610 | is one of the people who played a critical role in IPython/Jupyter getting |
|
527 | 611 | funding. |
|
528 | 612 | |
|
529 | 613 | We are grateful for all the help Chris has given us over the years, |
|
530 | 614 | and we're now proud to have code contributed by Chris in IPython. |
|
531 | 615 | |
|
532 | 616 | OSMagics.cd_force_quiet configuration option |
|
533 | 617 | -------------------------------------------- |
|
534 | 618 | |
|
535 | 619 | You can set this option to force the %cd magic to behave as if ``-q`` was passed: |
|
536 | 620 | :: |
|
537 | 621 | |
|
538 | 622 | In [1]: cd / |
|
539 | 623 | / |
|
540 | 624 | |
|
541 | 625 | In [2]: %config OSMagics.cd_force_quiet = True |
|
542 | 626 | |
|
543 | 627 | In [3]: cd /tmp |
|
544 | 628 | |
|
545 | 629 | In [4]: |
|
546 | 630 | |
|
547 | 631 | See :ghpull:`11491` |
|
548 | 632 | |
|
549 | 633 | In vi editing mode, whether the prompt includes the current vi mode can now be configured |
|
550 | 634 | ----------------------------------------------------------------------------------------- |
|
551 | 635 | |
|
552 | 636 | Set the ``TerminalInteractiveShell.prompt_includes_vi_mode`` to a boolean value |
|
553 | 637 | (default: True) to control this feature. See :ghpull:`11492` |
|
554 | 638 | |
|
555 | 639 | .. _whatsnew710: |
|
556 | 640 | |
|
557 | 641 | IPython 7.1.0 |
|
558 | 642 | ============= |
|
559 | 643 | |
|
560 | 644 | IPython 7.1.0 is the first minor release after 7.0.0 and mostly brings fixes to |
|
561 | 645 | new features, internal refactoring, and fixes for regressions that happened during the 6.x->7.x |
|
562 | 646 | transition. It also brings **Compatibility with Python 3.7.1**, as we're |
|
563 | 647 | unwillingly relying on a bug in CPython. |
|
564 | 648 | |
|
565 | 649 | New Core Dev: |
|
566 | 650 | |
|
567 | 651 | - We welcome Jonathan Slenders to the commiters. Jonathan has done a fantastic |
|
568 | 652 | work on prompt_toolkit, and we'd like to recognise his impact by giving him |
|
569 | 653 | commit rights. :ghissue:`11397` |
|
570 | 654 | |
|
571 | 655 | Notable Changes |
|
572 | 656 | |
|
573 | 657 | - Major update of "latex to unicode" tab completion map (see below) |
|
574 | 658 | |
|
575 | 659 | Notable New Features: |
|
576 | 660 | |
|
577 | 661 | - Restore functionality and documentation of the **sphinx directive**, which |
|
578 | 662 | is now stricter (fail on error by daefault), has new configuration options, |
|
579 | 663 | has a brand new documentation page :ref:`ipython_directive` (which needs |
|
580 | 664 | some cleanup). It is also now *tested* so we hope to have less regressions. |
|
581 | 665 | :ghpull:`11402` |
|
582 | 666 | |
|
583 | 667 | - ``IPython.display.Video`` now supports ``width`` and ``height`` arguments, |
|
584 | 668 | allowing a custom width and height to be set instead of using the video's |
|
585 | 669 | width and height. :ghpull:`11353` |
|
586 | 670 | |
|
587 | 671 | - Warn when using ``HTML('<iframe>')`` instead of ``IFrame`` :ghpull:`11350` |
|
588 | 672 | |
|
589 | 673 | - Allow Dynamic switching of editing mode between vi/emacs and show |
|
590 | 674 | normal/input mode in prompt when using vi. :ghpull:`11390`. Use ``%config |
|
591 | 675 | TerminalInteractiveShell.editing_mode = 'vi'`` or ``%config |
|
592 | 676 | TerminalInteractiveShell.editing_mode = 'emacs'`` to dynamically switch |
|
593 | 677 | between modes. |
|
594 | 678 | |
|
595 | 679 | |
|
596 | 680 | Notable Fixes: |
|
597 | 681 | |
|
598 | 682 | - Fix entering of **multi-line blocks in terminal** IPython, and various |
|
599 | 683 | crashes in the new input transformation machinery :ghpull:`11354`, |
|
600 | 684 | :ghpull:`11356`, :ghpull:`11358`. These also fix a **Compatibility bug |
|
601 | 685 | with Python 3.7.1**. |
|
602 | 686 | |
|
603 | 687 | - Fix moving through generator stack in ipdb :ghpull:`11266` |
|
604 | 688 | |
|
605 | 689 | - %Magic command arguments now support quoting. :ghpull:`11330` |
|
606 | 690 | |
|
607 | 691 | - Re-add ``rprint`` and ``rprinte`` aliases. :ghpull:`11331` |
|
608 | 692 | |
|
609 | 693 | - Remove implicit dependency on ``ipython_genutils`` :ghpull:`11317` |
|
610 | 694 | |
|
611 | 695 | - Make ``nonlocal`` raise ``SyntaxError`` instead of silently failing in async |
|
612 | 696 | mode. :ghpull:`11382` |
|
613 | 697 | |
|
614 | 698 | - Fix mishandling of magics and ``= !`` assignment just after a dedent in |
|
615 | 699 | nested code blocks :ghpull:`11418` |
|
616 | 700 | |
|
617 | 701 | - Fix instructions for custom shortcuts :ghpull:`11426` |
|
618 | 702 | |
|
619 | 703 | |
|
620 | 704 | Notable Internals improvements: |
|
621 | 705 | |
|
622 | 706 | - Use of ``os.scandir`` (Python 3 only) to speed up some file system operations. |
|
623 | 707 | :ghpull:`11365` |
|
624 | 708 | |
|
625 | 709 | - use ``perf_counter`` instead of ``clock`` for more precise |
|
626 | 710 | timing results with ``%time`` :ghpull:`11376` |
|
627 | 711 | |
|
628 | 712 | Many thanks to all the contributors and in particular to ``bartskowron`` and |
|
629 | 713 | ``tonyfast`` who handled some pretty complicated bugs in the input machinery. We |
|
630 | 714 | had a number of first time contributors and maybe hacktoberfest participants that |
|
631 | 715 | made significant contributions and helped us free some time to focus on more |
|
632 | 716 | complicated bugs. |
|
633 | 717 | |
|
634 | 718 | You |
|
635 | 719 | can see all the closed issues and Merged PR, new features and fixes `here |
|
636 | 720 | <https://github.com/ipython/ipython/issues?utf8=%E2%9C%93&q=+is%3Aclosed+milestone%3A7.1+>`_. |
|
637 | 721 | |
|
638 | 722 | Unicode Completion update |
|
639 | 723 | ------------------------- |
|
640 | 724 | |
|
641 | 725 | In IPython 7.1 the Unicode completion map has been updated and synchronized with |
|
642 | 726 | the Julia language. |
|
643 | 727 | |
|
644 | 728 | Added and removed character characters: |
|
645 | 729 | |
|
646 | 730 | ``\jmath`` (``Θ·``), ``\\underleftrightarrow`` (U+034D, combining) have been |
|
647 | 731 | added, while ``\\textasciicaron`` have been removed |
|
648 | 732 | |
|
649 | 733 | Some sequences have seen their prefix removed: |
|
650 | 734 | |
|
651 | 735 | - 6 characters ``\text...<tab>`` should now be inputed with ``\...<tab>`` directly, |
|
652 | 736 | - 45 characters ``\Elz...<tab>`` should now be inputed with ``\...<tab>`` directly, |
|
653 | 737 | - 65 characters ``\B...<tab>`` should now be inputed with ``\...<tab>`` directly, |
|
654 | 738 | - 450 characters ``\m...<tab>`` should now be inputed with ``\...<tab>`` directly, |
|
655 | 739 | |
|
656 | 740 | Some sequences have seen their prefix shortened: |
|
657 | 741 | |
|
658 | 742 | - 5 characters ``\mitBbb...<tab>`` should now be inputed with ``\bbi...<tab>`` directly, |
|
659 | 743 | - 52 characters ``\mit...<tab>`` should now be inputed with ``\i...<tab>`` directly, |
|
660 | 744 | - 216 characters ``\mbfit...<tab>`` should now be inputed with ``\bi...<tab>`` directly, |
|
661 | 745 | - 222 characters ``\mbf...<tab>`` should now be inputed with ``\b...<tab>`` directly, |
|
662 | 746 | |
|
663 | 747 | A couple of characters had their sequence simplified: |
|
664 | 748 | |
|
665 | 749 | - ``Γ°``, type ``\dh<tab>``, instead of ``\eth<tab>`` |
|
666 | 750 | - ``Δ§``, type ``\hbar<tab>``, instead of ``\Elzxh<tab>`` |
|
667 | 751 | - ``ΙΈ``, type ``\ltphi<tab>``, instead of ``\textphi<tab>`` |
|
668 | 752 | - ``Ο΄``, type ``\varTheta<tab>``, instead of ``\textTheta<tab>`` |
|
669 | 753 | - ``β``, type ``\eulermascheroni<tab>``, instead of ``\Eulerconst<tab>`` |
|
670 | 754 | - ``β``, type ``\planck<tab>``, instead of ``\Planckconst<tab>`` |
|
671 | 755 | |
|
672 | 756 | - U+0336 (COMBINING LONG STROKE OVERLAY), type ``\strike<tab>``, instead of ``\Elzbar<tab>``. |
|
673 | 757 | |
|
674 | 758 | A couple of sequences have been updated: |
|
675 | 759 | |
|
676 | 760 | - ``\varepsilon`` now gives ``Ι`` (GREEK SMALL LETTER EPSILON) instead of ``Ξ΅`` (GREEK LUNATE EPSILON SYMBOL), |
|
677 | 761 | - ``\underbar`` now gives U+0331 (COMBINING MACRON BELOW) instead of U+0332 (COMBINING LOW LINE). |
|
678 | 762 | |
|
679 | 763 | |
|
680 | 764 | .. _whatsnew700: |
|
681 | 765 | |
|
682 | 766 | IPython 7.0.0 |
|
683 | 767 | ============= |
|
684 | 768 | |
|
685 | 769 | Released Thursday September 27th, 2018 |
|
686 | 770 | |
|
687 | 771 | IPython 7 includes major feature improvements. |
|
688 | 772 | This is also the second major version of IPython to support only |
|
689 | 773 | Python 3 βΒ starting at Python 3.4. Python 2 is still community-supported |
|
690 | 774 | on the bugfix only 5.x branch, but we remind you that Python 2 "end of life" |
|
691 | 775 | is on Jan 1st 2020. |
|
692 | 776 | |
|
693 | 777 | We were able to backport bug fixes to the 5.x branch thanks to our backport bot which |
|
694 | 778 | backported more than `70 Pull-Requests |
|
695 | 779 | <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 manual work. This is an area of the project where you can easily contribute by looking for `PRs that still need manual backport <https://github.com/ipython/ipython/issues?q=label%3A%22Still+Needs+Manual+Backport%22+is%3Aclosed+sort%3Aupdated-desc>`_ |
|
696 | 780 | |
|
697 | 781 | The IPython 6.x branch will likely not see any further release unless critical |
|
698 | 782 | bugs are found. |
|
699 | 783 | |
|
700 | 784 | Make sure you have pip > 9.0 before upgrading. You should be able to update by running: |
|
701 | 785 | |
|
702 | 786 | .. code:: |
|
703 | 787 | |
|
704 | 788 | pip install ipython --upgrade |
|
705 | 789 | |
|
706 | 790 | .. only:: ipydev |
|
707 | 791 | |
|
708 | 792 | If you are trying to install or update an ``alpha``, ``beta``, or ``rc`` |
|
709 | 793 | version, use pip ``--pre`` flag. |
|
710 | 794 | |
|
711 | 795 | .. code:: |
|
712 | 796 | |
|
713 | 797 | pip install ipython --upgrade --pre |
|
714 | 798 | |
|
715 | 799 | |
|
716 | 800 | Or, if you have conda installed: |
|
717 | 801 | |
|
718 | 802 | .. code:: |
|
719 | 803 | |
|
720 | 804 | conda install ipython |
|
721 | 805 | |
|
722 | 806 | |
|
723 | 807 | |
|
724 | 808 | Prompt Toolkit 2.0 |
|
725 | 809 | ------------------ |
|
726 | 810 | |
|
727 | 811 | IPython 7.0+ now uses ``prompt_toolkit 2.0``. If you still need to use an earlier |
|
728 | 812 | ``prompt_toolkit`` version, you may need to pin IPython to ``<7.0``. |
|
729 | 813 | |
|
730 | 814 | Autowait: Asynchronous REPL |
|
731 | 815 | --------------------------- |
|
732 | 816 | |
|
733 | 817 | Staring with IPython 7.0 on Python 3.6+, IPython can automatically ``await`` |
|
734 | 818 | top level code. You should not need to access an event loop or runner |
|
735 | 819 | yourself. To learn more, read the :ref:`autoawait` section of our docs, see |
|
736 | 820 | :ghpull:`11265`, or try the following code:: |
|
737 | 821 | |
|
738 | 822 | Python 3.6.0 |
|
739 | 823 | Type 'copyright', 'credits' or 'license' for more information |
|
740 | 824 | IPython 7.0.0 -- An enhanced Interactive Python. Type '?' for help. |
|
741 | 825 | |
|
742 | 826 | In [1]: import aiohttp |
|
743 | 827 | ...: result = aiohttp.get('https://api.github.com') |
|
744 | 828 | |
|
745 | 829 | In [2]: response = await result |
|
746 | 830 | <pause for a few 100s ms> |
|
747 | 831 | |
|
748 | 832 | In [3]: await response.json() |
|
749 | 833 | Out[3]: |
|
750 | 834 | {'authorizations_url': 'https://api.github.com/authorizations', |
|
751 | 835 | 'code_search_url': 'https://api.github.com/search/code?q={query}{&page,per_page,sort,order}', |
|
752 | 836 | ... |
|
753 | 837 | } |
|
754 | 838 | |
|
755 | 839 | .. note:: |
|
756 | 840 | |
|
757 | 841 | Async integration is experimental code, behavior may change or be removed |
|
758 | 842 | between Python and IPython versions without warnings. |
|
759 | 843 | |
|
760 | 844 | Integration is by default with `asyncio`, but other libraries can be configured -- |
|
761 | 845 | like ``curio`` or ``trio`` -- to improve concurrency in the REPL:: |
|
762 | 846 | |
|
763 | 847 | In [1]: %autoawait trio |
|
764 | 848 | |
|
765 | 849 | In [2]: import trio |
|
766 | 850 | |
|
767 | 851 | In [3]: async def child(i): |
|
768 | 852 | ...: print(" child %s goes to sleep"%i) |
|
769 | 853 | ...: await trio.sleep(2) |
|
770 | 854 | ...: print(" child %s wakes up"%i) |
|
771 | 855 | |
|
772 | 856 | In [4]: print('parent start') |
|
773 | 857 | ...: async with trio.open_nursery() as n: |
|
774 | 858 | ...: for i in range(3): |
|
775 | 859 | ...: n.spawn(child, i) |
|
776 | 860 | ...: print('parent end') |
|
777 | 861 | parent start |
|
778 | 862 | child 2 goes to sleep |
|
779 | 863 | child 0 goes to sleep |
|
780 | 864 | child 1 goes to sleep |
|
781 | 865 | <about 2 seconds pause> |
|
782 | 866 | child 2 wakes up |
|
783 | 867 | child 1 wakes up |
|
784 | 868 | child 0 wakes up |
|
785 | 869 | parent end |
|
786 | 870 | |
|
787 | 871 | See :ref:`autoawait` for more information. |
|
788 | 872 | |
|
789 | 873 | |
|
790 | 874 | Asynchronous code in a Notebook interface or any other frontend using the |
|
791 | 875 | Jupyter Protocol will require further updates to the IPykernel package. |
|
792 | 876 | |
|
793 | 877 | Non-Asynchronous code |
|
794 | 878 | ~~~~~~~~~~~~~~~~~~~~~ |
|
795 | 879 | |
|
796 | 880 | As the internal API of IPython is now asynchronous, IPython needs to run under |
|
797 | 881 | an event loop. In order to allow many workflows, (like using the :magic:`%run` |
|
798 | 882 | magic, or copy-pasting code that explicitly starts/stop event loop), when |
|
799 | 883 | top-level code is detected as not being asynchronous, IPython code is advanced |
|
800 | 884 | via a pseudo-synchronous runner, and may not advance pending tasks. |
|
801 | 885 | |
|
802 | 886 | Change to Nested Embed |
|
803 | 887 | ~~~~~~~~~~~~~~~~~~~~~~ |
|
804 | 888 | |
|
805 | 889 | The introduction of the ability to run async code had some effect on the |
|
806 | 890 | ``IPython.embed()`` API. By default, embed will not allow you to run asynchronous |
|
807 | 891 | code unless an event loop is specified. |
|
808 | 892 | |
|
809 | 893 | Effects on Magics |
|
810 | 894 | ~~~~~~~~~~~~~~~~~ |
|
811 | 895 | |
|
812 | 896 | Some magics will not work with async until they're updated. |
|
813 | 897 | Contributions welcome. |
|
814 | 898 | |
|
815 | 899 | Expected Future changes |
|
816 | 900 | ~~~~~~~~~~~~~~~~~~~~~~~ |
|
817 | 901 | |
|
818 | 902 | We expect more internal but public IPython functions to become ``async``, and |
|
819 | 903 | will likely end up having a persistent event loop while IPython is running. |
|
820 | 904 | |
|
821 | 905 | Thanks |
|
822 | 906 | ~~~~~~ |
|
823 | 907 | |
|
824 | 908 | This release took more than a year in the making. |
|
825 | 909 | The code was rebased a number of |
|
826 | 910 | times; leading to commit authorship that may have been lost in the final |
|
827 | 911 | Pull-Request. Huge thanks to many people for contribution, discussion, code, |
|
828 | 912 | documentation, use-cases: dalejung, danielballan, ellisonbg, fperez, gnestor, |
|
829 | 913 | minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many others. |
|
830 | 914 | |
|
831 | 915 | |
|
832 | 916 | Autoreload Improvement |
|
833 | 917 | ---------------------- |
|
834 | 918 | |
|
835 | 919 | The magic :magic:`%autoreload 2 <autoreload>` now captures new methods added to |
|
836 | 920 | classes. Earlier, only methods existing as of the initial import were being |
|
837 | 921 | tracked and updated. |
|
838 | 922 | |
|
839 | 923 | This new feature helps dual environment development - Jupyter+IDE - where the |
|
840 | 924 | code gradually moves from notebook cells to package files as it gets |
|
841 | 925 | structured. |
|
842 | 926 | |
|
843 | 927 | **Example**: An instance of the class ``MyClass`` will be able to access the |
|
844 | 928 | method ``cube()`` after it is uncommented and the file ``file1.py`` is saved on |
|
845 | 929 | disk. |
|
846 | 930 | |
|
847 | 931 | |
|
848 | 932 | .. code:: |
|
849 | 933 | |
|
850 | 934 | # notebook |
|
851 | 935 | |
|
852 | 936 | from mymodule import MyClass |
|
853 | 937 | first = MyClass(5) |
|
854 | 938 | |
|
855 | 939 | .. code:: |
|
856 | 940 | |
|
857 | 941 | # mymodule/file1.py |
|
858 | 942 | |
|
859 | 943 | class MyClass: |
|
860 | 944 | |
|
861 | 945 | def __init__(self, a=10): |
|
862 | 946 | self.a = a |
|
863 | 947 | |
|
864 | 948 | def square(self): |
|
865 | 949 | print('compute square') |
|
866 | 950 | return self.a*self.a |
|
867 | 951 | |
|
868 | 952 | # def cube(self): |
|
869 | 953 | # print('compute cube') |
|
870 | 954 | # return self.a*self.a*self.a |
|
871 | 955 | |
|
872 | 956 | |
|
873 | 957 | |
|
874 | 958 | |
|
875 | 959 | Misc |
|
876 | 960 | ---- |
|
877 | 961 | |
|
878 | 962 | The autoindent feature that was deprecated in 5.x was re-enabled and |
|
879 | 963 | un-deprecated in :ghpull:`11257` |
|
880 | 964 | |
|
881 | 965 | Make :magic:`%run -n -i ... <run>` work correctly. Earlier, if :magic:`%run` was |
|
882 | 966 | passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308` |
|
883 | 967 | |
|
884 | 968 | |
|
885 | 969 | The :cellmagic:`%%script` (as well as :cellmagic:`%%bash`, |
|
886 | 970 | :cellmagic:`%%ruby`... ) cell magics now raise by default if the return code of |
|
887 | 971 | the given code is non-zero (thus halting execution of further cells in a |
|
888 | 972 | notebook). The behavior can be disable by passing the ``--no-raise-error`` flag. |
|
889 | 973 | |
|
890 | 974 | |
|
891 | 975 | Deprecations |
|
892 | 976 | ------------ |
|
893 | 977 | |
|
894 | 978 | A couple of unused functions and methods have been deprecated and will be removed |
|
895 | 979 | in future versions: |
|
896 | 980 | |
|
897 | 981 | - ``IPython.utils.io.raw_print_err`` |
|
898 | 982 | - ``IPython.utils.io.raw_print`` |
|
899 | 983 | |
|
900 | 984 | |
|
901 | 985 | Backwards incompatible changes |
|
902 | 986 | ------------------------------ |
|
903 | 987 | |
|
904 | 988 | * The API for transforming input before it is parsed as Python code has been |
|
905 | 989 | completely redesigned: any custom input transformations will need to be |
|
906 | 990 | rewritten. See :doc:`/config/inputtransforms` for details of the new API. |
@@ -1,262 +1,262 b'' | |||
|
1 | 1 | #!/usr/bin/env python3 |
|
2 | 2 | # -*- coding: utf-8 -*- |
|
3 | 3 | """Setup script for IPython. |
|
4 | 4 | |
|
5 | 5 | Under Posix environments it works like a typical setup.py script. |
|
6 | 6 | Under Windows, the command sdist is not supported, since IPython |
|
7 | 7 | requires utilities which are not available under Windows.""" |
|
8 | 8 | |
|
9 | 9 | #----------------------------------------------------------------------------- |
|
10 | 10 | # Copyright (c) 2008-2011, IPython Development Team. |
|
11 | 11 | # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu> |
|
12 | 12 | # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de> |
|
13 | 13 | # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu> |
|
14 | 14 | # |
|
15 | 15 | # Distributed under the terms of the Modified BSD License. |
|
16 | 16 | # |
|
17 | 17 | # The full license is in the file COPYING.rst, distributed with this software. |
|
18 | 18 | #----------------------------------------------------------------------------- |
|
19 | 19 | |
|
20 | 20 | from __future__ import print_function |
|
21 | 21 | |
|
22 | 22 | import os |
|
23 | 23 | import sys |
|
24 | 24 | |
|
25 | 25 | # **Python version check** |
|
26 | 26 | # |
|
27 | 27 | # This check is also made in IPython/__init__, don't forget to update both when |
|
28 | 28 | # changing Python version requirements. |
|
29 | 29 | if sys.version_info < (3, 6): |
|
30 | 30 | pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.' |
|
31 | 31 | try: |
|
32 | 32 | import pip |
|
33 | 33 | pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]]) |
|
34 | 34 | if pip_version < (9, 0, 1) : |
|
35 | 35 | pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\ |
|
36 | 36 | 'pip {} detected.'.format(pip.__version__) |
|
37 | 37 | else: |
|
38 | 38 | # pip is new enough - it must be something else |
|
39 | 39 | pip_message = '' |
|
40 | 40 | except Exception: |
|
41 | 41 | pass |
|
42 | 42 | |
|
43 | 43 | |
|
44 | 44 | error = """ |
|
45 | 45 | IPython 7.10+ supports Python 3.6 and above, following NEP 29. |
|
46 | 46 | When using Python 2.7, please install IPython 5.x LTS Long Term Support version. |
|
47 | 47 | Python 3.3 and 3.4 were supported up to IPython 6.x. |
|
48 | 48 | Python 3.5 was supported with IPython 7.0 to 7.9. |
|
49 | 49 | |
|
50 | 50 | See IPython `README.rst` file for more information: |
|
51 | 51 | |
|
52 | 52 | https://github.com/ipython/ipython/blob/master/README.rst |
|
53 | 53 | |
|
54 | 54 | Python {py} detected. |
|
55 | 55 | {pip} |
|
56 | 56 | """.format(py=sys.version_info, pip=pip_message ) |
|
57 | 57 | |
|
58 | 58 | print(error, file=sys.stderr) |
|
59 | 59 | sys.exit(1) |
|
60 | 60 | |
|
61 | 61 | # At least we're on the python version we need, move on. |
|
62 | 62 | |
|
63 | 63 | # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly |
|
64 | 64 | # update it when the contents of directories change. |
|
65 | 65 | if os.path.exists('MANIFEST'): os.remove('MANIFEST') |
|
66 | 66 | |
|
67 | 67 | from distutils.core import setup |
|
68 | 68 | |
|
69 | 69 | # Our own imports |
|
70 | 70 | from setupbase import target_update |
|
71 | 71 | |
|
72 | 72 | from setupbase import ( |
|
73 | 73 | setup_args, |
|
74 | 74 | find_packages, |
|
75 | 75 | find_package_data, |
|
76 | 76 | check_package_data_first, |
|
77 | 77 | find_entry_points, |
|
78 | 78 | build_scripts_entrypt, |
|
79 | 79 | find_data_files, |
|
80 | 80 | git_prebuild, |
|
81 | 81 | install_symlinked, |
|
82 | 82 | install_lib_symlink, |
|
83 | 83 | install_scripts_for_symlink, |
|
84 | 84 | unsymlink, |
|
85 | 85 | ) |
|
86 | 86 | |
|
87 | 87 | isfile = os.path.isfile |
|
88 | 88 | pjoin = os.path.join |
|
89 | 89 | |
|
90 | 90 | #------------------------------------------------------------------------------- |
|
91 | 91 | # Handle OS specific things |
|
92 | 92 | #------------------------------------------------------------------------------- |
|
93 | 93 | |
|
94 | 94 | if os.name in ('nt','dos'): |
|
95 | 95 | os_name = 'windows' |
|
96 | 96 | else: |
|
97 | 97 | os_name = os.name |
|
98 | 98 | |
|
99 | 99 | # Under Windows, 'sdist' has not been supported. Now that the docs build with |
|
100 | 100 | # Sphinx it might work, but let's not turn it on until someone confirms that it |
|
101 | 101 | # actually works. |
|
102 | 102 | if os_name == 'windows' and 'sdist' in sys.argv: |
|
103 | 103 | print('The sdist command is not available under Windows. Exiting.') |
|
104 | 104 | sys.exit(1) |
|
105 | 105 | |
|
106 | 106 | |
|
107 | 107 | #------------------------------------------------------------------------------- |
|
108 | 108 | # Things related to the IPython documentation |
|
109 | 109 | #------------------------------------------------------------------------------- |
|
110 | 110 | |
|
111 | 111 | # update the manuals when building a source dist |
|
112 | 112 | if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'): |
|
113 | 113 | |
|
114 | 114 | # List of things to be updated. Each entry is a triplet of args for |
|
115 | 115 | # target_update() |
|
116 | 116 | to_update = [ |
|
117 | 117 | ('docs/man/ipython.1.gz', |
|
118 | 118 | ['docs/man/ipython.1'], |
|
119 | 119 | 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'), |
|
120 | 120 | ] |
|
121 | 121 | |
|
122 | 122 | |
|
123 | 123 | [ target_update(*t) for t in to_update ] |
|
124 | 124 | |
|
125 | 125 | #--------------------------------------------------------------------------- |
|
126 | 126 | # Find all the packages, package data, and data_files |
|
127 | 127 | #--------------------------------------------------------------------------- |
|
128 | 128 | |
|
129 | 129 | packages = find_packages() |
|
130 | 130 | package_data = find_package_data() |
|
131 | 131 | |
|
132 | 132 | data_files = find_data_files() |
|
133 | 133 | |
|
134 | 134 | setup_args['packages'] = packages |
|
135 | 135 | setup_args['package_data'] = package_data |
|
136 | 136 | setup_args['data_files'] = data_files |
|
137 | 137 | |
|
138 | 138 | #--------------------------------------------------------------------------- |
|
139 | 139 | # custom distutils commands |
|
140 | 140 | #--------------------------------------------------------------------------- |
|
141 | 141 | # imports here, so they are after setuptools import if there was one |
|
142 | 142 | from distutils.command.sdist import sdist |
|
143 | 143 | |
|
144 | 144 | setup_args['cmdclass'] = { |
|
145 | 145 | 'build_py': \ |
|
146 | 146 | check_package_data_first(git_prebuild('IPython')), |
|
147 | 147 | 'sdist' : git_prebuild('IPython', sdist), |
|
148 | 148 | 'symlink': install_symlinked, |
|
149 | 149 | 'install_lib_symlink': install_lib_symlink, |
|
150 | 150 | 'install_scripts_sym': install_scripts_for_symlink, |
|
151 | 151 | 'unsymlink': unsymlink, |
|
152 | 152 | } |
|
153 | 153 | |
|
154 | 154 | |
|
155 | 155 | #--------------------------------------------------------------------------- |
|
156 | 156 | # Handle scripts, dependencies, and setuptools specific things |
|
157 | 157 | #--------------------------------------------------------------------------- |
|
158 | 158 | |
|
159 | 159 | # For some commands, use setuptools. Note that we do NOT list install here! |
|
160 | 160 | # If you want a setuptools-enhanced install, just run 'setupegg.py install' |
|
161 | 161 | needs_setuptools = {'develop', 'release', 'bdist_egg', 'bdist_rpm', |
|
162 | 162 | 'bdist', 'bdist_dumb', 'bdist_wininst', 'bdist_wheel', |
|
163 | 163 | 'egg_info', 'easy_install', 'upload', 'install_egg_info', |
|
164 | 164 | } |
|
165 | 165 | |
|
166 | 166 | if len(needs_setuptools.intersection(sys.argv)) > 0: |
|
167 | 167 | import setuptools |
|
168 | 168 | |
|
169 | 169 | # This dict is used for passing extra arguments that are setuptools |
|
170 | 170 | # specific to setup |
|
171 | 171 | setuptools_extra_args = {} |
|
172 | 172 | |
|
173 | 173 | # setuptools requirements |
|
174 | 174 | |
|
175 | 175 | extras_require = dict( |
|
176 | 176 | parallel = ['ipyparallel'], |
|
177 | 177 | qtconsole = ['qtconsole'], |
|
178 | 178 | doc = ['Sphinx>=1.3'], |
|
179 | 179 | test = ['nose>=0.10.1', 'requests', 'testpath', 'pygments', 'nbformat', 'ipykernel', 'numpy>=1.14'], |
|
180 | 180 | terminal = [], |
|
181 | 181 | kernel = ['ipykernel'], |
|
182 | 182 | nbformat = ['nbformat'], |
|
183 | 183 | notebook = ['notebook', 'ipywidgets'], |
|
184 | 184 | nbconvert = ['nbconvert'], |
|
185 | 185 | ) |
|
186 | 186 | |
|
187 | 187 | install_requires = [ |
|
188 | 188 | 'setuptools>=18.5', |
|
189 | 189 | 'jedi>=0.10', |
|
190 | 190 | 'decorator', |
|
191 | 191 | 'pickleshare', |
|
192 | 192 | 'traitlets>=4.2', |
|
193 | 193 | 'prompt_toolkit>=2.0.0,<3.1.0,!=3.0.0,!=3.0.1', |
|
194 | 194 | 'pygments', |
|
195 | 195 | 'backcall', |
|
196 | 196 | ] |
|
197 | 197 | |
|
198 | 198 | # Platform-specific dependencies: |
|
199 | 199 | # This is the correct way to specify these, |
|
200 | 200 | # but requires pip >= 6. pip < 6 ignores these. |
|
201 | 201 | |
|
202 | 202 | extras_require.update({ |
|
203 | 203 | ':sys_platform != "win32"': ['pexpect'], |
|
204 | 204 | ':sys_platform == "darwin"': ['appnope'], |
|
205 | 205 | ':sys_platform == "win32"': ['colorama'], |
|
206 | 206 | }) |
|
207 | 207 | # FIXME: re-specify above platform dependencies for pip < 6 |
|
208 | 208 | # These would result in non-portable bdists. |
|
209 | 209 | if not any(arg.startswith('bdist') for arg in sys.argv): |
|
210 | 210 | if sys.platform == 'darwin': |
|
211 | 211 | install_requires.extend(['appnope']) |
|
212 | 212 | |
|
213 | 213 | if not sys.platform.startswith('win'): |
|
214 | 214 | install_requires.append('pexpect') |
|
215 | 215 | |
|
216 | 216 | # workaround pypa/setuptools#147, where setuptools misspells |
|
217 | 217 | # platform_python_implementation as python_implementation |
|
218 | 218 | if 'setuptools' in sys.modules: |
|
219 | 219 | for key in list(extras_require): |
|
220 | 220 | if 'platform_python_implementation' in key: |
|
221 | 221 | new_key = key.replace('platform_python_implementation', 'python_implementation') |
|
222 | 222 | extras_require[new_key] = extras_require.pop(key) |
|
223 | 223 | |
|
224 | 224 | everything = set() |
|
225 | 225 | for key, deps in extras_require.items(): |
|
226 | 226 | if ':' not in key: |
|
227 | 227 | everything.update(deps) |
|
228 | extras_require['all'] = everything | |
|
228 | extras_require['all'] = list(sorted(everything)) | |
|
229 | 229 | |
|
230 | 230 | if 'setuptools' in sys.modules: |
|
231 | 231 | setuptools_extra_args['python_requires'] = '>=3.6' |
|
232 | 232 | setuptools_extra_args['zip_safe'] = False |
|
233 | 233 | setuptools_extra_args['entry_points'] = { |
|
234 | 234 | 'console_scripts': find_entry_points(), |
|
235 | 235 | 'pygments.lexers': [ |
|
236 | 236 | 'ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer', |
|
237 | 237 | 'ipython = IPython.lib.lexers:IPythonLexer', |
|
238 | 238 | 'ipython3 = IPython.lib.lexers:IPython3Lexer', |
|
239 | 239 | ], |
|
240 | 240 | } |
|
241 | 241 | setup_args['extras_require'] = extras_require |
|
242 | 242 | setup_args['install_requires'] = install_requires |
|
243 | 243 | |
|
244 | 244 | else: |
|
245 | 245 | # scripts has to be a non-empty list, or install_scripts isn't called |
|
246 | 246 | setup_args['scripts'] = [e.split('=')[0].strip() for e in find_entry_points()] |
|
247 | 247 | |
|
248 | 248 | setup_args['cmdclass']['build_scripts'] = build_scripts_entrypt |
|
249 | 249 | |
|
250 | 250 | #--------------------------------------------------------------------------- |
|
251 | 251 | # Do the actual setup now |
|
252 | 252 | #--------------------------------------------------------------------------- |
|
253 | 253 | |
|
254 | 254 | setup_args.update(setuptools_extra_args) |
|
255 | 255 | |
|
256 | 256 | |
|
257 | 257 | |
|
258 | 258 | def main(): |
|
259 | 259 | setup(**setup_args) |
|
260 | 260 | |
|
261 | 261 | if __name__ == '__main__': |
|
262 | 262 | main() |
@@ -1,26 +1,22 b'' | |||
|
1 | 1 | #!/usr/bin/env python3 |
|
2 | 2 | """IPython release build script. |
|
3 | 3 | """ |
|
4 | 4 | import os |
|
5 | import sys | |
|
5 | 6 | from shutil import rmtree |
|
6 | 7 | |
|
7 | 8 | from toollib import sh, pjoin, get_ipdir, cd, sdists, buildwheels |
|
8 | 9 | |
|
9 | 10 | def build_release(): |
|
10 | 11 | |
|
11 | 12 | # Get main ipython dir, this will raise if it doesn't pass some checks |
|
12 | 13 | ipdir = get_ipdir() |
|
13 | 14 | cd(ipdir) |
|
14 | 15 | |
|
15 | # Cleanup | |
|
16 | for d in ['build', 'dist', pjoin('docs', 'build'), pjoin('docs', 'dist'), | |
|
17 | pjoin('docs', 'source', 'api', 'generated')]: | |
|
18 | if os.path.isdir(d): | |
|
19 | rmtree(d) | |
|
20 | ||
|
21 | 16 | # Build source and binary distros |
|
22 | 17 | sh(sdists) |
|
23 | 18 | buildwheels() |
|
19 | sh(' '.join([sys.executable, 'tools/retar.py', 'dist/*.gz'])) | |
|
24 | 20 | |
|
25 | 21 | if __name__ == '__main__': |
|
26 | 22 | build_release() |
@@ -1,22 +1,21 b'' | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | """Simple script to create a tarball with proper git info. |
|
3 | 3 | """ |
|
4 | 4 | |
|
5 | 5 | import subprocess |
|
6 | import os | |
|
7 | 6 | |
|
8 | 7 | from toollib import cd, sh |
|
9 | 8 | |
|
10 | 9 | tag = subprocess.check_output('git describe --tags', shell=True).decode('utf8', 'replace').strip() |
|
11 | 10 | base_name = 'ipython-%s' % tag |
|
12 | 11 | tar_name = '%s.tgz' % base_name |
|
13 | 12 | |
|
14 | 13 | # git archive is weird: Even if I give it a specific path, it still won't |
|
15 | 14 | # archive the whole tree. It seems the only way to get the whole tree is to cd |
|
16 | 15 | # to the top of the tree. There are long threads (since 2007) on the git list |
|
17 | 16 | # about this and it still doesn't work in a sensible way... |
|
18 | 17 | |
|
19 | 18 | cd('..') |
|
20 | 19 | git_tpl = 'git archive --format=tar --prefix={0}/ HEAD | gzip > {1}' |
|
21 | 20 | sh(git_tpl.format(base_name, tar_name)) |
|
22 | 21 | sh('mv {0} tools/'.format(tar_name)) |
@@ -1,96 +1,93 b'' | |||
|
1 | 1 | #!/usr/bin/env python3 |
|
2 | 2 | """IPython release script. |
|
3 | 3 | |
|
4 | 4 | This should ONLY be run at real release time. |
|
5 | 5 | """ |
|
6 | 6 | from __future__ import print_function |
|
7 | 7 | |
|
8 | 8 | import os |
|
9 | 9 | from glob import glob |
|
10 | 10 | from subprocess import call |
|
11 | 11 | import sys |
|
12 | 12 | |
|
13 | 13 | from toollib import (get_ipdir, pjoin, cd, execfile, sh, archive, |
|
14 | 14 | sdists, archive_user, archive_dir, buildwheels) |
|
15 | 15 | from gh_api import post_download |
|
16 | 16 | |
|
17 | 17 | # Get main ipython dir, this will raise if it doesn't pass some checks |
|
18 | 18 | ipdir = get_ipdir() |
|
19 | 19 | tooldir = pjoin(ipdir, 'tools') |
|
20 | 20 | distdir = pjoin(ipdir, 'dist') |
|
21 | 21 | |
|
22 | 22 | # Where I keep static backups of each release |
|
23 | 23 | ipbackupdir = os.path.expanduser('~/ipython/backup') |
|
24 | 24 | if not os.path.exists(ipbackupdir): |
|
25 | 25 | os.makedirs(ipbackupdir) |
|
26 | 26 | |
|
27 | 27 | # Start in main IPython dir |
|
28 | 28 | cd(ipdir) |
|
29 | 29 | |
|
30 | 30 | # Load release info |
|
31 | 31 | version = None |
|
32 | 32 | execfile(pjoin('IPython','core','release.py'), globals()) |
|
33 | 33 | |
|
34 | 34 | # Build site addresses for file uploads |
|
35 | 35 | release_site = '%s/release/%s' % (archive, version) |
|
36 | 36 | backup_site = '%s/backup/' % archive |
|
37 | 37 | |
|
38 | 38 | # Start actual release process |
|
39 | 39 | print() |
|
40 | 40 | print('Releasing IPython') |
|
41 | 41 | print('=================') |
|
42 | 42 | print() |
|
43 | 43 | print('Version:', version) |
|
44 | 44 | print() |
|
45 | 45 | print('Source IPython directory:', ipdir) |
|
46 | 46 | print() |
|
47 | 47 | |
|
48 | 48 | # Perform local backup, go to tools dir to run it. |
|
49 | 49 | cd(tooldir) |
|
50 | 50 | |
|
51 | 51 | if 'upload' in sys.argv: |
|
52 | 52 | cd(distdir) |
|
53 | 53 | |
|
54 | 54 | # do not upload OS specific files like .DS_Store |
|
55 | 55 | to_upload = glob('*.whl')+glob('*.tar.gz') |
|
56 | 56 | for fname in to_upload: |
|
57 | 57 | # TODO: update to GitHub releases API |
|
58 | 58 | continue |
|
59 | 59 | print('uploading %s to GitHub' % fname) |
|
60 | 60 | desc = "IPython %s source distribution" % version |
|
61 | 61 | post_download("ipython/ipython", fname, description=desc) |
|
62 | 62 | |
|
63 | 63 | # Make target dir if it doesn't exist |
|
64 | 64 | print('1. Uploading IPython to archive.ipython.org') |
|
65 | 65 | sh('ssh %s "mkdir -p %s/release/%s" ' % (archive_user, archive_dir, version)) |
|
66 | 66 | sh('scp *.tar.gz *.whl %s' % release_site) |
|
67 | 67 | |
|
68 | 68 | print('2. Uploading backup files...') |
|
69 | 69 | cd(ipbackupdir) |
|
70 | 70 | sh('scp `ls -1tr *tgz | tail -1` %s' % backup_site) |
|
71 | 71 | |
|
72 | 72 | print('3. Uploading to PyPI using twine') |
|
73 | 73 | cd(distdir) |
|
74 | 74 | call(['twine', 'upload'] + to_upload) |
|
75 | 75 | |
|
76 | 76 | else: |
|
77 | 77 | # Build, but don't upload |
|
78 | 78 | |
|
79 | 79 | # Make backup tarball |
|
80 | 80 | sh('./make_tarball.py') |
|
81 | 81 | sh('mv ipython-*.tgz %s' % ipbackupdir) |
|
82 | 82 | |
|
83 | 83 | # Build release files |
|
84 |
sh('./build_release |
|
|
84 | sh('./build_release') | |
|
85 | 85 | |
|
86 | 86 | cd(ipdir) |
|
87 | 87 | |
|
88 | # Upload all files | |
|
89 | sh(sdists) | |
|
90 | ||
|
91 | 88 | buildwheels() |
|
92 | 89 | print("`./release upload` to upload source distribution on PyPI and ipython archive") |
|
93 | 90 | sys.exit(0) |
|
94 | 91 | |
|
95 | 92 | |
|
96 | 93 |
@@ -1,178 +1,199 b'' | |||
|
1 | 1 | # Simple tool to help for release |
|
2 | 2 | # when releasing with bash, simple source it to get asked questions. |
|
3 | 3 | |
|
4 | 4 | # misc check before starting |
|
5 | 5 | |
|
6 | 6 | python -c 'import keyring' |
|
7 | 7 | python -c 'import twine' |
|
8 | 8 | python -c 'import sphinx' |
|
9 | 9 | python -c 'import sphinx_rtd_theme' |
|
10 | 10 | python -c 'import nose' |
|
11 | 11 | |
|
12 | 12 | |
|
13 | 13 | BLACK=$(tput setaf 1) |
|
14 | 14 | RED=$(tput setaf 1) |
|
15 | 15 | GREEN=$(tput setaf 2) |
|
16 | 16 | YELLOW=$(tput setaf 3) |
|
17 | 17 | BLUE=$(tput setaf 4) |
|
18 | 18 | MAGENTA=$(tput setaf 5) |
|
19 | 19 | CYAN=$(tput setaf 6) |
|
20 | 20 | WHITE=$(tput setaf 7) |
|
21 | 21 | NOR=$(tput sgr0) |
|
22 | 22 | |
|
23 | 23 | |
|
24 | 24 | echo -n "PREV_RELEASE (X.y.z) [$PREV_RELEASE]: " |
|
25 | 25 | read input |
|
26 | 26 | PREV_RELEASE=${input:-$PREV_RELEASE} |
|
27 | 27 | echo -n "MILESTONE (X.y) [$MILESTONE]: " |
|
28 | 28 | read input |
|
29 | 29 | MILESTONE=${input:-$MILESTONE} |
|
30 | 30 | echo -n "VERSION (X.y.z) [$VERSION]:" |
|
31 | 31 | read input |
|
32 | 32 | VERSION=${input:-$VERSION} |
|
33 | 33 | echo -n "BRANCH (master|X.y) [$BRANCH]:" |
|
34 | 34 | read input |
|
35 | 35 | BRANCH=${input:-$BRANCH} |
|
36 | 36 | |
|
37 | 37 | ask_section(){ |
|
38 | 38 | echo |
|
39 | 39 | echo $BLUE"$1"$NOR |
|
40 | 40 | echo -n $GREEN"Press Enter to continue, S to skip: "$NOR |
|
41 | 41 | read -n1 value |
|
42 | 42 | echo |
|
43 | 43 | if [ -z $value ] || [ $value = 'y' ] ; then |
|
44 | 44 | return 0 |
|
45 | 45 | fi |
|
46 | 46 | return 1 |
|
47 | 47 | } |
|
48 | 48 | |
|
49 | 49 | |
|
50 | 50 | |
|
51 | 51 | echo |
|
52 | 52 | if ask_section "Updating what's new with informations from docs/source/whatsnew/pr" |
|
53 | 53 | then |
|
54 | 54 | python tools/update_whatsnew.py |
|
55 | 55 | |
|
56 | 56 | echo |
|
57 | 57 | echo $BLUE"please move the contents of "docs/source/whatsnew/development.rst" to version-X.rst"$NOR |
|
58 | 58 | echo $GREEN"Press enter to continue"$NOR |
|
59 | 59 | read |
|
60 | 60 | fi |
|
61 | 61 | |
|
62 | 62 | if ask_section "Gen Stats, and authors" |
|
63 | 63 | then |
|
64 | 64 | |
|
65 | 65 | echo |
|
66 | 66 | echo $BLUE"here are all the authors that contributed to this release:"$NOR |
|
67 | 67 | git log --format="%aN <%aE>" $PREV_RELEASE... | sort -u -f |
|
68 | 68 | |
|
69 | 69 | echo |
|
70 | 70 | echo $BLUE"If you see any duplicates cancel (Ctrl-C), then edit .mailmap." |
|
71 | 71 | echo $GREEN"Press enter to continue:"$NOR |
|
72 | 72 | read |
|
73 | 73 | |
|
74 | 74 | echo $BLUE"generating stats"$NOR |
|
75 | 75 | python tools/github_stats.py --milestone $MILESTONE > stats.rst |
|
76 | 76 | |
|
77 | 77 | echo $BLUE"stats.rst files generated."$NOR |
|
78 | 78 | echo $GREEN"Please merge it with the right file (github-stats-X.rst) and commit."$NOR |
|
79 | 79 | echo $GREEN"press enter to continue."$NOR |
|
80 | 80 | read |
|
81 | 81 | |
|
82 | 82 | fi |
|
83 | 83 | |
|
84 | 84 | echo "Cleaning repository" |
|
85 | 85 | git clean -xfdi |
|
86 | 86 | |
|
87 | 87 | echo $GREEN"please update version number in ${RED}IPython/core/release.py${NOR} , Do not commit yet βΒ we'll do it later."$NOR |
|
88 | 88 | |
|
89 | 89 | echo $GREEN"Press enter to continue"$NOR |
|
90 | 90 | read |
|
91 | 91 | |
|
92 | 92 | if ask_section "Build the documentation ?" |
|
93 | 93 | then |
|
94 | 94 | make html -C docs |
|
95 | 95 | echo |
|
96 | 96 | echo $GREEN"Check the docs, press enter to continue"$NOR |
|
97 | 97 | read |
|
98 | 98 | |
|
99 | 99 | fi |
|
100 | 100 | |
|
101 | echo | |
|
102 | echo $BLUE"Attempting to build package..."$NOR | |
|
103 | ||
|
104 | tools/build_release | |
|
105 | rm dist/* | |
|
106 | ||
|
107 | 101 | if ask_section "Should we commit, tag, push... etc ? " |
|
108 | 102 | then |
|
109 | 103 | echo |
|
110 | 104 | echo $BLUE"Let's commit : git commit -am \"release $VERSION\" -S" |
|
111 | 105 | echo $GREEN"Press enter to commit"$NOR |
|
112 | 106 | read |
|
113 | 107 | git commit -am "release $VERSION" -S |
|
114 | 108 | |
|
115 | 109 | echo |
|
116 | 110 | echo $BLUE"git push origin \$BRANCH ($BRANCH)?"$NOR |
|
117 | 111 | echo $GREEN"Make sure you can push"$NOR |
|
118 | 112 | echo $GREEN"Press enter to continue"$NOR |
|
119 | 113 | read |
|
120 | 114 | git push origin $BRANCH |
|
121 | 115 | |
|
122 | 116 | echo |
|
123 | 117 | echo "Let's tag : git tag -am \"release $VERSION\" \"$VERSION\" -s" |
|
124 | 118 | echo $GREEN"Press enter to tag commit"$NOR |
|
125 | 119 | read |
|
126 | 120 | git tag -am "release $VERSION" "$VERSION" -s |
|
127 | 121 | |
|
128 | 122 | echo |
|
129 | 123 | echo $BLUE"And push the tag: git push origin \$VERSION ?"$NOR |
|
130 | 124 | echo $GREEN"Press enter to continue"$NOR |
|
131 | 125 | read |
|
132 | 126 | git push origin $VERSION |
|
133 | 127 | |
|
134 | 128 | |
|
135 | 129 | echo $GREEN"please update version number and back to .dev in ${RED}IPython/core/release.py" |
|
136 | 130 | echo ${BLUE}"Do not commit yet βΒ we'll do it later."$NOR |
|
137 | 131 | |
|
138 | 132 | echo $GREEN"Press enter to continue"$NOR |
|
139 | 133 | read |
|
140 | 134 | |
|
141 | 135 | echo |
|
142 | 136 | echo "Let's commit : "$BLUE"git commit -am \"back to dev\""$NOR |
|
143 | 137 | echo $GREEN"Press enter to commit"$NOR |
|
144 | 138 | read |
|
145 | 139 | git commit -am "back to dev" |
|
146 | 140 | |
|
147 | 141 | echo |
|
148 | 142 | echo $BLUE"git push origin \$BRANCH ($BRANCH)?"$NOR |
|
149 | 143 | echo $GREEN"Press enter to continue"$NOR |
|
150 | 144 | read |
|
151 | 145 | git push origin $BRANCH |
|
152 | 146 | |
|
153 | 147 | |
|
154 | 148 | echo |
|
155 | 149 | echo $BLUE"let's : git checkout $VERSION"$NOR |
|
156 | 150 | echo $GREEN"Press enter to continue"$NOR |
|
157 | 151 | read |
|
158 | 152 | git checkout $VERSION |
|
159 | 153 | fi |
|
160 | 154 | |
|
161 | 155 | if ask_section "Should we build and release ?" |
|
162 | 156 | then |
|
157 | ||
|
158 | echo $BLUE"going to set SOURCE_DATE_EPOCH"$NOR | |
|
159 | echo $BLUE'export SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)'$NOR | |
|
160 | echo $GREEN"Press enter to continue"$NOR | |
|
161 | read | |
|
162 | ||
|
163 | export SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD) | |
|
164 | ||
|
165 | echo $BLUE"SOURCE_DATE_EPOCH set to $SOURCE_DATE_EPOCH"$NOR | |
|
166 | echo $GREEN"Press enter to continue"$NOR | |
|
167 | read | |
|
168 | ||
|
169 | ||
|
170 | ||
|
171 | echo | |
|
172 | echo $BLUE"Attempting to build package..."$NOR | |
|
173 | ||
|
174 | tools/release | |
|
175 | ||
|
176 | ||
|
177 | echo $RED'$ shasum -a 256 dist/*' | |
|
178 | shasum -a 256 dist/* | |
|
179 | echo $NOR | |
|
180 | ||
|
181 | echo $BLUE"We are going to rebuild, node the hash above, and compare them to the rebuild"$NOR | |
|
182 | echo $GREEN"Press enter to continue"$NOR | |
|
183 | read | |
|
163 | 184 | |
|
164 | 185 | echo |
|
165 | 186 | echo $BLUE"Attempting to build package..."$NOR |
|
166 | 187 | |
|
167 | 188 | tools/release |
|
168 | 189 | |
|
169 | echo $RED | |
|
170 | echo '$ shasum -a 256 dist/*' | |
|
190 | echo $RED"Check the shasum for SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH" | |
|
191 | echo $RED'$ shasum -a 256 dist/*' | |
|
171 | 192 | shasum -a 256 dist/* |
|
172 | 193 | echo $NOR |
|
173 | 194 | |
|
174 | 195 | if ask_section "upload packages ?" |
|
175 | 196 | then |
|
176 | 197 | tools/release upload |
|
177 | 198 | fi |
|
178 | 199 | fi |
General Comments 0
You need to be logged in to leave comments.
Login now