Skip to content

Commit 1759c41

Browse files
authored
Expand instructions for contributions and releases (#69)
And use absolute links everywhere. This is because the page is viewable on both GitHub and on the website. Also the Python-Markdown parsing of link references is partly faulty, so avoid its quirks.
1 parent 021c190 commit 1759c41

File tree

3 files changed

+65
-27
lines changed

3 files changed

+65
-27
lines changed

CONTRIBUTING.md

Lines changed: 63 additions & 26 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
@@ -52,7 +52,7 @@ Note that for development you can just use [Hatch] directly as described below.
5252

5353
The main tool that is used for development is [Hatch]. It manages dependencies (in a virtualenv that is created on the fly) and is also the command runner.
5454

55-
So first, [install it][install Hatch]. Ideally in an isolated way with **`pipx install hatch`** (after [installing `pipx`]), or just `pip install hatch` as a more well-known way.
55+
So first, [install it](https://hatch.pypa.io/latest/install/#pip). Ideally in an isolated way with **`pipx install hatch`** (after [installing `pipx`](https://pypa.github.io/pipx/installation/)), or just `pip install hatch` as a more well-known way.
5656

5757
## Running all checks
5858

@@ -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](https://docs.astral.sh/ruff/), and all style settings are configured near the bottom of [`pyproject.toml`](https://github.com/ProperDocs/properdocs/blob/master/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](https://mypy-lang.org/) - also configured in [`pyproject.toml`](https://github.com/ProperDocs/properdocs/blob/master/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](https://github.com/ProperDocs/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`](https://github.com/ProperDocs/properdocs/blob/master/docs/about/release-notes.md), this will be written later.
148153

149154
### Submitting changes to the builtin themes
150155

@@ -177,20 +182,52 @@ 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`](https://github.com/ProperDocs/properdocs/blob/master/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`](https://github.com/ProperDocs/properdocs/blob/master/properdocs/__init__.py) files **and** writes down all user-visible changes since the previous version in [`release-notes.md`](https://github.com/ProperDocs/properdocs/blob/master/docs/about/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`](https://github.com/ProperDocs/properdocs/blob/master/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`](https://github.com/ProperDocs/properdocs/blob/master/properdocs/__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
183-
rooms, and mailing lists is expected to follow the [PyPA Code of Conduct].
227+
rooms, and mailing lists is expected to follow the [PSF Code of Conduct](https://www.python.org/psf/conduct/).
184228
185229
[virtualenv]: https://virtualenv.pypa.io/en/latest/user_guide.html
186230
[Hatch]: https://hatch.pypa.io/
187-
[install Hatch]: https://hatch.pypa.io/latest/install/#pip
188-
[installing `pipx`]: https://pypa.github.io/pipx/installation/
189231
[GitHub Actions]: https://docs.github.com/actions
190-
[PyPA Code of Conduct]: https://www.pypa.io/en/latest/code-of-conduct/
191232
[Translating Themes]: https://properdocs.org/dev-guide/translations/
192233
[Jinja's i18n extension]: https://jinja.palletsprojects.com/en/latest/extensions/#i18n-extension
193-
[Ruff]: https://docs.astral.sh/ruff/
194-
[Black]: https://black.readthedocs.io/
195-
[Isort]: https://pycqa.github.io/isort/
196-
[mypy]: https://mypy-lang.org/

properdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,4 @@ plugins:
7878

7979
watch:
8080
- properdocs
81+
- CONTRIBUTING.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)