-
Notifications
You must be signed in to change notification settings - Fork 49
/
tox.ini
199 lines (190 loc) · 7.32 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
[tox]
requires =
tox>=4.2
virtualenv>20.2
envlist =
cartesian-py{310}-{internal,dace}-{cpu}
eve-py{310}
next-py{310}-{nomesh,atlas}-{cpu}
storage-py{310}-{internal,dace}-{cpu}
# docs
labels =
test-cartesian-cpu = cartesian-py38-internal-cpu, cartesian-internal-py39-cpu, \
cartesian-internal-py310-cpu, cartesian-py311-internal-cpu, \
cartesian-py38-dace-cpu, cartesian-py39-dace-cpu, cartesian-py310-dace-cpu, cartesian-py311-dace-cpu
test-eve-cpu = eve-py38, eve-py39, eve-py310, eve-py311
test-next-cpu = next-py310-nomesh-cpu, next-py311-nomesh-cpu, next-py310-atlas-cpu, next-py311-atlas-cpu
test-storage-cpu = storage-py38-internal-cpu, storage-py39-internal-cpu, storage-py310-internal-cpu, storage-py311-internal-cpu, \
storage-py38-dace-cpu, storage-py39-dace-cpu, storage-py310-dace-cpu, storage-py311-dace-cpu
test-cpu = cartesian-py38-internal-cpu, cartesian-py39-internal-cpu, cartesian-py310-internal-cpu, cartesian-py311-internal-cpu, \
cartesian-py38-dace-cpu, cartesian-py39-dace-cpu, cartesian-py310-dace-cpu, cartesian-py311-dace-cpu, \
eve-py38, eve-py39, eve-py310, eve-py311, \
next-py310-nomesh-cpu, next-py311-nomesh-cpu, next-py310-atlas-cpu, next-py311-atlas-cpu, \
storage-py38-internal-cpu, storage-py39-internal-cpu, storage-py310-internal-cpu, storage-py311-internal-cpu, \
storage-py38-dace-cpu, storage-py39-dace-cpu, storage-py310-dace-cpu, storage-py311-dace-cpu
[testenv]
deps = -r {tox_root}{/}{env:ENV_REQUIREMENTS_FILE:requirements-dev.txt}
constrain_package_deps = true
use_frozen_constraints = true
extras =
testing
formatting
dace: dace
cuda: cuda
cuda11x: cuda11x
cuda12x: cuda12x
package = wheel
wheel_build_env = .pkg
pass_env = CUDAARCHS, NUM_PROCESSES, GT4PY_*
set_env =
PYTEST_ADDOPTS = --color=auto --instafail
PYTHONWARNINGS = {env:PYTHONWARNINGS:ignore:Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*:UserWarning,ignore:Field View Program:UserWarning}
# -- Primary tests --
[testenv:cartesian-py{38,39,310,311}-{internal,dace}-{cpu,cuda,cuda11x,cuda12x}]
description = Run 'gt4py.cartesian' tests
pass_env = {[testenv]pass_env}, BOOST_ROOT, BOOST_HOME, CUDA_HOME, CUDA_PATH, CXX, CC, OPENMP_CPPFLAGS, OPENMP_LDFLAGS, PIP_USER, PYTHONUSERBASE
allowlist_externals =
make
gcc
g++
ldd
rm
commands =
python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "\
internal: not requires_dace \
dace: requires_dace \
cpu: and not requires_gpu \
{cuda,cuda11x,cuda12x}: and requires_gpu \
" {posargs} tests{/}cartesian_tests
python -m pytest --doctest-modules --doctest-ignore-import-errors src{/}gt4py{/}cartesian
# commands_pre =
# rm -Rf tests/_reports/coverage*
# commands_post =
# coverage json --rcfile=setup.cfg
# coverage html --rcfile=setup.cfg --show-contexts
[testenv:eve-py{38,39,310,311}]
description = Run 'gt4py.eve' tests
commands =
python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} {posargs} tests{/}eve_tests
python -m pytest --doctest-modules src{/}gt4py{/}eve
[testenv:next-py{310,311}-{nomesh,atlas}-{cpu,cuda,cuda11x,cuda12x}]
description = Run 'gt4py.next' tests
pass_env = {[testenv]pass_env}, BOOST_ROOT, BOOST_HOME, CUDA_HOME, CUDA_PATH
deps =
-r {tox_root}{/}requirements-dev.txt
atlas: atlas4py
set_env =
{[testenv]set_env}
PIP_EXTRA_INDEX_URL = {env:PIP_EXTRA_INDEX_URL:https://test.pypi.org/simple/}
commands =
python -m pytest --suppress-no-test-exit-code --cache-clear -v -n {env:NUM_PROCESSES:1} -m "\
nomesh: not requires_atlas \
atlas: requires_atlas \
cpu: and not requires_gpu \
{cuda,cuda11x,cuda12x}: and requires_gpu \
" {posargs} tests{/}next_tests
pytest --doctest-modules src{/}gt4py{/}next
[testenv:storage-py{38,39,310,311}-{internal,dace}-{cpu,cuda,cuda11x,cuda12x}]
description = Run 'gt4py.storage' tests
commands =
python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "\
cpu: not requires_gpu \
{cuda,cuda11x,cuda12x}: requires_gpu \
" {posargs} tests{/}storage_tests
# pytest doctest-modules {posargs} src{/}gt4py{/}storage
# -- Secondary tests --
[testenv:notebooks-py{310,311}]
description = Run notebooks
commands_pre =
jupytext docs/user/next/QuickstartGuide.md --to .ipynb
jupytext docs/user/next/advanced/*.md --to .ipynb
commands =
python -m pytest --nbmake docs/user/next/workshop/slides -v -n {env:NUM_PROCESSES:1}
python -m pytest --nbmake docs/user/next/workshop/exercises -k 'solutions' -v -n {env:NUM_PROCESSES:1}
python -m pytest --nbmake docs/user/next/QuickstartGuide.ipynb -v -n {env:NUM_PROCESSES:1}
python -m pytest --nbmake docs/user/next/advanced -v -n {env:NUM_PROCESSES:1}
python -m pytest --nbmake examples -v -n {env:NUM_PROCESSES:1}
# -- Other artefacts --
[testenv:dev-py{38,39,310,311}{-atlas,}]
description = Initialize development environment for gt4py
deps =
-r {tox_root}{/}requirements-dev.txt
atlas: atlas4py
package = editable-legacy # => use_develop = True
set_env =
{[testenv]set_env}
PIP_EXTRA_INDEX_URL = {env:PIP_EXTRA_INDEX_URL:https://test.pypi.org/simple/}
# [testenv:diagrams]
# install_command = echo {packages}
# skip_install = true
# allowlist_externals =
# /bin/bash
# make
# gcc
# g++
# ldd
# rm
# plantuml
# git
# echo
# changedir = docs/development/ADRs
# commands =
# plantuml ./*.md -tsvg -o _static
# git add _static
# commands_post =
[testenv:requirements-{base,py38,py39,py310,py311}]
description =
base: Update pinned development requirements
py38: Update requirements for testing a specific python version
py39: Update requirements for testing a specific python version
py310: Update requirements for testing a specific python version
py311: Update requirements for testing a specific python version
base_python =
base: py38
py38: py38
py39: py39
py310: py310
py311: py311
deps =
cogapp>=3.3
packaging>=20.0
pip-tools>=6.10
package = skip
set_env =
CUSTOM_COMPILE_COMMAND = "tox run -e requirements-base"
allowlist_externals =
mv
commands =
-mv constraints.txt constraints.txt.old
-mv requirements-dev.txt requirements-dev.old
# Run cog to update requirements files from pyproject
cog -r -P min-requirements-test.txt min-extra-requirements-test.txt
# Generate constraints file removing extras
# (extras are not supported by pip in constraints files)
pip-compile -r --resolver=backtracking \
--annotation-style line \
--build-isolation \
--strip-extras \
--allow-unsafe \
--extra dace \
--extra formatting \
--extra jax-cpu \
--extra performance \
--extra testing \
-o constraints.txt \
pyproject.toml requirements-dev.in
# Generate actual requirements file
# (compiling from scratch again to print actual package sources)
pip-compile --resolver=backtracking \
--annotation-style line \
--build-isolation \
--allow-unsafe \
--extra dace \
--extra formatting \
--extra jax-cpu \
--extra testing \
-c constraints.txt \
-o requirements-dev.txt \
pyproject.toml requirements-dev.in
# Run cog to update .pre-commit-config.yaml with new versions
base: cog -r -P .pre-commit-config.yaml