Skip to content

Commit 8540533

Browse files
committed
Expand the contributing guide.
1 parent 17ca15c commit 8540533

9 files changed

Lines changed: 116 additions & 44 deletions

doc-source/Source.rst

Lines changed: 0 additions & 41 deletions
This file was deleted.

doc-source/building.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ The recommended way to build from source is via tox_:
88

99
tox -e build
1010

11-
As well as build the sdist and wheel it will check them for common errors, such as missing files or potential rendering issues on PyPI_.
11+
As well as building the sdist and wheel this will check them for common errors,
12+
such as missing files or potential rendering issues on PyPI_.
1213

13-
The output files will be in the directory ``dist``.
14+
The output files will be in the ``dist`` directory.
1415

1516
If you wish, you may also use `pep517.build`_ or another :pep:`517`-compatible build tool.
1617

doc-source/documentation.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ Most projects have documentation generated with Sphinx_ and hosted on ReadTheDoc
77
.. _Sphinx: https://www.sphinx-doc.org/en/master/
88
.. _ReadTheDocs: https://readthedocs.org/
99

10+
The documentation source is located in the ``doc-source`` directory.
1011
A local copy of the documentation can be built with ``tox``:
1112

1213
.. prompt:: bash
1314

1415
tox -e docs
1516

16-
.. TODO:: repo-helper pycharm docs?
17+
The built documentation can be found in the ``doc-soure/build/html`` directory.
18+
19+
.. TODO:: changing the documentation configuration
81.9 KB
Loading

doc-source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ contributing
2121
tests
2222
documentation
2323
building
24+
release-process

doc-source/pull-request-labels.png

10.9 KB
Loading

doc-source/release-process.rst

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
================
2+
Release Process
3+
================
4+
5+
New releases are created using a combination of `repo-helper`_ and `GitHub Actions`_.
6+
To start you will need ``repo-helper`` installed:
7+
8+
.. prompt:: bash
9+
10+
python3 -m pip install repo-helper --upgrade
11+
12+
Then ensure all changes have been committed_ or stashed_:
13+
14+
.. prompt:: bash
15+
16+
git status
17+
18+
.. parsed-literal::
19+
20+
On branch master
21+
Your branch is up-to-date with 'origin/master'.
22+
23+
nothing to commit, working tree clean
24+
25+
26+
The create a release using `repo-helper release`_:
27+
28+
.. prompt:: bash
29+
30+
repo-helper release minor
31+
32+
Repleace ``minor`` with ``major`` or ``patch`` as appropriate.
33+
34+
Once the release has been created locally, push to GitHub. Ensure you push the tag too:
35+
36+
.. prompt:: bash
37+
38+
git push --tags
39+
40+
Once the tests pass GitHub Actions will take care of building and uploading to PyPI_
41+
and Anaconda_ (if enabled for the project).
42+
You should keep an eye on the tests to ensure they pass.
43+
44+
The release will be automatcally copied to `GitHub Releases`_ within the next two days using OctoCheese_
45+
46+
.. _repo-helper: https://docs.repo-helper.uk
47+
.. _GitHub Actions: https://github.com/features/actions
48+
.. _committed: https://git-scm.com/docs/git-commit
49+
.. _stashed: https://git-scm.com/docs/git-stash
50+
.. _repo-helper release: https://docs.repo-helper.uk/en/latest/usage/release.html
51+
.. _PyPI: https://pypi.org/
52+
.. _Anaconda: https://anaconda.org/domdfcoding/repo
53+
.. _GitHub Releases: https://docs.github.com/en/github/administering-a-repository/about-releases
54+
.. _OctoCheese: https://octocheese.readthedocs.io/en/latest/

doc-source/tests.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,56 @@ Coverage
6161

6262
.. TODO:: this section
6363
.. TODO:: coverage measurements in pull requests
64+
65+
On POSIX systems with Firefox_ installed an HTML coverage report can be generated by running:
66+
67+
.. prompt:: bash
68+
69+
tox -n cov
70+
71+
Ensure your changes do not cause a significant decrease in the test coverage.
72+
If the coverage drops below the level set in ``repo_helper.yml`` (or 80% not specified) the tests will fail.
73+
74+
.. _Firefox: https://www.mozilla.org/en-GB/firefox/
75+
76+
GitHub Actions
77+
-----------------
78+
79+
Tests are run on pushes to GitHub using `GitHub Actions`_.
80+
You can see the results of these test at the bottom of the pull request page:
81+
82+
.. figure:: github-actions-checks.png
83+
84+
A label will be added to the pull request automatically if the tests fail:
85+
86+
.. figure:: pull-request-labels
87+
88+
This makes it easy to identify which tests are failing.
89+
Once the tests pass the label will be removed automatically.
90+
91+
If you are a first time contributor to a project manual approval is required for GitHub Actions to run.
92+
For more information see https://github.blog/2021-04-22-github-actions-update-helping-maintainers-combat-bad-actors/
93+
94+
`Branch protection`_ is used to ensure the following tests pass before merging pull requests:
95+
96+
* Tests on Windows and Linux for all CPython version between 3.6 and 3.9 supported by the project.
97+
* Tests on Windows and Linux for PyPy 3.6, if supported by the project.
98+
* mypy type checking on Windows and Linux.
99+
* Flake8
100+
* The documentation check, if the project has documentation.
101+
102+
If the project only supports Linux the tests on Window will not run and are not required to merge the pull request.
103+
104+
Tests on macOS are optional as they take longer than other platforms.
105+
CPython 3.10 and PyPy 3.7 are considered experimental and will not block a pull request from being merged if they fail.
106+
However, you should still check the results of these runs to ensure your changes have not introduced any errors there.
107+
108+
You should check the :guilabel:`Files changed` tab of the pull request to see whether any issues have been identified.
109+
This can be due to syntax errors in the documentation source or issues identified by flake8 and Codefactor_.
110+
111+
Your pull request may be commented on by Coveralls_ to report any changes to the code coverage.
112+
113+
.. _GitHub Actions: https://github.com/features/actions
114+
.. _Branch protection: https://docs.github.com/en/github/administering-a-repository/about-protected-branches
115+
.. _Codefactor: https://www.codefactor.io/
116+
.. _Coveralls: https://coveralls.io/

repo_helper.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ extra_sphinx_extensions:
3131

3232
exclude_files:
3333
- contributing
34+
- Source_rst

0 commit comments

Comments
 (0)