django-auditlog/tox.ini
sebastianmanger 6414b7aedb
Let CI also check for missing migrations (#706)
* Refactor: re-arrange test application

This was triggered by the need to run "python manage.py", which is impossible when serving the whole project in the same directory as is configured in INSTALLED_APPS ("auditlog_tests"). This setup is heavily inspired by other jazzband projects.

* Add check for missing migrations
2025-03-19 19:58:43 +03:30

67 lines
1.3 KiB
INI

[tox]
envlist =
{py39,py310,py311}-django42
{py310,py311,py312}-django50
{py310,py311,py312,py313}-django51
{py312,py313}-djangomain
py39-docs
py39-lint
py39-checkmigrations
[testenv]
setenv =
COVERAGE_FILE={toxworkdir}/.coverage.{envname}
changedir = auditlog_tests
commands =
coverage run --source auditlog ./manage.py test
coverage xml
deps =
django42: Django>=4.2,<4.3
django50: Django>=5.0,<5.1
django51: Django>=5.1,<5.2
djangomain: https://github.com/django/django/archive/main.tar.gz
# Test requirements
coverage
codecov
freezegun
psycopg2-binary
passenv=
TEST_DB_HOST
TEST_DB_USER
TEST_DB_PASS
TEST_DB_NAME
TEST_DB_PORT
basepython =
py313: python3.13
py312: python3.12
py311: python3.11
py310: python3.10
py39: python3.9
[testenv:py39-docs]
changedir = docs/source
deps = -rdocs/requirements.txt
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
[testenv:py39-lint]
deps = pre-commit
commands =
pre-commit run --all-files
[testenv:py39-checkmigrations]
description = Check for missing migrations
changedir = auditlog_tests
deps =
Django>=4.2
psycopg2
commands =
python manage.py makemigrations --check --dry-run
[gh-actions]
python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313