We adopt PEP8 as the preferred code style.
We use pre-commit to check and format code automatically on every commit. The hook suite is defined in .pre-commit-config.yaml and includes:
- black (line length 79): formatter
- flake8: linter
- pylint: linter
- mypy: type checker
- pre-commit-hooks: trailing whitespace, encoding pragma, YAML/JSON/TOML checks, private key detection, etc.
Flake8 configuration lives in setup.cfg.
Install the development/test dependencies, then install the git hooks:
pip install pre-commit
pip install -r requirements-test.txt
pre-commit installAfter this, every git commit runs the checks automatically; commits that
fail the hooks are rejected (auto-fixing hooks such as black will rewrite
files — review and re-stage, then commit again).
To check the whole repository manually:
pre-commit run --all-files.github/workflows/pre-commit.yml runs pre-commit run --all-files on
every push and pull request, so code that bypasses the local hooks is still
blocked in CI.
The current implementation lives at the package root. Archived transitional suites are separated from current coverage:
python -m pytest tests --ignore=tests/legacy_1x -q
coverage run -m pytest tests --ignore=tests/legacy_1x
coverage report -m
python -m pytest tests/legacy_1x -q
python -m pytest tests -qPlain pytest runs both groups. The current and legacy groups also run as
separate jobs in .github/workflows/unit_test.yml.