forked from LiberTEM/LiberTEM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
226 lines (212 loc) · 7.38 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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
[tox]
envlist = py{39,310,311,312}{,-data}{,-nogpu}, notebooks
[testenv]
commands=
pytest --durations=10 --cov=libertem --cov-report=term --cov-report=html --cov-report=xml --cov-config=pyproject.toml --junitxml=junit.xml {posargs:tests/}
# win_tweaks.py depends on modules that are only available on Windows
pytest --doctest-modules --ignore=src/libertem/common/win_tweaks.py --ignore=src/libertem/analysis/fullmatch.py src/libertem/
deps=
-rtest_requirements.txt
# Inject release candidates for testing
-roverride_requirements.txt
cuda101: cupy-cuda101
cuda102: cupy-cuda102
cuda110: cupy-cuda110
cuda11x: cupy-cuda11x
cuda12x: cupy-cuda12x
extras=
bqplot
hdf5plugin
setenv=
# Using pytest in combination with tox on files that are part of the installed package
# leads to collisions between the local source tree and the installed package when running tests.
# See https://github.com/pytest-dev/pytest/issues/2042
PY_IGNORE_IMPORTMISMATCH=1
# Debug asyncio problems - has some perf overhead, so only enable if there is a problem
# PYTHONASYNCIODEBUG=1
# Dask configuration to reduce background load:
DASK_DISTRIBUTED__ADMIN__TICK__INTERVAL=1000
DASK_DISTRIBUTED__SCHEDULER__WORK_STEALING_INTERVAL=1000
DASK_DISTRIBUTED__WORKER__PROFILE__CYCLE=60000
DASK_DISTRIBUTED__WORKER__PROFILE__INTERVAL=30000
NUMBA_FULL_TRACEBACKS=1
NUMBA_BOUNDSCHECK=1
LIBERTEM_IO_HDF5_TIMEOUT_DEBUG=30
nogpu: CUDA_VISIBLE_DEVICES=""
passenv=
DASK_SCHEDULER_ADDRESS
TESTDATA_BASE_PATH
NUMBA_*
# HyperSpy expects this on Windows
PROGRAMFILES
RUNNER_ARCH
RUNNER_OS
uv_seed=True
[testenv:web_api]
commands=
pytest --durations=5 --cov=libertem --cov-report=term --cov-report=html --cov-report=xml --cov-config=pyproject.toml -m "web_api and not dist" --junitxml=junit.xml {posargs:tests/}
setenv=
PYTHONASYNCIODEBUG=1
{[testenv]setenv}
[testenv:numba_coverage]
commands=
pytest --durations=5 --cov=libertem --cov-report=term --cov-report=html --cov-report=xml --cov-config=pyproject.toml -m with_numba --junitxml=junit.xml {posargs:tests/}
setenv=
NUMBA_DISABLE_JIT=1
[testenv:py{39,310,311,312}-data,py{39,310,311,312}-data-cuda{101,102,110,11x,12x}]
deps=
-rtest_requirements.txt
# because tox first installs the dependencies listed here, without taking
# our package dependencies into account, we need to repeat the numbab
# version constraints here:
py{39}-data: numba>=0.53
py{310}-data: numba>=0.55
py{311}-data: numba>=0.57
py{312}-data: numba>=0.59
hyperspy
py{311,312}-data,py{311,312}-data-cuda{101,102,110,11x,12x}: orix
stemtool
mrcfile
py{311,312}-data,py{311,312}-data-cuda{101,102,110,11x,12x}: rosettasciio
pims
scikit-image
pint<0.20
py{39,310,311,312}-data-cuda101: cupy-cuda101
py{39,310,311,312}-data-cuda102: cupy-cuda102
py{39,310,311,312}-data-cuda110: cupy-cuda110
py{39,310,311,312}-data-cuda11x: cupy-cuda11x
py{39,310,311,312}-data-cuda12x: cupy-cuda12x
commands=
pytest --durations=10 --cov=libertem --cov-report=term --cov-report=html --cov-report=xml --cov-config=pyproject.toml --junitxml=junit.xml tests/io/datasets tests/executor/test_functional.py {posargs}
[testenv:notebooks,notebooks-cuda{101,102,110,11x,12x}]
# need to constrain package deps, as we support numpy 2.x, but pint on Python 3.9 doesn't
constrain_package_deps=true
deps=
-rtest_requirements.txt
nbval
nbqa
libertem-blobfinder[hdbscan]>=0.6
py{39}-data: numba>=0.53
py{310}-data: numba>=0.55
py{311}-data: numba>=0.57
py{312}-data: numba>=0.59
hyperspy
ipywidgets
pyxem>=0.17
rosettasciio
scikit-image
pint<0.20
numpy<2
notebooks-cuda101: cupy-cuda101
notebooks-cuda102: cupy-cuda102
notebooks-cuda110: cupy-cuda110
notebooks-cuda11x: cupy-cuda11x
notebooks-cuda12x: cupy-cuda12x
extras=
{[testenv]extras}
commands=
pytest --durations=10 --cov=libertem --cov-report=term --cov-report=html --cov-report=xml --cov-config=pyproject.toml --junitxml=junit.xml --nbval --nbval-sanitize-with nbval_sanitize.cfg -p no:python --nbval-current-env {posargs:examples/}
passenv=
TESTDATA_BASE_PATH
# HyperSpy expects this on Windows
PROGRAMFILES
[testenv:benchmark]
changedir={toxinidir}
commands=
pytest --benchmark-enable --benchmark-warmup=on --benchmark-autosave --benchmark-storage "{toxinidir}/benchmark_results" -m "not compilation" {posargs:benchmarks/}
pytest --benchmark-enable --benchmark-warmup=off --benchmark-autosave --benchmark-storage "{toxinidir}/benchmark_results" -m "compilation" {posargs:benchmarks/}
[testenv:benchmark-cuda{101,102,110,114}]
changedir={toxinidir}
commands=
{[testenv:benchmark]commands}
[testenv:build_client]
changedir={toxinidir}
skipsdist=True
skip_install=True
passenv=APPDATA
deps=
commands=
python client.py build
python client.py copy
[testenv:docs]
changedir={toxinidir}
basepython=python3
whitelist_externals=
make
setenv=
PYTHONPATH={toxinidir}
commands=
python "{toxinidir}/scripts/cli-help"
sphinx-autobuild -b html "{toxinidir}/docs/source" "{toxinidir}/docs/build/html" --port 8008 {posargs} -j auto
deps=
setuptools
-rdocs_requirements.txt
# Inject release candidates for doctest testing
-roverride_requirements.txt
skipsdist=True
# just a non-watching version of the docs environment above, also building twice for bibs
[testenv:docs-build-ci]
changedir={toxinidir}
basepython=python3
setenv=
PYTHONPATH={toxinidir}
commands=
python "{toxinidir}/scripts/cli-help"
# Two runs to get complete bibliography. The first one will throw warnings about missing
# citations.
sphinx-build -j auto -b html "{toxinidir}/docs/source" "{toxinidir}/docs/build/html"
sphinx-build -j auto -W -b html "{toxinidir}/docs/source" "{toxinidir}/docs/build/html"
deps=
setuptools
-rdocs_requirements.txt
# Inject release candidates for doctest testing
-roverride_requirements.txt
skipsdist=True
passenv=
HOME
[testenv:docs-check]
changedir={toxinidir}
setenv=
PYTHONPATH={toxinidir}
commands=
python "{toxinidir}/scripts/cli-help"
# Two runs to get complete bibliography. The first one will throw warnings about missing
# citations.
sphinx-build -j auto -b html "{toxinidir}/docs/source" "{toxinidir}/docs/build/html"
sphinx-build -j auto -W -b html "{toxinidir}/docs/source" "{toxinidir}/docs/build/html"
sphinx-build -j auto -b doctest "{toxinidir}/docs/source" "{toxinidir}/docs/build/html"
# sphinx-build -b linkcheck "{toxinidir}/docs/source" "{toxinidir}/docs/build/html"
# cat docs/build/html/output.txt
deps=
setuptools
numpy<2
-rdocs_requirements.txt
skipsdist=True
whitelist_externals=
cat
passenv=
HOME
PYTHONWARNINGS
[testenv:notebooks_gen]
deps=
-rtest_requirements.txt
libertem-blobfinder[hdbscan]>=0.6
hyperspy
pyxem>=0.17
rosettasciio
scikit-image
# for hyperspy-integration.ipynb
graphviz
pyopencl
extras=
bqplot
commands=
jupyter nbconvert --ExecutePreprocessor.kernel_name=python3 --allow-errors --to notebook --output-dir "{toxinidir}/examples/generated/" --execute "{toxinidir}/examples/*.ipynb"
passenv=
TESTDATA_BASE_PATH
# HyperSpy expects this on Windows
PROGRAMFILES
setenv=
PYTHONWARNINGS=ignore
DASK_DISTRIBUTED__LOGGING__DISTRIBUTED=60
KMP_WARNINGS=0