-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
42 lines (38 loc) · 1.06 KB
/
tox.ini
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
[tox]
requires =
tox>=4
env_list = type, lint, py{38, 39, 310, 311, 312}
[testenv]
description = run unit tests
allowlist_externals =
poetry
bash
./codacy-coverage-reporter
passenv =
CODACY_PROJECT_TOKEN
GITHUB_SHA
commands_pre =
poetry install --no-root --sync --with test -E ruff
commands =
poetry run pytest --cov --cov-report xml --cov-report term -vvv {posargs}
bash -c "curl -Ls -o codacy-coverage-reporter \"$(curl -Ls https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r '.assets | map({name, browser_download_url} | select(.name | contains(\"codacy-coverage-reporter-linux\"))) | .[0].browser_download_url')\""
bash -c "chmod +x codacy-coverage-reporter"
./codacy-coverage-reporter report -r coverage.xml
[testenv:type]
description = run type checks
deps =
mypy
commands =
mypy {posargs:.}
[testenv:lint]
description = lint source code
commands =
ruff check .
ruff format --check .
[gh]
python =
3.12 = py312
3.11 = py311, type
3.10 = py310
3.9 = py39
3.8 = py38