Skip to content

Commit e8aaa84

Browse files
committed
Expand instructions for contributions and releases
1 parent 021c190 commit e8aaa84

2 files changed

Lines changed: 67 additions & 20 deletions

File tree

CONTRIBUTING.md

Lines changed: 66 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ The ProperDocs project welcomes contributions from developers and
66
users in the open source community. Contributions can be made in a number of
77
ways, a few examples are:
88

9-
- Code patches via pull requests
10-
- Documentation improvements
11-
- Bug reports and patch reviews
9+
* Code patches via pull requests
10+
* Documentation improvements
11+
* Bug reports and patch reviews
1212

1313
For information about available communication channels please refer to the
1414
[README](https://github.com/properdocs/properdocs#readme) file in our
@@ -64,7 +64,7 @@ hatch run all
6464

6565
**This will encompass all of the checks mentioned below.**
6666

67-
All checks need to pass.
67+
All checks need to pass. If you make a pull request, [GitHub Actions] will also validate that all checks are passing.
6868

6969
### Running tests
7070

@@ -75,21 +75,19 @@ hatch run test:test
7575
hatch run integration:test
7676
```
7777

78-
It will attempt to run the tests against all of the Python versions we
79-
support. So don't be concerned if you are missing some. The rest
80-
will be verified by [GitHub Actions] when you submit a pull request.
78+
It will attempt to run the tests against all of the Python versions we support.
8179

8280
### Python code style
8381

84-
Python code within ProperDocs' code base is formatted using [Black] and [Isort] and lint-checked using [Ruff], all of which are configured in `pyproject.toml`.
82+
Python code within ProperDocs' code base is formatted using [Ruff], all of which are configured in [`pyproject.toml`].
8583

8684
You can automatically check and format the code according to these tools with the following command:
8785

8886
```bash
8987
hatch run style:fix
9088
```
9189

92-
The code is also type-checked using [mypy] - also configured in `pyproject.toml`, it can be run like this:
90+
The code is also type-checked using [mypy] - also configured in [`pyproject.toml`], it can be run like this:
9391

9492
```bash
9593
hatch run types:check
@@ -111,22 +109,29 @@ After making edits to files under the `docs/` dir, you can preview the site loca
111109
hatch run docs:serve
112110
```
113111

114-
Note that any 'WARNING' should be resolved before submitting a contribution.
112+
Note that any 'WARNING' should be resolved before submitting a contribution. This is also validated by GitHub Actions.
115113

116114
Documentation files are also checked by markdownlint, so you should run this as well:
117115

118116
```bash
119117
hatch run lint:check
120118
```
121119

122-
If you add a new plugin to properdocs.yml, you don't need to add it to any "requirements" file, because that is managed automatically.
120+
If you add a new plugin to properdocs.yml, you don't need to add it to any "requirements" file, because that is managed automatically via [hatch-properdocs].
123121

124-
> INFO: If you don't want to use Hatch, for documentation you can install requirements into a virtualenv, in one of these ways (with `.venv` being the virtualenv directory):
122+
> INFO: If you don't want to use Hatch, for documentation you can install requirements into a virtualenv, in **one of** these ways (with `.venv` being the virtualenv directory):
125123
>
126-
> ```bash
127-
> .venv/bin/pip install -r requirements/requirements-docs.txt # Exact versions of dependencies.
128-
> .venv/bin/pip install -r $(properdocs get-deps) # Latest versions of all dependencies.
129-
> ```
124+
> * Exact versions of dependencies:
125+
>
126+
> ```bash
127+
> .venv/bin/pip install -r requirements/requirements-docs.txt # .
128+
> ```
129+
>
130+
> * Latest versions of all dependencies:
131+
>
132+
> ```bash
133+
> .venv/bin/pip install -r $(properdocs get-deps) #
134+
> ```
130135
131136
## Translating themes
132137

@@ -144,7 +149,7 @@ most likely need to have tests and documentation if it is a new feature.
144149
When working with a pull request branch:
145150
Unless otherwise agreed, prefer `commit` over `amend`, and `merge` over `rebase`. Avoid force-pushes, otherwise review history is much harder to navigate. For the end result, the "unclean" history is fine because most pull requests are squash-merged on GitHub.
146151

147-
Do *not* add to *release-notes.md*, this will be written later.
152+
Do *not* add to [`release-notes.md`], this will be written later.
148153

149154
### Submitting changes to the builtin themes
150155

@@ -177,6 +182,45 @@ Contributors are not expected to provide translations with their changes to
177182
a theme's templates. However, they are expected to include an updated `pot`
178183
file so that everything is ready for translators to do their job.
179184

185+
### Merging policy
186+
187+
Pull requests should be merged as squash-merge. If a commit description is missing, try to incorporate it from the PR description.
188+
189+
Alternatively, pull requests can be merged as a merge commit, if the PR consists of many clean separate commits.
190+
191+
## Cutting a release
192+
193+
NOTE: First see additional important information in [`packages/README.md`].
194+
195+
In order to make a release of ProperDocs, do the following:
196+
197+
* Create a pull request that bumps the version in all [`__init__.py`] files **and** writes down all user-visible changes since the previous version in [`release-notes.md`].
198+
199+
* Changes specific to themes (if any) need separate headings, because they will go into separate releases. Search for `Version 1.6.7` as an example of this.
200+
201+
* After squash-merging that pull request, create a tag that exactly corresponds to that version number and push it:
202+
203+
```bash
204+
git tag v1.22.333
205+
git push origin v1.22.333
206+
```
207+
208+
* GitHub Actions will automatically produce a PyPI release for the main package.
209+
210+
But subpackages need to be released manually, if there were any changes to them. See [`packages/README.md`].
211+
212+
* Finally, make a release post at [GitHub releases](https://github.com/ProperDocs/properdocs/releases) - "Draft a new release".
213+
214+
Select the latest tag, don't enter any title, and copy the release notes into the description.
215+
216+
### Versioning policy
217+
218+
The specific version number in [`__init__.py`] consists of 3 components in sequence:
219+
220+
* Major - permanently at 1
221+
* Minor - bump for new features and possibly minor breaking changes (breaking changes only if they aren't expected to affect anyone OR there have been sufficient warnings in previous versions.)
222+
* Patch - bump for bugfixes and (rarely) reverts of something in the current minor release.
223+
180224
## Code of Conduct
181225

182226
Everyone interacting in the ProperDocs project's codebases, issue trackers, chat
@@ -191,6 +235,9 @@ rooms, and mailing lists is expected to follow the [PyPA Code of Conduct].
191235
[Translating Themes]: https://properdocs.org/dev-guide/translations/
192236
[Jinja's i18n extension]: https://jinja.palletsprojects.com/en/latest/extensions/#i18n-extension
193237
[Ruff]: https://docs.astral.sh/ruff/
194-
[Black]: https://black.readthedocs.io/
195-
[Isort]: https://pycqa.github.io/isort/
196238
[mypy]: https://mypy-lang.org/
239+
[hatch-properdocs]: https://github.com/ProperDocs/hatch-properdocs
240+
[`pyproject.toml`]: pyproject.toml
241+
[`__init__.py`]: properdocs/__init__.py
242+
[`release-notes.md`]: docs/about/release-notes.md
243+
[`packages/README.md`]: packages/README.md

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ dependencies = [
159159
]
160160
[tool.hatch.envs.lint.scripts]
161161
spelling = 'codespell properdocs docs *.* -S LC_MESSAGES -S "*.min.js" -S "lunr*.js" -S fontawesome-webfont.svg -S tinyseg.js -S "*.map"'
162-
markdown = "npm exec --yes -- markdownlint-cli README.md CONTRIBUTING.md docs/ --ignore docs/CNAME"
162+
markdown = "npm exec --yes -- markdownlint-cli README.md CONTRIBUTING.md packages/README.md docs/ --ignore docs/CNAME"
163163
js = "npm exec --yes -- jshint properdocs/"
164164
check = ["markdown", "js", "spelling"]
165165

0 commit comments

Comments
 (0)