-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
95 lines (83 loc) · 2.58 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
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
92
93
94
95
[tox]
env_list = py{3.11,3.12,3.13},format,lint,typecheck
skip_missing_interpreters = False
isolated_build = True
labels =
test = py3.12
test_oldest = py3.11
test_latest = py3.13
test_all = py{3.11,3.12,3.13}
static = lint,typecheck
check = lint,typecheck,py3.12
[testenv]
# Multi-env performance tweak based on https://hynek.me/articles/turbo-charge-tox/
package = wheel
wheel_build_env = .pkg
groups = dev
allowlist_externals = pytest
passenv =
CI
commands =
# Even the "slow" tests aren't absurdly slow, so default to running them
pytest {posargs} tests/
[testenv:load-test-models]
commands =
python -W "ignore:Note the async API is not yet stable:FutureWarning" -m tests.load_models
[testenv:unload-test-models]
commands =
python -W "ignore:Note the async API is not yet stable:FutureWarning" -m tests.unload_models
[testenv:coverage]
# Subprocess coverage based on https://hynek.me/articles/turbo-charge-tox/
allowlist_externals = coverage
set_env = COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
commands_pre = python -c 'import pathlib; pathlib.Path("{env_site_packages_dir}/cov.pth").write_text("import coverage; coverage.process_startup()")'
commands =
coverage run --parallel -m pytest {posargs} tests/
[testenv:format]
allowlist_externals = ruff
skip_install = true
commands =
ruff format {posargs} src/ tests/ sdk-schema/sync-sdk-schema.py
[testenv:lint]
allowlist_externals = ruff
skip_install = true
commands =
ruff check {posargs} src/ tests/
[testenv:typecheck]
allowlist_externals = mypy
commands =
mypy --strict {posargs} src/ tests/
[testenv:sync-sdk-schema]
allowlist_externals = python
groups = sync-sdk-schema
skip_install = true
commands =
python sdk-schema/sync-sdk-schema.py {posargs}
[testenv:docs]
groups =
deps = -r docs/requirements.txt
allowlist_externals = sphinx-build
commands =
sphinx-build -W -b dirhtml {posargs} docs/ docs/_build
[testenv:linkcheck]
groups =
deps = -r docs/requirements.txt
allowlist_externals = sphinx-build
commands =
sphinx-build -W -b linkcheck {posargs} docs/ docs/_build
[testenv:doctest]
# Doctest trick: change `...` to `..` in the expected test
# output to force test failures and see the actual results.
# (`...` is a placeholder for non-determistic output that
# can unfortunately hide real errors in the example output)
groups =
deps = -r docs/requirements.txt
allowlist_externals = sphinx-build
commands =
sphinx-build -W -b doctest {posargs} docs/ docs/_build
[gh]
python =
3.11 = py3.11
3.12 = py3.12
# Collect coverage stats on the newest version
3.13 = coverage