##// END OF EJS Templates
Merge branch 'main' into main
Nelson Ferreira -
r27959:718af292 merge
parent child Browse files
Show More
@@ -1,90 +1,118
1 1 ## Triaging Issues
2 2
3 3 On the IPython repository, we strive to trust users and give them responsibility.
4 4 By using one of our bots, any user can close issues or add/remove
5 5 labels by mentioning the bot and asking it to do things on your behalf.
6 6
7 7 To close an issue (or PR), even if you did not create it, use the following:
8 8
9 9 > @meeseeksdev close
10 10
11 11 This command can be in the middle of another comment, but must start on its
12 12 own line.
13 13
14 14 To add labels to an issue, ask the bot to `tag` with a comma-separated list of
15 15 tags to add:
16 16
17 17 > @meeseeksdev tag windows, documentation
18 18
19 19 Only already pre-created tags can be added. So far, the list is limited to:
20 20 `async/await`, `backported`, `help wanted`, `documentation`, `notebook`,
21 21 `tab-completion`, `windows`
22 22
23 23 To remove a label, use the `untag` command:
24 24
25 25 > @meeseeksdev untag windows, documentation
26 26
27 27 We'll be adding additional capabilities for the bot and will share them here
28 28 when they are ready to be used.
29 29
30 30 ## Opening an Issue
31 31
32 32 When opening a new Issue, please take the following steps:
33 33
34 34 1. Search GitHub and/or Google for your issue to avoid duplicate reports.
35 35 Keyword searches for your error messages are most helpful.
36 36 2. If possible, try updating to main and reproducing your issue,
37 37 because we may have already fixed it.
38 38 3. Try to include a minimal reproducible test case.
39 39 4. Include relevant system information. Start with the output of:
40 40
41 41 python -c "import IPython; print(IPython.sys_info())"
42 42
43 43 And include any relevant package versions, depending on the issue, such as
44 44 matplotlib, numpy, Qt, Qt bindings (PyQt/PySide), tornado, web browser, etc.
45 45
46 46 ## Pull Requests
47 47
48 48 Some guidelines on contributing to IPython:
49 49
50 50 * All work is submitted via Pull Requests.
51 51 * Pull Requests can be submitted as soon as there is code worth discussing.
52 52 Pull Requests track the branch, so you can continue to work after the PR is submitted.
53 53 Review and discussion can begin well before the work is complete,
54 54 and the more discussion the better.
55 55 The worst case is that the PR is closed.
56 56 * Pull Requests should generally be made against main
57 57 * Pull Requests should be tested, if feasible:
58 58 - bugfixes should include regression tests.
59 59 - new behavior should at least get minimal exercise.
60 60 * New features and backwards-incompatible changes should be documented by adding
61 61 a new file to the [pr](docs/source/whatsnew/pr) directory, see [the README.md
62 62 there](docs/source/whatsnew/pr/README.md) for details.
63 63 * Don't make 'cleanup' pull requests just to change code style.
64 64 We don't follow any style guide strictly, and we consider formatting changes
65 65 unnecessary noise.
66 66 If you're making functional changes, you can clean up the specific pieces of
67 67 code you're working on.
68 68
69 [Travis](http://travis-ci.org/#!/ipython/ipython) does a pretty good job testing
70 IPython and Pull Requests, but it may make sense to manually perform tests,
69 [GitHub Actions](https://github.com/ipython/ipython/actions/workflows/test.yml) does
70 a pretty good job testing IPython and Pull Requests,
71 but it may make sense to manually perform tests,
71 72 particularly for PRs that affect `IPython.parallel` or Windows.
72 73
73 74 For more detailed information, see our [GitHub Workflow](https://github.com/ipython/ipython/wiki/Dev:-GitHub-workflow).
74 75
75 76 ## Running Tests
76 77
77 78 All the tests can be run by using
78 79 ```shell
79 80 pytest
80 81 ```
81 82
82 83 All the tests for a single module (for example **test_alias**) can be run by using the fully qualified path to the module.
83 84 ```shell
84 85 pytest IPython/core/tests/test_alias.py
85 86 ```
86 87
87 88 Only a single test (for example **test_alias_lifecycle**) within a single file can be run by adding the specific test after a `::` at the end:
88 89 ```shell
89 90 pytest IPython/core/tests/test_alias.py::test_alias_lifecycle
90 91 ```
92
93 ## Code style
94
95 * Before committing, run `darker -r 60625f241f298b5039cb2debc365db38aa7bb522 <file path>` to apply selective `black` formatting on modified regions using [darker](https://github.com/akaihola/darker).
96 * For newly added modules or refactors, please enable static typing analysis with `mypy` for the modified module by adding the file path in [`mypy.yml`](https://github.com/ipython/ipython/blob/main/.github/workflows/mypy.yml) workflow.
97 * As described in the pull requests section, please avoid excessive formatting changes; if a formatting-only commit is necessary, consider adding its hash to [`.git-blame-ignore-revs`](https://github.com/ipython/ipython/blob/main/.git-blame-ignore-revs) file.
98
99 ## Documentation
100
101 Sphinx documentation can be built locally using standard sphinx `make` commands. To build HTML documentation from the root of the project, execute:
102
103 ```shell
104 pip install -r docs/requirements.txt # only needed once
105 make -C docs/ html SPHINXOPTS="-W"
106 ```
107
108 To force update of the API documentation, precede the `make` command with:
109
110 ```shell
111 python3 docs/autogen_api.py
112 ```
113
114 Similarly, to force-update the configuration, run:
115
116 ```shell
117 python3 docs/autogen_config.py
118 ```
@@ -1,174 +1,174
1 1 .. image:: https://codecov.io/github/ipython/ipython/coverage.svg?branch=main
2 2 :target: https://codecov.io/github/ipython/ipython?branch=main
3 3
4 4 .. image:: https://img.shields.io/pypi/v/IPython.svg
5 5 :target: https://pypi.python.org/pypi/ipython
6 6
7 7 .. image:: https://github.com/ipython/ipython/actions/workflows/test.yml/badge.svg
8 :target: https://github.com/ipython/ipython/actions/workflows/test.yml)
8 :target: https://github.com/ipython/ipython/actions/workflows/test.yml
9 9
10 10 .. image:: https://www.codetriage.com/ipython/ipython/badges/users.svg
11 11 :target: https://www.codetriage.com/ipython/ipython/
12 12
13 13 .. image:: https://raster.shields.io/badge/Follows-NEP29-brightgreen.png
14 14 :target: https://numpy.org/neps/nep-0029-deprecation_policy.html
15 15
16 16 .. image:: https://tidelift.com/badges/package/pypi/ipython?style=flat
17 17 :target: https://tidelift.com/subscription/pkg/pypi-ipython
18 18
19 19
20 20 ===========================================
21 21 IPython: Productive Interactive Computing
22 22 ===========================================
23 23
24 24 Overview
25 25 ========
26 26
27 27 Welcome to IPython. Our full documentation is available on `ipython.readthedocs.io
28 28 <https://ipython.readthedocs.io/en/stable/>`_ and contains information on how to install, use, and
29 29 contribute to the project.
30 30 IPython (Interactive Python) is a command shell for interactive computing in multiple programming languages, originally developed for the Python programming language, that offers introspection, rich media, shell syntax, tab completion, and history.
31 31
32 32 **IPython versions and Python Support**
33 33
34 34 Starting with IPython 7.10, IPython follows `NEP 29 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`_
35 35
36 36 **IPython 7.17+** requires Python version 3.7 and above.
37 37
38 38 **IPython 7.10+** requires Python version 3.6 and above.
39 39
40 40 **IPython 7.0** requires Python version 3.5 and above.
41 41
42 42 **IPython 6.x** requires Python version 3.3 and above.
43 43
44 44 **IPython 5.x LTS** is the compatible release for Python 2.7.
45 45 If you require Python 2 support, you **must** use IPython 5.x LTS. Please
46 46 update your project configurations and requirements as necessary.
47 47
48 48
49 49 The Notebook, Qt console and a number of other pieces are now parts of *Jupyter*.
50 50 See the `Jupyter installation docs <https://jupyter.readthedocs.io/en/latest/install.html>`__
51 51 if you want to use these.
52 52
53 53 Main features of IPython
54 54 ========================
55 55 Comprehensive object introspection.
56 56
57 57 Input history, persistent across sessions.
58 58
59 59 Caching of output results during a session with automatically generated references.
60 60
61 61 Extensible tab completion, with support by default for completion of python variables and keywords, filenames and function keywords.
62 62
63 63 Extensible system of β€˜magic’ commands for controlling the environment and performing many tasks related to IPython or the operating system.
64 64
65 65 A rich configuration system with easy switching between different setups (simpler than changing $PYTHONSTARTUP environment variables every time).
66 66
67 67 Session logging and reloading.
68 68
69 69 Extensible syntax processing for special purpose situations.
70 70
71 71 Access to the system shell with user-extensible alias system.
72 72
73 73 Easily embeddable in other Python programs and GUIs.
74 74
75 75 Integrated access to the pdb debugger and the Python profiler.
76 76
77 77
78 78 Development and Instant running
79 79 ===============================
80 80
81 81 You can find the latest version of the development documentation on `readthedocs
82 82 <https://ipython.readthedocs.io/en/latest/>`_.
83 83
84 84 You can run IPython from this directory without even installing it system-wide
85 85 by typing at the terminal::
86 86
87 87 $ python -m IPython
88 88
89 89 Or see the `development installation docs
90 90 <https://ipython.readthedocs.io/en/latest/install/install.html#installing-the-development-version>`_
91 91 for the latest revision on read the docs.
92 92
93 93 Documentation and installation instructions for older version of IPython can be
94 94 found on the `IPython website <https://ipython.org/documentation.html>`_
95 95
96 96
97 97
98 98 IPython requires Python version 3 or above
99 99 ==========================================
100 100
101 101 Starting with version 6.0, IPython does not support Python 2.7, 3.0, 3.1, or
102 102 3.2.
103 103
104 104 For a version compatible with Python 2.7, please install the 5.x LTS Long Term
105 105 Support version.
106 106
107 107 If you are encountering this error message you are likely trying to install or
108 108 use IPython from source. You need to checkout the remote 5.x branch. If you are
109 109 using git the following should work::
110 110
111 111 $ git fetch origin
112 112 $ git checkout 5.x
113 113
114 114 If you encounter this error message with a regular install of IPython, then you
115 115 likely need to update your package manager, for example if you are using `pip`
116 116 check the version of pip with::
117 117
118 118 $ pip --version
119 119
120 120 You will need to update pip to the version 9.0.1 or greater. If you are not using
121 121 pip, please inquiry with the maintainers of the package for your package
122 122 manager.
123 123
124 124 For more information see one of our blog posts:
125 125
126 126 https://blog.jupyter.org/release-of-ipython-5-0-8ce60b8d2e8e
127 127
128 128 As well as the following Pull-Request for discussion:
129 129
130 130 https://github.com/ipython/ipython/pull/9900
131 131
132 132 This error does also occur if you are invoking ``setup.py`` directly – which you
133 133 should not – or are using ``easy_install`` If this is the case, use ``pip
134 134 install .`` instead of ``setup.py install`` , and ``pip install -e .`` instead
135 135 of ``setup.py develop`` If you are depending on IPython as a dependency you may
136 136 also want to have a conditional dependency on IPython depending on the Python
137 137 version::
138 138
139 139 install_req = ['ipython']
140 140 if sys.version_info[0] < 3 and 'bdist_wheel' not in sys.argv:
141 141 install_req.remove('ipython')
142 142 install_req.append('ipython<6')
143 143
144 144 setup(
145 145 ...
146 146 install_requires=install_req
147 147 )
148 148
149 149 Alternatives to IPython
150 150 =======================
151 151
152 152 IPython may not be to your taste; if that's the case there might be similar
153 153 project that you might want to use:
154 154
155 155 - The classic Python REPL.
156 156 - `bpython <https://bpython-interpreter.org/>`_
157 157 - `mypython <https://www.asmeurer.com/mypython/>`_
158 158 - `ptpython and ptipython <https://pypi.org/project/ptpython/>`_
159 159 - `Xonsh <https://xon.sh/>`_
160 160
161 161 Ignoring commits with git blame.ignoreRevsFile
162 162 ==============================================
163 163
164 164 As of git 2.23, it is possible to make formatting changes without breaking
165 165 ``git blame``. See the `git documentation
166 166 <https://git-scm.com/docs/git-config#Documentation/git-config.txt-blameignoreRevsFile>`_
167 167 for more details.
168 168
169 169 To use this feature you must:
170 170
171 171 - Install git >= 2.23
172 172 - Configure your local git repo by running:
173 173 - POSIX: ``tools\configure-git-blame-ignore-revs.sh``
174 174 - Windows: ``tools\configure-git-blame-ignore-revs.bat``
@@ -1,251 +1,252
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 pytest'
11 python -c 'import build'
11 12
12 13
13 14 BLACK=$(tput setaf 1)
14 15 RED=$(tput setaf 1)
15 16 GREEN=$(tput setaf 2)
16 17 YELLOW=$(tput setaf 3)
17 18 BLUE=$(tput setaf 4)
18 19 MAGENTA=$(tput setaf 5)
19 20 CYAN=$(tput setaf 6)
20 21 WHITE=$(tput setaf 7)
21 22 NOR=$(tput sgr0)
22 23
23 24
24 25 echo "Will use $BLUE'$EDITOR'$NOR to edit files when necessary"
25 26 echo -n "PREV_RELEASE (X.y.z) [$PREV_RELEASE]: "
26 27 read input
27 28 PREV_RELEASE=${input:-$PREV_RELEASE}
28 29 echo -n "MILESTONE (X.y) [$MILESTONE]: "
29 30 read input
30 31 MILESTONE=${input:-$MILESTONE}
31 32 echo -n "VERSION (X.y.z) [$VERSION]:"
32 33 read input
33 34 VERSION=${input:-$VERSION}
34 35 echo -n "BRANCH (main|X.y) [$BRANCH]:"
35 36 read input
36 37 BRANCH=${input:-$BRANCH}
37 38
38 39 ask_section(){
39 40 echo
40 41 echo $BLUE"$1"$NOR
41 42 echo -n $GREEN"Press Enter to continue, S to skip: "$NOR
42 43 if [ "$ZSH_NAME" = "zsh" ] ; then
43 44 read -k1 value
44 45 value=${value%$'\n'}
45 46 else
46 47 read -n1 value
47 48 fi
48 49 if [ -z "$value" ] || [ $value = 'y' ]; then
49 50 return 0
50 51 fi
51 52 return 1
52 53 }
53 54
54 55
55 56 maybe_edit(){
56 57 echo
57 58 echo $BLUE"$1"$NOR
58 59 echo -n $GREEN"Press ${BLUE}e$GREEN to Edit ${BLUE}$1$GREEN, any other keys to skip: "$NOR
59 60 if [ "$ZSH_NAME" = "zsh" ] ; then
60 61 read -k1 value
61 62 value=${value%$'\n'}
62 63 else
63 64 read -n1 value
64 65 fi
65 66
66 67 echo
67 68 if [ $value = 'e' ] ; then
68 69 $=EDITOR $1
69 70 fi
70 71 }
71 72
72 73
73 74
74 75 echo
75 76 if ask_section "Updating what's new with information from docs/source/whatsnew/pr"
76 77 then
77 78 python tools/update_whatsnew.py
78 79
79 80 echo
80 81 echo $BLUE"please move the contents of "docs/source/whatsnew/development.rst" to version-X.rst"$NOR
81 82 echo $GREEN"Press enter to continue"$NOR
82 83 read
83 84 fi
84 85
85 86 if ask_section "Gen Stats, and authors"
86 87 then
87 88
88 89 echo
89 90 echo $BLUE"here are all the authors that contributed to this release:"$NOR
90 91 git log --format="%aN <%aE>" $PREV_RELEASE... | sort -u -f
91 92
92 93 echo
93 94 echo $BLUE"If you see any duplicates cancel (Ctrl-C), then edit .mailmap."
94 95 echo $GREEN"Press enter to continue:"$NOR
95 96 read
96 97
97 98 echo $BLUE"generating stats"$NOR
98 99 python tools/github_stats.py --milestone $MILESTONE > stats.rst
99 100
100 101 echo $BLUE"stats.rst files generated."$NOR
101 102 echo $GREEN"Please merge it with the right file (github-stats-X.rst) and commit."$NOR
102 103 echo $GREEN"press enter to continue."$NOR
103 104 read
104 105
105 106 fi
106 107
107 108 if ask_section "Generate API difference (using frapuccino)"
108 109 then
109 110 echo $BLUE"Checking out $PREV_RELEASE"$NOR
110 111 git checkout $PREV_RELEASE
111 112 sleep 1
112 113 echo $BLUE"Saving API to file $PREV_RELEASE"$NOR
113 114 frappuccino IPython IPython.kernel IPython.lib IPython.qt IPython.lib.kernel IPython.html IPython.frontend IPython.external --save IPython-$PREV_RELEASE.json
114 115 echo $BLUE"coming back to $BRANCH"$NOR
115 116 git checkout $BRANCH
116 117 sleep 1
117 118 echo $BLUE"comparing ..."$NOR
118 119 frappuccino IPython IPython.kernel IPython.lib --compare IPython-$PREV_RELEASE.json
119 120 echo $GREEN"Use the above guideline to write an API changelog ..."$NOR
120 121 echo $GREEN"Press any keys to continue"$NOR
121 122 read
122 123 fi
123 124
124 125 echo "Cleaning repository"
125 126 git clean -xfdi
126 127
127 128 echo $GREEN"please update version number in ${RED}IPython/core/release.py${NOR} , Do not commit yet – we'll do it later."$NOR
128 129 echo $GREEN"I tried ${RED}sed -i bkp -e '/Uncomment/s/^# //g' IPython/core/release.py${NOR}"
129 130 sed -i bkp -e '/Uncomment/s/^# //g' IPython/core/release.py
130 131 rm IPython/core/release.pybkp
131 132 git diff | cat
132 133 maybe_edit IPython/core/release.py
133 134
134 135 echo $GREEN"Press enter to continue"$NOR
135 136 read
136 137
137 138 if ask_section "Build the documentation ?"
138 139 then
139 140 make html -C docs
140 141 echo
141 142 echo $GREEN"Check the docs, press enter to continue"$NOR
142 143 read
143 144
144 145 fi
145 146
146 147 if ask_section "Should we commit, tag, push... etc ? "
147 148 then
148 149 echo
149 150 echo $BLUE"Let's commit : git commit -am \"release $VERSION\" -S"
150 151 echo $GREEN"Press enter to commit"$NOR
151 152 read
152 153 git commit -am "release $VERSION" -S
153 154
154 155 echo
155 156 echo $BLUE"git push origin \$BRANCH ($BRANCH)?"$NOR
156 157 echo $GREEN"Make sure you can push"$NOR
157 158 echo $GREEN"Press enter to continue"$NOR
158 159 read
159 160 git push origin $BRANCH
160 161
161 162 echo
162 163 echo "Let's tag : git tag -am \"release $VERSION\" \"$VERSION\" -s"
163 164 echo $GREEN"Press enter to tag commit"$NOR
164 165 read
165 166 git tag -am "release $VERSION" "$VERSION" -s
166 167
167 168 echo
168 169 echo $BLUE"And push the tag: git push origin \$VERSION ?"$NOR
169 170 echo $GREEN"Press enter to continue"$NOR
170 171 read
171 172 git push origin $VERSION
172 173
173 174
174 175 echo $GREEN"please update version number and back to .dev in ${RED}IPython/core/release.py"
175 176 echo $GREEN"I tried ${RED}sed -i bkp -e '/Uncomment/s/^/# /g' IPython/core/release.py${NOR}"
176 177 sed -i bkp -e '/Uncomment/s/^/# /g' IPython/core/release.py
177 178 rm IPython/core/release.pybkp
178 179 git diff | cat
179 180 echo $GREEN"Please bump ${RED}the minor version number${NOR}"
180 181 maybe_edit IPython/core/release.py
181 182 echo ${BLUE}"Do not commit yet – we'll do it later."$NOR
182 183
183 184
184 185 echo $GREEN"Press enter to continue"$NOR
185 186 read
186 187
187 188 echo
188 189 echo "Let's commit : "$BLUE"git commit -am \"back to dev\""$NOR
189 190 echo $GREEN"Press enter to commit"$NOR
190 191 read
191 192 git commit -am "back to dev"
192 193
193 194 echo
194 195 echo $BLUE"git push origin \$BRANCH ($BRANCH)?"$NOR
195 196 echo $GREEN"Press enter to continue"$NOR
196 197 read
197 198 git push origin $BRANCH
198 199
199 200
200 201 echo
201 202 echo $BLUE"let's : git checkout $VERSION"$NOR
202 203 echo $GREEN"Press enter to continue"$NOR
203 204 read
204 205 git checkout $VERSION
205 206 fi
206 207
207 208 if ask_section "Should we build and release ?"
208 209 then
209 210
210 211 echo $BLUE"going to set SOURCE_DATE_EPOCH"$NOR
211 212 echo $BLUE'export SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)'$NOR
212 213 echo $GREEN"Press enter to continue"$NOR
213 214 read
214 215
215 216 export SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)
216 217
217 218 echo $BLUE"SOURCE_DATE_EPOCH set to $SOURCE_DATE_EPOCH"$NOR
218 219 echo $GREEN"Press enter to continue"$NOR
219 220 read
220 221
221 222
222 223
223 224 echo
224 225 echo $BLUE"Attempting to build package..."$NOR
225 226
226 227 tools/release
227 228
228 229
229 230 echo $RED'$ shasum -a 256 dist/*'
230 231 shasum -a 256 dist/*
231 232 echo $NOR
232 233
233 234 echo $BLUE"We are going to rebuild, node the hash above, and compare them to the rebuild"$NOR
234 235 echo $GREEN"Press enter to continue"$NOR
235 236 read
236 237
237 238 echo
238 239 echo $BLUE"Attempting to build package..."$NOR
239 240
240 241 tools/release
241 242
242 243 echo $RED"Check the shasum for SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH"
243 244 echo $RED'$ shasum -a 256 dist/*'
244 245 shasum -a 256 dist/*
245 246 echo $NOR
246 247
247 248 if ask_section "upload packages ?"
248 249 then
249 250 tools/release upload
250 251 fi
251 252 fi
General Comments 0
You need to be logged in to leave comments. Login now