-
-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathtox.ini
More file actions
116 lines (100 loc) · 3.14 KB
/
Copy pathtox.ini
File metadata and controls
116 lines (100 loc) · 3.14 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
[tox]
requires =
tox-uv>=1.0
tox-gh-actions>=3.0
env_list =
py{310,311,312,313}-numpy{1,2}
speedups
lint
pyrefly
docs
docs-examples
coverage
skip_missing_interpreters = true
[gh-actions]
python =
3.10: py310
3.11: py311
3.12: py312
3.13: py313
# ── Test matrix ──────────────────────────────────────────────
[testenv]
description = Run tests under {basepython} with {envname}
deps =
.[tests]
numpy1: numpy>=1.24,<2
numpy2: numpy>=2,<3
commands =
pytest --basetemp={envtmpdir}/tmp --cov-report= {posargs}
set_env =
COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
# py313 + numpy1 is not supported
[testenv:py313-numpy1]
deps =
commands = python -c "print('SKIP: numpy 1.x does not support Python 3.13')"
# ── Speedups ────────────────────────────────────────────────
[testenv:speedups]
description = Run tests with the speedups C extension
basepython = python3.13
deps =
.[tests]
.[fast]
numpy>=2,<3
commands =
pytest --basetemp={envtmpdir}/tmp --cov-report= {posargs}
set_env =
COVERAGE_FILE = {toxworkdir}/.coverage.speedups
# ── Lint ─────────────────────────────────────────────────────
[testenv:lint]
description = Lint with ruff
skip_install = true
deps = ruff>=0.15.0
commands =
ruff check stl tests
ruff format --check stl tests
# ── Type checking ────────────────────────────────────────────
[testenv:pyrefly]
description = Type-check with pyrefly
deps =
.
pyrefly>=0.1
commands =
pyrefly check
[testenv:ty]
description = Type-check with ty (run explicitly: tox -e ty)
deps =
.
ty
commands =
ty check stl
# ── Docs ─────────────────────────────────────────────────────
[testenv:docs]
description = Build Sphinx documentation
deps = .[docs]
changedir = docs
commands =
sphinx-build -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
[testenv:docs-examples]
description = Run README and docs code samples in sandboxes
deps =
.[tests,docs]
matplotlib>=3.8
set_env =
NUMPY_STL_RUN_DOCS_EXAMPLES = 1
COVERAGE_FILE = {toxworkdir}/.coverage.docs-examples
commands =
pytest --basetemp={envtmpdir}/tmp --cov-report= tests/docs_examples
# ── Coverage ─────────────────────────────────────────────────
[testenv:coverage]
description = Combine coverage from test envs and enforce threshold
skip_install = true
deps = coverage>=7.0
depends =
py{310,311,312,313}-numpy{1,2}
speedups
docs-examples
set_env =
COVERAGE_FILE = {toxworkdir}/.coverage
commands =
coverage combine {toxworkdir}
coverage report --fail-under=100