2011-09-17 18:27:02 +00:00
|
|
|
[tox]
|
|
|
|
|
envlist =
|
2025-04-04 11:23:06 +00:00
|
|
|
lint
|
|
|
|
|
format
|
|
|
|
|
audit
|
2025-07-08 13:03:42 +00:00
|
|
|
# Python/Django combinations that are officially supported (minus end-of-life Pythons)
|
|
|
|
|
py{39,310,311,312}-django{42}
|
2025-04-04 11:23:06 +00:00
|
|
|
py{310,311,312,313}-django{51}
|
|
|
|
|
py{310,311,312,313}-django{52}
|
|
|
|
|
package
|
2020-12-03 22:53:57 +00:00
|
|
|
docs
|
2025-04-04 11:23:06 +00:00
|
|
|
clean
|
2011-09-17 18:27:02 +00:00
|
|
|
|
2022-03-06 17:01:13 +00:00
|
|
|
[gh-actions]
|
|
|
|
|
python =
|
|
|
|
|
3.9: py39
|
|
|
|
|
3.10: py310
|
2025-04-04 11:23:06 +00:00
|
|
|
3.11: py311
|
|
|
|
|
3.12: py312
|
|
|
|
|
3.13: py313
|
2022-03-06 17:01:13 +00:00
|
|
|
|
|
|
|
|
[gh-actions:env]
|
|
|
|
|
DJANGO =
|
2025-04-04 11:23:06 +00:00
|
|
|
4.2: django42
|
|
|
|
|
5.1: django51
|
|
|
|
|
5.2: django52
|
2022-03-06 17:01:13 +00:00
|
|
|
|
2011-09-17 18:27:02 +00:00
|
|
|
[testenv]
|
2020-04-14 20:21:20 +00:00
|
|
|
description = Unit tests
|
2015-04-20 21:59:19 +00:00
|
|
|
deps =
|
2022-03-06 17:01:13 +00:00
|
|
|
coverage[toml]
|
2020-11-29 21:27:16 +00:00
|
|
|
pytest-django
|
2025-04-04 11:23:06 +00:00
|
|
|
django42: Django>=4.2,<5.0
|
|
|
|
|
django51: Django>=5.1,<5.2
|
|
|
|
|
django52: Django>=5.2,<6.0
|
2020-04-14 20:21:20 +00:00
|
|
|
commands =
|
2022-03-06 17:01:13 +00:00
|
|
|
coverage run -m pytest {posargs}
|
2025-07-09 10:55:58 +00:00
|
|
|
coverage report
|
2020-11-25 19:56:03 +00:00
|
|
|
coverage xml
|
2017-10-15 17:46:44 +00:00
|
|
|
|
2025-04-04 11:23:06 +00:00
|
|
|
[testenv:audit]
|
|
|
|
|
description = Scan for vulnerable dependencies
|
|
|
|
|
skip_install = true
|
|
|
|
|
deps =
|
|
|
|
|
pip-audit
|
|
|
|
|
uv
|
|
|
|
|
commands =
|
|
|
|
|
uv export --no-emit-project --no-hashes -o requirements.txt -q
|
|
|
|
|
pip-audit {posargs:-r requirements.txt --progress-spinner off}
|
|
|
|
|
|
2020-12-03 22:53:57 +00:00
|
|
|
[testenv:bandit]
|
2020-04-14 20:21:20 +00:00
|
|
|
description = PyCQA security linter
|
2025-04-04 11:23:06 +00:00
|
|
|
skip_install = true
|
2022-03-06 17:01:13 +00:00
|
|
|
deps = bandit
|
2025-04-04 11:23:06 +00:00
|
|
|
commands = bandit {posargs:-r analytical} -v
|
|
|
|
|
|
|
|
|
|
[testenv:clean]
|
|
|
|
|
description = Clean up bytecode and build artifacts
|
|
|
|
|
skip_install = true
|
|
|
|
|
deps = pyclean
|
2025-07-08 11:24:32 +00:00
|
|
|
commands = pyclean {posargs:. --debris cache coverage package pytest mypy --erase requirements.txt uv.lock docs/_build/**/* docs/_build/ tests/unittests-report.xml --yes}
|
2019-04-08 19:50:10 +00:00
|
|
|
|
2020-12-03 22:53:57 +00:00
|
|
|
[testenv:docs]
|
2020-04-14 20:21:20 +00:00
|
|
|
description = Build the HTML documentation
|
2019-04-08 19:50:10 +00:00
|
|
|
deps = sphinx
|
2019-04-09 08:44:29 +00:00
|
|
|
commands = sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
|
2019-04-08 19:50:10 +00:00
|
|
|
|
2025-04-04 11:23:06 +00:00
|
|
|
[testenv:format]
|
|
|
|
|
description = Ensure consistent code style (Ruff)
|
|
|
|
|
skip_install = true
|
|
|
|
|
deps = ruff
|
|
|
|
|
commands = ruff format {posargs:--check --diff .}
|
2017-10-15 17:46:44 +00:00
|
|
|
|
2025-04-04 11:23:06 +00:00
|
|
|
[testenv:lint]
|
|
|
|
|
description = Lightening-fast linting (Ruff)
|
|
|
|
|
skip_install = true
|
|
|
|
|
deps = ruff
|
|
|
|
|
commands = ruff check {posargs:--output-format=full .}
|
2021-02-20 12:41:17 +00:00
|
|
|
|
2025-04-04 11:23:06 +00:00
|
|
|
[testenv:mypy]
|
|
|
|
|
description = Perform static type checking
|
|
|
|
|
deps = mypy
|
|
|
|
|
commands = mypy {posargs:.}
|
|
|
|
|
|
|
|
|
|
[testenv:package]
|
|
|
|
|
description = Build package and check metadata (or upload package)
|
|
|
|
|
skip_install = true
|
2022-03-06 17:01:13 +00:00
|
|
|
deps =
|
|
|
|
|
build
|
|
|
|
|
twine
|
2019-04-08 18:14:01 +00:00
|
|
|
commands =
|
2022-03-06 17:01:13 +00:00
|
|
|
python -m build
|
2025-04-04 11:23:06 +00:00
|
|
|
twine {posargs:check --strict} dist/*
|
|
|
|
|
passenv =
|
|
|
|
|
TWINE_USERNAME
|
|
|
|
|
TWINE_PASSWORD
|
|
|
|
|
TWINE_REPOSITORY_URL
|