Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Contributing

## Running tests

Use [tox](https://tox.wiki/) from the repository root. It creates an isolated
environment and installs the project and its test dependencies:

```sh
python -m pip install tox
tox -e py
```

Pass pytest arguments after `--` to run a single file or tests matching a name:

```sh
tox -e py -- tests/test_number.py
tox -e py -- tests/test_number.py -k intcomma
```

Some localisation tests are skipped when compiled `.mo` translation files are missing.
Generate them with `scripts/generate-translation-binaries.sh`, which requires Bash and
GNU gettext's `msgfmt`. Translation-update tests also require `xgettext` and `msgmerge`.
Use `tox -e py -- -rs` to see skip reasons.

CI generates translation binaries and runs the
[configured tox environments](../tox.ini). See the [test workflow](workflows/test.yml)
for supported Python versions and platforms.

## Linting

Linting is run on the CI using [prek](https://prek.j178.dev//), and can be run locally:
Expand Down