-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathtox.ini
More file actions
91 lines (72 loc) · 2.26 KB
/
Copy pathtox.ini
File metadata and controls
91 lines (72 loc) · 2.26 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
85
86
87
88
89
90
91
[tox]
envlist = secrets,migrations,schema,ruff-check,ruff-isort,ruff-format
requires = tox-uv
skipsdist = true
[testenv]
passenv = *
basepython = python3.12
setenv =
OSIDB_DEBUG = 1
DJANGO_SETTINGS_MODULE=config.settings_local
DJANGO_SECRET_KEY = local
runner = uv-venv-runner
# Exists as a workaround to uv-venv-lock-runner running sync with --lock while we need --frozen.
# Set "commands_pre = " to prevent the sync (useful to environments that only require a small selection of packages)
commands_pre = uv sync --frozen --active
[testenv:queryset-tests]
commands =
pytest --no-cov -m "queryset" {posargs}
[testenv:unit-tests]
commands =
pytest -m "unit" {posargs}
[testenv:integration-tests]
commands =
pytest -m "integration" {posargs}
[testenv:tests]
commands =
pytest {posargs}
[testenv:tests-in-parallel]
commands =
pytest -n auto {posargs}
[testenv:record-new]
commands =
pytest --record-mode=once {posargs}
[testenv:record-rewrite]
commands =
pytest --record-mode=rewrite {posargs}
[testenv:rls]
commands =
pytest osidb/tests/test_rls.py apps/regulatory_reporting/tests/test_rls.py
[testenv:ci-osidb]
setenv =
{[testenv]setenv}
DJANGO_SETTINGS_MODULE=config.settings_ci
DJANGO_SECRET_KEY = ci
commands =
pytest
[testenv:mypy]
commands = mypy --html-report mypyreport --config-file .mypy.ini --exclude "^.*\b(migrations)\b.*$" --exclude "^.*\b(tests)\b.*$" osidb/ collectors/ apps/
[testenv:secrets]
commands_pre =
deps = detect-secrets==1.4.0
allowlist_externals = /usr/bin/bash
commands = /usr/bin/bash -c 'detect-secrets-hook --baseline .secrets.baseline $(git ls-files)'
[testenv:migrations]
allowlist_externals = /usr/bin/bash
commands = /usr/bin/bash -c './scripts/migrations-check.sh'
[testenv:schema-check]
setenv =
{[testenv]setenv}
allowlist_externals = /usr/bin/bash
commands = /usr/bin/bash -c './scripts/schema-check.sh'
[ruff]
ruff_version = ruff==0.12.3
[testenv:ruff-check]
commands_pre =
commands = uvx {[ruff]ruff_version} check --extend-ignore I osidb collectors apps
[testenv:ruff-isort]
commands_pre =
commands = uvx {[ruff]ruff_version} check --fix --diff --select I .
[testenv:ruff-format]
commands_pre =
commands = uvx {[ruff]ruff_version} format --check .