Repository navigation
Expand file tree
/
Copy pathtox.ini
More file actions
148 lines (128 loc) · 3.74 KB
/
Copy pathtox.ini
File metadata and controls
148 lines (128 loc) · 3.74 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
[tox]
requires =
tox-uv>=1.0
tox-gh-actions>=3.0
env_list =
py{310,311,312,313}-numpy{1,2}
speedups
lint
pyrefly
mypy
basedpyright
ty
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]
pass_env = RUFF_OUTPUT_FORMAT
description = Lint with ruff
skip_install = true
deps = ruff>=0.15.0
commands =
ruff check stl tests
ruff format --check stl tests
# ── Type checking ────────────────────────────────────────────
# Checker versions are pinned for CI stability; bump deliberately.
[testenv:pyrefly]
description = Type-check with pyrefly
deps =
.
pyrefly==1.1.1
commands =
pyrefly check
[testenv:mypy]
description = Type-check with mypy
deps =
.
mypy==2.1.0
commands =
mypy
[testenv:basedpyright]
description = Type-check with basedpyright
deps =
.
basedpyright==1.39.9
commands =
basedpyright --pythonpath {envpython}
[testenv:ty]
description = Type-check with ty
deps =
.
ty==0.0.56
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
coverage lcov -o {toxworkdir}/coverage.lcov
[testenv:ruff-fix]
labels = fix
description = Apply the available Ruff fixes
skip_install = true
deps = ruff>=0.15.0
commands =
ruff check --fix --exit-zero stl tests
ruff format stl tests