-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathtox.ini
More file actions
84 lines (74 loc) · 1.95 KB
/
tox.ini
File metadata and controls
84 lines (74 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
[tox]
requires =
tox>=4.24.1
tox-uv>=1.21.1
envlist =
setup_services,
py312-{test,lint,mypy},
teardown_services
skipsdist = true
minversion = 4.11.0
[testenv]
runner = uv-venv-lock-runner
base_python = python3.12
allowlist_externals =
docker
alembic
[testenv:py312-test]
groups = test
passenv =
DATABASE_URL
REDIS_URL
PYTHONPATH
commands =
alembic upgrade head
# Run tests with explicit path and additional verbosity
python -m pytest --tb=short --durations=10 --cov=pyslackersweb/ --cov-report=term-missing --cov-report=term --junit-xml={envdir}/artifacts/test-results.xml {posargs:tests/}
depends =
setup_services
[testenv:py312-lint]
groups = lint
ignore_outcome = true
commands =
ruff format --check .
ruff check pyslackersweb tests migrations
[testenv:py312-mypy]
groups = typing
commands =
mypy . --ignore-missing-imports --install-types --non-interactive
[testenv:autoformat]
base_python = python3.12
groups = lint
commands =
ruff format .
[testenv:setup_services]
base_python = python3
skip_install = true
allowlist_externals = docker
passenv =
DATABASE_URL
REDIS_URL
setenv =
DATABASE_URL = postgres://pyslackersweb:pyslackersweb@postgresql:5432/pyslackersweb_dev
REDIS_URL = redis://redis:6379/0
commands =
docker compose --project-name pyslackersweb-test up --build -d postgresql redis
docker compose --project-name pyslackersweb-test exec postgresql bash -c 'until pg_isready -U pyslackersweb; do sleep 1; done;'
docker compose --project-name pyslackersweb-test up --build -d web
[testenv:teardown_services]
base_python = python3
skip_install = true
allowlist_externals = docker
commands =
docker compose down -v --remove-orphans
depends =
py312-test
[testenv:gen-requirements]
base_python = python3.12
skip_install = true
runner = virtualenv
allowlist_externals =
uv
sh
commands =
sh -c "uv export --no-hashes --format requirements-txt > requirements.txt"