forked from GridTools/gt4py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
189 lines (175 loc) · 7.04 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
[tox]
requires =
tox>=4.2
virtualenv>20.2
envlist =
eve-py{310}
storage-py{310}-{internal,dace}-{cpu}
next-py{310}-{nomesh,atlas}
cartesian-py{310}-{internal,dace}-{cpu}
linters-py{310}
# docs
labels =
test-cartesian-cpu = cartesian-py38-internal-cpu, cartesian-py39-internal-cpu, cartesian-py310-internal-cpu, \
cartesian-py38-dace-cpu, cartesian-py39-dace-cpu, cartesian-py310-dace-cpu
test-eve-cpu = eve-py38, eve-py39, eve-py310
test-next-cpu = next-py310-nomesh, next-py310-atlas
test-storage-cpu = storage-py38-internal-cpu, storage-py39-internal-cpu, storage-py310-internal-cpu, \
storage-py38-dace-cpu, storage-py39-dace-cpu, storage-py310-dace-cpu
test-cpu = cartesian-py38-internal-cpu, cartesian-py39-internal-cpu, cartesian-py310-internal-cpu, \
cartesian-py38-dace-cpu, cartesian-py39-dace-cpu, cartesian-py310-dace-cpu, \
eve-py38, eve-py39, eve-py310, \
next-py310-nomesh, next-py310-atlas, \
storage-py38-internal-cpu, storage-py39-internal-cpu, storage-py310-internal-cpu, \
storage-py38-dace-cpu, storage-py39-dace-cpu, storage-py310-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 = NUM_PROCESSES
set_env =
PYTHONWARNINGS = {env:PYTHONWARNINGS:ignore:Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*:UserWarning}
[testenv:cartesian-py{38,39,310}-{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 =
internal-cpu: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "not requires_gpu and not requires_dace" {posargs} tests{/}cartesian_tests
internal-{cuda,cuda11x,cuda12x}: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "requires_gpu and not requires_dace" {posargs} tests{/}cartesian_tests
dace-cpu: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "not requires_gpu and requires_dace" {posargs} tests{/}cartesian_tests
dace-{cuda,cuda11x,cuda12x}: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "requires_gpu and requires_dace" {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}]
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}-{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 =
nomesh-cpu: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "not requires_atlas and not requires_gpu" {posargs} tests{/}next_tests
nomesh-{cuda,cuda11x,cuda12x}: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "not requires_atlas and requires_gpu" {posargs} tests{/}next_tests
atlas-cpu: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "requires_atlas and not requires_gpu" {posargs} tests{/}next_tests
# atlas-{cuda,cuda11x,cuda12x}: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "requires_atlas and requires_gpu" {posargs} tests{/}next_tests # TODO(ricoh): activate when such tests exist
pytest --doctest-modules src{/}gt4py{/}next
[testenv:storage-py{38,39,310}-{internal,dace}-{cpu,cuda,cuda11x,cuda12x}]
description = Run 'gt4py.storage' tests
commands =
cpu: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "not requires_gpu" {posargs} tests{/}storage_tests
{cuda,cuda11x,cuda12x}: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "requires_gpu" {posargs} tests{/}storage_tests
#pytest doctest-modules {posargs} src{/}gt4py{/}storage
[testenv:linters-py{38,39,310}]
description = Run linters
commands =
flake8 .{/}src
mypy .{/}src
# [testenv:docs]
# usedevelop = true
# commands_pre =
# changedir = docs/user/next
# commands =
# jupytext QuickstartGuide.md --to .py
# python QuickstartGuide.py
# commands_post =
# [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-{common,py38,py39,py310}]
description =
common: 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
base_python =
common: py38
py38: py38
py39: py39
py310: py310
deps =
cogapp>=3.3
pip-tools>=6.10
package = skip
set_env =
CUSTOM_COMPILE_COMMAND = "tox run -e requirements-common"
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 requirements-dev.in 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 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 testing \
-o requirements-dev.txt \
pyproject.toml requirements-dev.in
# Run cog to update .pre-commit-config.yaml with new versions
common: cog -r -P .pre-commit-config.yaml
[testenv:dev-py{38,39,310}{-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/}