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
32 changes: 32 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Contributing

## Running tests

Use Python 3.10 or newer. From the repository root, create a virtual environment:

```sh
python -m venv .venv
```

Activate it with `source .venv/bin/activate` on Linux or macOS, or
`.venv\Scripts\Activate.ps1` in Windows PowerShell. Then install the project and its
test dependencies:

```sh
python -m pip install -e ".[tests]"
```

Run the full suite, a single file, or tests matching a name:

```sh
python -m pytest
python -m pytest tests/test_number.py
python -m pytest 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 `python -m pytest -rs` to see skip reasons.

CI generates translation binaries and runs tests through [tox](../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