Repository navigation
Expand file tree
/
Copy pathtox.ini
More file actions
155 lines (145 loc) · 6.74 KB
/
Copy pathtox.ini
File metadata and controls
155 lines (145 loc) · 6.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
149
150
151
152
153
154
155
[tox]
requires =
tox>=4.22
env_list =
py{310,311,312,313,314}-{core,opencv,albumentations,pillow,waterdroplet,skimage,diffusion,pybsm,hcipy,pyav,maite,tools,optional,doctests}
[testenv]
description = Run tests with pytest
skip_install = true
set_env =
; CPU-only so results don't depend on the runner's hardware. Adding -gpu to an
; env name (py313-diffusion-gpu) passes CUDA_VISIBLE_DEVICES through instead of
; blanking it; without that variable set a -gpu env is CPU-only like any other.
CUDA_VISIBLE_DEVICES =
gpu: CUDA_VISIBLE_DEVICES = {env:CUDA_VISIBLE_DEVICES:}
COVERAGE_FILE = .coverage.{envname}
PYTEST_ARGS = -n auto --junit-xml=".junit.{envname}.xml" -rfE --tb=short -q --no-header --disable-warnings
pass_env =
NUMBA_NUM_THREADS
PYTEST_ADDOPTS
dependency_groups =
tests
deps =
core: -e .
pybsm: -e .[pybsm]
hcipy: -e .[hcipy]
pillow: -e .[pillow]
opencv: -e .[headless]
skimage: -e .[skimage]
waterdroplet: -e .[waterdroplet]
albumentations: -e .[albumentations,headless]
diffusion: -e .[diffusion]
pyav: -e .[pyav]
maite: -e .[maite]
tools: -e .[maite,tools,pyav]
; all extras environments
optional,doctests,codeblock,precommit: -e .[pybsm,pillow,skimage,headless,waterdroplet,albumentations,diffusion,hcipy,pyav,maite,tools]
; The GPU runners are on driver 570 (CUDA 12.8). torch >=2.11 bundles a CUDA
; 13.0 runtime that needs driver >=580, so it reports no CUDA on a healthy
; card. 2.10.0 is the newest release whose wheel bundles CUDA 12.8.
; CI-only: users still resolve torch normally. Drop this once the runners
; move to a >=580 driver. See docs/development/system_requirements.rst.
gpu: torch==2.10.0
commands =
core: pytest {env:PYTEST_ARGS} -m "core"
pillow: pytest {env:PYTEST_ARGS} -m "pillow"
opencv: pytest {env:PYTEST_ARGS} -m "opencv and not albumentations"
skimage: pytest {env:PYTEST_ARGS} -m "skimage"
albumentations: pytest {env:PYTEST_ARGS} -m "albumentations and opencv"
diffusion: pytest {env:PYTEST_ARGS} -m "diffusion"
hcipy: pytest {env:PYTEST_ARGS} -m "hcipy"
pyav: pytest {env:PYTEST_ARGS} -m "pyav"
maite: pytest {env:PYTEST_ARGS} -m "maite and not tools"
tools: pytest {env:PYTEST_ARGS} -m "maite and tools"
; Uses numba (jit) compiler for parallelization, -n0 overrides -n auto.
pybsm: pytest {env:PYTEST_ARGS} -n0 -m "pybsm"
waterdroplet: pytest {env:PYTEST_ARGS} -n0 -m "waterdroplet"
; All extras installed, runs all non-notebook tests via the "optional"
; marker (auto-applied by conftest.py). Catches cross-test pollution
; (e.g. import guard tests breaking subsequent mock.patch tests) that
; per-extra envs miss because they partition tests into separate sessions.
optional: pytest {env:PYTEST_ARGS} -n0 -m "optional"
; Doctests and codeblocks require that all extras be installed, so this is the only time we run them
doctests: pytest {env:PYTEST_ARGS} --no-cov src/nrtk --doctest-modules
doctests: pytest {env:PYTEST_ARGS} --no-cov -n0 -m "codeblock" -o testpaths="**/*.rst **/*.md"
; Pyright tests on notebooks (tests/examples/test_notebooks.py::test_pyright_nb)
; Split into its own section to isolate the many version pins needed for pyright type resolution.
; These deps are intentionally kept here (not in pyproject.toml) to avoid resolution
; conflicts with the rest of the project — the tight pins (torch, ultralytics, etc.)
; are difficult for Poetry to resolve alongside other dependency groups.
[testenv:py{310,311,312,313,314}-notebooks]
deps =
-e .[pybsm,pillow,skimage,headless,waterdroplet,albumentations,diffusion,hcipy,pyav,maite]
; Keep a stable type-checker baseline for the existing notebooks.
pyright[nodejs]==1.1.397
jupytext>=1.16.7
; Packages below are required for pyright type resolution in notebooks
torchmetrics>=1.0.0
; 8.3.150 supports NumPy 1 and 2 and explicitly exports YOLO for notebook type checks.
ultralytics==8.3.150
; Pin pandas>=2.2.3 for Python 3.13 wheel support (2.2.2 has no py313 wheels)
pandas>=2.2.3
; Keep a stable Torch type-checking baseline; 2.10.0 has wheels for 3.10-3.14.
torch==2.10.0 # CVE-2025-3001; diffusion extra requires torch>=2.10.0
datamaite>=0.7.0
; No extra NumPy pin is needed; SMQTK, pybsm, and TrackEval have compatible requirements.
trackeval>=1.3.0
commands =
pytest {env:PYTEST_ARGS} -m "notebooks"
; Standalone env so it won't run with `tox` or `tox -f py310`.
; Run explicitly with: tox -e coverage
; Combines .coverage.* files, generates XML, and enforces the 90% threshold
; (JATIC SDP requirement).
; coverage[toml] is kept here (not in pyproject.toml) because this is a standalone
; CI utility env — no other env or developer workflow needs it as a direct dependency.
[testenv:coverage]
description = Combine coverage reports and enforce threshold
base_python = py310
skip_install = true
set_env =
COVERAGE_FILE = .coverage
dependency_groups =
deps =
coverage[toml]>=6.5.0
commands =
coverage combine --keep
coverage xml
coverage report --precision=2 --fail-under=90 --skip-covered --show-missing
; Standalone env so it won't run with `tox` or `tox -f py310`.
; Run explicitly with: tox -e papermill -- <notebook> <output>
; papermill and notebook are kept here (not in pyproject.toml) because this is a
; standalone CI utility env — no other env or developer workflow needs them.
[testenv:papermill]
description = Run notebooks via papermill (builds local wheel so notebooks install nrtk as if from PyPI)
base_python = py313
skip_install = true
set_env =
CUDA_VISIBLE_DEVICES = {env:CUDA_VISIBLE_DEVICES:}
# Disable tqdm progress bars to prevent cluttering rendered notebook output
TQDM_DISABLE = 1
deps =
build
nbstripout>=0.6.0
papermill>=2.4.0
notebook>=7.2.2
allowlist_externals = cp
commands_pre =
python -m build --wheel --outdir {envtmpdir}/dist
python -m pip install --no-deps --no-cache-dir --no-index --find-links {envtmpdir}/dist nrtk
# Use the repo's model to prevent the notebook downloading its own, which renders a
# download progress bar into the cell output.
cp -n {tox_root}/docs/examples/maite/yolo11n.pt {tox_root}/yolo11n.pt
commands =
papermill --progress-bar --stdout-file - --stderr-file - {posargs}
nbstripout --keep-output --keep-count {posargs}
; ─── Quality environments ───────────────────────────────────────────
; Standalone envs (not in env_list); run explicitly with tox -e <env>.
[testenv:precommit]
description = Run linting and formatting checks
base_python = py313
skip_install = true
dependency_groups =
linting
tests
commands =
pre-commit run --all-files