Show More
@@ -1,39 +1,40 b'' | |||||
1 | # This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
|
1 | # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
|
2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
3 |
|
3 | |||
4 | name: Python package |
|
4 | name: Python package | |
5 |
|
5 | |||
6 | permissions: |
|
6 | permissions: | |
7 | contents: read |
|
7 | contents: read | |
8 |
|
8 | |||
9 | on: |
|
9 | on: | |
10 | push: |
|
10 | push: | |
11 | branches: [ main, 7.x ] |
|
11 | branches: [ main, 7.x ] | |
12 | pull_request: |
|
12 | pull_request: | |
13 | branches: [ main, 7.x ] |
|
13 | branches: [ main, 7.x ] | |
14 |
|
14 | |||
15 | jobs: |
|
15 | jobs: | |
16 | formatting: |
|
16 | formatting: | |
17 |
|
17 | |||
18 | runs-on: ubuntu-latest |
|
18 | runs-on: ubuntu-latest | |
19 | timeout-minutes: 5 |
|
19 | timeout-minutes: 5 | |
20 | steps: |
|
20 | steps: | |
21 | - uses: actions/checkout@v3 |
|
21 | - uses: actions/checkout@v3 | |
22 | with: |
|
22 | with: | |
23 | fetch-depth: 0 |
|
23 | fetch-depth: 0 | |
24 | - name: Set up Python |
|
24 | - name: Set up Python | |
25 | uses: actions/setup-python@v4 |
|
25 | uses: actions/setup-python@v4 | |
26 | with: |
|
26 | with: | |
27 | python-version: 3.x |
|
27 | python-version: 3.x | |
28 | - name: Install dependencies |
|
28 | - name: Install dependencies | |
29 | run: | |
|
29 | run: | | |
30 | python -m pip install --upgrade pip |
|
30 | python -m pip install --upgrade pip | |
|
31 | # when changing the versions please update CONTRIBUTING.md too | |||
31 | pip install --only-binary ':all:' darker==1.5.1 black==22.10.0 |
|
32 | pip install --only-binary ':all:' darker==1.5.1 black==22.10.0 | |
32 | - name: Lint with darker |
|
33 | - name: Lint with darker | |
33 | run: | |
|
34 | run: | | |
34 | darker -r 60625f241f298b5039cb2debc365db38aa7bb522 --check --diff . || ( |
|
35 | darker -r 60625f241f298b5039cb2debc365db38aa7bb522 --check --diff . || ( | |
35 | echo "Changes need auto-formatting. Run:" |
|
36 | echo "Changes need auto-formatting. Run:" | |
36 | echo " darker -r 60625f241f298b5039cb2debc365db38aa7bb522" |
|
37 | echo " darker -r 60625f241f298b5039cb2debc365db38aa7bb522" | |
37 | echo "then commit and push changes to fix." |
|
38 | echo "then commit and push changes to fix." | |
38 | exit 1 |
|
39 | exit 1 | |
39 | ) |
|
40 | ) |
@@ -1,118 +1,117 b'' | |||||
1 | ## Triaging Issues |
|
1 | ## Triaging Issues | |
2 |
|
2 | |||
3 | On the IPython repository, we strive to trust users and give them responsibility. |
|
3 | On the IPython repository, we strive to trust users and give them responsibility. | |
4 | By using one of our bots, any user can close issues or add/remove |
|
4 | By using one of our bots, any user can close issues or add/remove | |
5 | labels by mentioning the bot and asking it to do things on your behalf. |
|
5 | labels by mentioning the bot and asking it to do things on your behalf. | |
6 |
|
6 | |||
7 | To close an issue (or PR), even if you did not create it, use the following: |
|
7 | To close an issue (or PR), even if you did not create it, use the following: | |
8 |
|
8 | |||
9 | > @meeseeksdev close |
|
9 | > @meeseeksdev close | |
10 |
|
10 | |||
11 | This command can be in the middle of another comment, but must start on its |
|
11 | This command can be in the middle of another comment, but must start on its | |
12 | own line. |
|
12 | own line. | |
13 |
|
13 | |||
14 | To add labels to an issue, ask the bot to `tag` with a comma-separated list of |
|
14 | To add labels to an issue, ask the bot to `tag` with a comma-separated list of | |
15 | tags to add: |
|
15 | tags to add: | |
16 |
|
16 | |||
17 | > @meeseeksdev tag windows, documentation |
|
17 | > @meeseeksdev tag windows, documentation | |
18 |
|
18 | |||
19 | Only already pre-created tags can be added. So far, the list is limited to: |
|
19 | Only already pre-created tags can be added. So far, the list is limited to: | |
20 | `async/await`, `backported`, `help wanted`, `documentation`, `notebook`, |
|
20 | `async/await`, `backported`, `help wanted`, `documentation`, `notebook`, | |
21 | `tab-completion`, `windows` |
|
21 | `tab-completion`, `windows` | |
22 |
|
22 | |||
23 | To remove a label, use the `untag` command: |
|
23 | To remove a label, use the `untag` command: | |
24 |
|
24 | |||
25 | > @meeseeksdev untag windows, documentation |
|
25 | > @meeseeksdev untag windows, documentation | |
26 |
|
26 | |||
27 | We'll be adding additional capabilities for the bot and will share them here |
|
27 | We'll be adding additional capabilities for the bot and will share them here | |
28 | when they are ready to be used. |
|
28 | when they are ready to be used. | |
29 |
|
29 | |||
30 | ## Opening an Issue |
|
30 | ## Opening an Issue | |
31 |
|
31 | |||
32 | When opening a new Issue, please take the following steps: |
|
32 | When opening a new Issue, please take the following steps: | |
33 |
|
33 | |||
34 | 1. Search GitHub and/or Google for your issue to avoid duplicate reports. |
|
34 | 1. Search GitHub and/or Google for your issue to avoid duplicate reports. | |
35 | Keyword searches for your error messages are most helpful. |
|
35 | Keyword searches for your error messages are most helpful. | |
36 | 2. If possible, try updating to main and reproducing your issue, |
|
36 | 2. If possible, try updating to main and reproducing your issue, | |
37 | because we may have already fixed it. |
|
37 | because we may have already fixed it. | |
38 | 3. Try to include a minimal reproducible test case. |
|
38 | 3. Try to include a minimal reproducible test case. | |
39 | 4. Include relevant system information. Start with the output of: |
|
39 | 4. Include relevant system information. Start with the output of: | |
40 |
|
40 | |||
41 | python -c "import IPython; print(IPython.sys_info())" |
|
41 | python -c "import IPython; print(IPython.sys_info())" | |
42 |
|
42 | |||
43 | And include any relevant package versions, depending on the issue, such as |
|
43 | And include any relevant package versions, depending on the issue, such as | |
44 | matplotlib, numpy, Qt, Qt bindings (PyQt/PySide), tornado, web browser, etc. |
|
44 | matplotlib, numpy, Qt, Qt bindings (PyQt/PySide), tornado, web browser, etc. | |
45 |
|
45 | |||
46 | ## Pull Requests |
|
46 | ## Pull Requests | |
47 |
|
47 | |||
48 | Some guidelines on contributing to IPython: |
|
48 | Some guidelines on contributing to IPython: | |
49 |
|
49 | |||
50 | * All work is submitted via Pull Requests. |
|
50 | * All work is submitted via Pull Requests. | |
51 | * Pull Requests can be submitted as soon as there is code worth discussing. |
|
51 | * Pull Requests can be submitted as soon as there is code worth discussing. | |
52 | Pull Requests track the branch, so you can continue to work after the PR is submitted. |
|
52 | Pull Requests track the branch, so you can continue to work after the PR is submitted. | |
53 | Review and discussion can begin well before the work is complete, |
|
53 | Review and discussion can begin well before the work is complete, | |
54 | and the more discussion the better. |
|
54 | and the more discussion the better. | |
55 | The worst case is that the PR is closed. |
|
55 | The worst case is that the PR is closed. | |
56 | * Pull Requests should generally be made against main |
|
56 | * Pull Requests should generally be made against main | |
57 | * Pull Requests should be tested, if feasible: |
|
57 | * Pull Requests should be tested, if feasible: | |
58 | - bugfixes should include regression tests. |
|
58 | - bugfixes should include regression tests. | |
59 | - new behavior should at least get minimal exercise. |
|
59 | - new behavior should at least get minimal exercise. | |
60 | * New features and backwards-incompatible changes should be documented by adding |
|
60 | * New features and backwards-incompatible changes should be documented by adding | |
61 | a new file to the [pr](docs/source/whatsnew/pr) directory, see [the README.md |
|
61 | a new file to the [pr](docs/source/whatsnew/pr) directory, see [the README.md | |
62 | there](docs/source/whatsnew/pr/README.md) for details. |
|
62 | there](docs/source/whatsnew/pr/README.md) for details. | |
63 | * Don't make 'cleanup' pull requests just to change code style. |
|
63 | * Don't make 'cleanup' pull requests just to change code style. | |
64 | We don't follow any style guide strictly, and we consider formatting changes |
|
64 | We don't follow any style guide strictly, and we consider formatting changes | |
65 | unnecessary noise. |
|
65 | unnecessary noise. | |
66 | If you're making functional changes, you can clean up the specific pieces of |
|
66 | If you're making functional changes, you can clean up the specific pieces of | |
67 | code you're working on. |
|
67 | code you're working on. | |
68 |
|
68 | |||
69 | [GitHub Actions](https://github.com/ipython/ipython/actions/workflows/test.yml) does |
|
69 | [GitHub Actions](https://github.com/ipython/ipython/actions/workflows/test.yml) does | |
70 | a pretty good job testing IPython and Pull Requests, |
|
70 | a pretty good job testing IPython and Pull Requests, | |
71 | but it may make sense to manually perform tests, |
|
71 | but it may make sense to manually perform tests, | |
72 | particularly for PRs that affect `IPython.parallel` or Windows. |
|
72 | particularly for PRs that affect `IPython.parallel` or Windows. | |
73 |
|
73 | |||
74 | For more detailed information, see our [GitHub Workflow](https://github.com/ipython/ipython/wiki/Dev:-GitHub-workflow). |
|
74 | For more detailed information, see our [GitHub Workflow](https://github.com/ipython/ipython/wiki/Dev:-GitHub-workflow). | |
75 |
|
75 | |||
76 | ## Running Tests |
|
76 | ## Running Tests | |
77 |
|
77 | |||
78 | All the tests can be run by using |
|
78 | All the tests can be run by using | |
79 | ```shell |
|
79 | ```shell | |
80 | pytest |
|
80 | pytest | |
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 | All the tests for a single module (for example **test_alias**) can be run by using the fully qualified path to the module. | |
84 | ```shell |
|
84 | ```shell | |
85 | pytest IPython/core/tests/test_alias.py |
|
85 | pytest IPython/core/tests/test_alias.py | |
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 | 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: | |
89 | ```shell |
|
89 | ```shell | |
90 | pytest IPython/core/tests/test_alias.py::test_alias_lifecycle |
|
90 | pytest IPython/core/tests/test_alias.py::test_alias_lifecycle | |
91 | ``` |
|
91 | ``` | |
92 |
|
92 | |||
93 | ## Code style |
|
93 | ## Code style | |
94 |
|
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). |
|
95 | * Before committing, run `darker -r 60625f241f298b5039cb2debc365db38aa7bb522 <file path>` to apply selective `black` formatting on modified regions using [darker](https://github.com/akaihola/darker)==1.5.1 and black==22.10.0 | |
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. |
|
96 | * 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 |
|
97 | |||
99 | ## Documentation |
|
98 | ## Documentation | |
100 |
|
99 | |||
101 | Sphinx documentation can be built locally using standard sphinx `make` commands. To build HTML documentation from the root of the project, execute: |
|
100 | Sphinx documentation can be built locally using standard sphinx `make` commands. To build HTML documentation from the root of the project, execute: | |
102 |
|
101 | |||
103 | ```shell |
|
102 | ```shell | |
104 | pip install -r docs/requirements.txt # only needed once |
|
103 | pip install -r docs/requirements.txt # only needed once | |
105 | make -C docs/ html SPHINXOPTS="-W" |
|
104 | make -C docs/ html SPHINXOPTS="-W" | |
106 | ``` |
|
105 | ``` | |
107 |
|
106 | |||
108 | To force update of the API documentation, precede the `make` command with: |
|
107 | To force update of the API documentation, precede the `make` command with: | |
109 |
|
108 | |||
110 | ```shell |
|
109 | ```shell | |
111 | python3 docs/autogen_api.py |
|
110 | python3 docs/autogen_api.py | |
112 | ``` |
|
111 | ``` | |
113 |
|
112 | |||
114 | Similarly, to force-update the configuration, run: |
|
113 | Similarly, to force-update the configuration, run: | |
115 |
|
114 | |||
116 | ```shell |
|
115 | ```shell | |
117 | python3 docs/autogen_config.py |
|
116 | python3 docs/autogen_config.py | |
118 | ``` |
|
117 | ``` |
General Comments 0
You need to be logged in to leave comments.
Login now