-
Notifications
You must be signed in to change notification settings - Fork 49
/
pyproject.toml
365 lines (326 loc) · 10.5 KB
/
pyproject.toml
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
[build-system]
build-backend = 'setuptools.build_meta'
requires = ['setuptools>=65.5.0', 'wheel>=0.33.6', 'cython>=0.29.13']
# ---- Project description ----
# -- Standard options (PEP 621) --
[project]
authors = [{name = 'ETH Zurich', email = '[email protected]'}]
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Environment :: GPU :: NVIDIA CUDA',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Operating System :: POSIX',
'Programming Language :: Python',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Scientific/Engineering :: Atmospheric Science',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Scientific/Engineering :: Physics'
]
dependencies = [
"astunparse>=1.6.3;python_version<'3.9'",
'attrs>=21.3',
'black>=22.3',
'boltons>=20.1',
'cached-property>=1.5.1',
'click>=8.0.0',
'cmake>=3.22',
'cytoolz>=0.12.1',
'deepdiff>=5.6.0',
'devtools>=0.6',
'diskcache>=5.6.3',
'factory-boy>=3.3.0',
'filelock>=3.16.1',
'frozendict>=2.3',
'gridtools-cpp>=2.3.8,==2.*',
"importlib-resources>=5.0;python_version<'3.9'",
'jinja2>=3.0.0',
'lark>=1.1.2',
'mako>=1.1',
'nanobind>=1.4.0 ',
'ninja>=1.10',
'numpy>=1.23.3',
'packaging>=20.0',
'pybind11>=2.10.1',
'setuptools>=65.5.0',
'tabulate>=0.8.10',
'typing-extensions>=4.10.0',
'xxhash>=1.4.4,<3.1.0'
]
description = 'Python library for generating high-performance implementations of stencil kernels for weather and climate modeling from a domain-specific language (DSL)'
dynamic = ['version']
keywords = [
'gridtools',
'stencil',
'weather',
'climate',
'performance',
'portable',
'hpc'
]
license = {file = 'LICENSE.txt'}
name = 'gt4py'
readme = 'README.md'
requires-python = '>=3.8'
[project.optional-dependencies]
# Bundles
all-cpu = ['gt4py[dace,formatting,jax-cpu,performance,testing]']
all-cuda11 = ['gt4py[cuda11,dace,formatting,jax-cuda11,performance,testing]']
all-cuda12 = ['gt4py[cuda12,dace,formatting,jax-cuda12,performance,testing]']
# Other extras
cuda11 = ['cupy-cuda11x>=12.0']
cuda12 = ['cupy-cuda12x>=12.0']
dace = ['dace>=1.0.0,<1.1.0'] # v1.x will contain breaking changes, see https://github.com/spcl/dace/milestone/4
formatting = ['clang-format>=9.0']
gpu = ['cupy>=12.0']
jax-cpu = ['jax[cpu]>=0.4.18; python_version>="3.10"']
jax-cuda11 = ['jax[cuda11_pip]>=0.4.18; python_version>="3.10"']
jax-cuda12 = ['jax[cuda12_pip]>=0.4.18; python_version>="3.10"']
performance = ['scipy>=1.9.2']
rocm-43 = ['cupy-rocm-4-3']
testing = ['hypothesis>=6.0.0', 'pytest>=7.0']
[project.scripts]
gtpyc = 'gt4py.cartesian.cli:gtpyc'
[project.urls]
Documentation = 'https://gridtools.github.io/gt4py'
Homepage = 'https://gridtools.github.io/'
Source = 'https://github.com/GridTools/gt4py'
# ---- Other tools ----
# -- bump-my-version --
[tool.bumpversion]
allow_dirty = false
commit = false
commit_args = ''
current_version = "1.0.4"
ignore_missing_version = false
message = 'Bump version: {current_version} → {new_version}'
parse = '(?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+))?'
regex = false
replace = '{new_version}'
search = '{current_version}'
serialize = ['{major}.{minor}.{patch}']
sign_tags = false
tag = false
tag_message = 'Bump version: {current_version} → {new_version}'
tag_name = 'v{new_version}'
[[tool.bumpversion.files]]
filename = "src/gt4py/__about__.py"
# -- coverage --
[tool.coverage]
[tool.coverage.html]
directory = 'tests/_reports/coverage_html'
[tool.coverage.paths]
source = ['src/', '.tox/py*/lib/python3.*/site-packages/']
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
'raise AssertionError', # Don't complain if tests don't hit defensive assertion code
'raise NotImplementedError', # Don't complain if tests don't hit defensive assertion code
'if 0:', # Don't complain if non-runnable code isn't run
'if __name__ == .__main__.:' # Don't complain if non-runnable code isn't run
]
ignore_errors = true
[tool.coverage.run]
branch = true
source_pkgs = ['gt4py']
# -- mypy --
[tool.mypy]
disallow_incomplete_defs = true
exclude = [
'^setup\.py$',
'build/.*$',
'ci/*.$',
'docs/.*$',
'tests/.*$'
]
ignore_missing_imports = true
implicit_optional = false
implicit_reexport = false
install_types = true
namespace_packages = false
# pretty = true
show_column_numbers = true
show_error_codes = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
# GT4Py configs
[[tool.mypy.overrides]]
allow_incomplete_defs = false
allow_untyped_defs = false
ignore_missing_imports = false
module = 'gt4py.*'
[[tool.mypy.overrides]]
# The following ignore_errors are only temporary.
# TODO: Fix errors and enable these settings.
allow_incomplete_defs = true
allow_untyped_defs = true
follow_imports = 'silent'
module = 'gt4py.cartesian.*'
warn_unused_ignores = false
[[tool.mypy.overrides]]
ignore_errors = true
module = 'gt4py.cartesian.backend.pyext_builder'
[[tool.mypy.overrides]]
ignore_errors = true
module = 'gt4py.cartesian.frontend.nodes'
[[tool.mypy.overrides]]
ignore_errors = true
module = 'gt4py.cartesian.frontend.node_util'
[[tool.mypy.overrides]]
ignore_errors = true
module = 'gt4py.cartesian.frontend.gtscript_frontend'
[[tool.mypy.overrides]]
ignore_errors = true
module = 'gt4py.cartesian.frontend.defir_to_gtir'
[[tool.mypy.overrides]]
ignore_errors = true
module = 'gt4py.cartesian.frontend.meta'
[[tool.mypy.overrides]]
module = 'gt4py.eve.extended_typing'
warn_unused_ignores = false
[[tool.mypy.overrides]]
# TODO: Make this false and fix errors
allow_untyped_defs = true
follow_imports = 'silent'
module = 'gt4py.storage.*'
warn_unused_ignores = false
[[tool.mypy.overrides]]
allow_incomplete_defs = true
allow_untyped_defs = true
module = 'gt4py.next.iterator.*'
[[tool.mypy.overrides]]
allow_incomplete_defs = true
allow_untyped_defs = true
module = 'gt4py.next.program_processors.runners.dace_iterator.*'
[[tool.mypy.overrides]]
ignore_errors = true
module = 'gt4py.next.ffront.decorator'
[[tool.mypy.overrides]]
ignore_errors = true
module = 'gt4py.next.iterator.runtime'
# -- pytest --
[tool.pytest]
[tool.pytest.ini_options]
markers = [
'all: special marker that skips all tests',
'requires_atlas: tests that require `atlas4py` bindings package',
'requires_dace: tests that require `dace` package',
'requires_gpu: tests that require a NVidia GPU (`cupy` and `cudatoolkit` are required)',
'uses_applied_shifts: tests that require backend support for applied-shifts',
'uses_constant_fields: tests that require backend support for constant fields',
'uses_dynamic_offsets: tests that require backend support for dynamic offsets',
'uses_floordiv: tests that require backend support for floor division',
'uses_if_stmts: tests that require backend support for if-statements',
'uses_index_fields: tests that require backend support for index fields',
'uses_negative_modulo: tests that require backend support for modulo on negative numbers',
'uses_origin: tests that require backend support for domain origin',
'uses_reduction_with_only_sparse_fields: tests that require backend support for with sparse fields',
'uses_scan: tests that uses scan',
'uses_scan_in_field_operator: tests that require backend support for scan in field operator',
'uses_scan_without_field_args: tests that require calls to scan that do not have any fields as arguments',
'uses_scan_nested: tests that use nested scans',
'uses_scan_requiring_projector: tests need a projector implementation in gtfn',
'uses_sparse_fields: tests that require backend support for sparse fields',
'uses_sparse_fields_as_output: tests that require backend support for writing sparse fields',
'uses_strided_neighbor_offset: tests that require backend support for strided neighbor offset',
'uses_tuple_args: tests that require backend support for tuple arguments',
'uses_tuple_returns: tests that require backend support for tuple results',
'uses_zero_dimensional_fields: tests that require backend support for zero-dimensional fields',
'uses_cartesian_shift: tests that use a Cartesian connectivity',
'uses_unstructured_shift: tests that use a unstructured connectivity',
'uses_max_over: tests that use the max_over builtin',
'uses_mesh_with_skip_values: tests that use a mesh with skip values',
'checks_specific_error: tests that rely on the backend to produce a specific error message'
]
norecursedirs = ['dist', 'build', 'cpp_backend_tests/build*', '_local/*', '.*']
testpaths = 'tests'
# -- ruff --
[tool.ruff]
line-length = 100 # It should be the same as in `tool.black.line-length` above
respect-gitignore = true
show-fixes = true
# show-source = true
target-version = 'py38'
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
# # Rules sets:
# E: pycodestyle
# F: Pyflakes
# I: isort
# B: flake8-bugbear
# A: flake8-builtins
# T10: flake8-debugger
# ERA: eradicate
# NPY: NumPy-specific rules
# RUF: Ruff-specific rules
ignore = [
'E501' # [line-too-long]
]
select = ['E', 'F', 'I', 'B', 'A', 'T10', 'ERA', 'NPY', 'RUF']
typing-modules = ['gt4py.eve.extended_typing']
unfixable = []
[tool.ruff.lint.isort]
combine-as-imports = true
# force-wrap-aliases = true
known-first-party = ['gt4py', '__externals__', '__gtscript__']
known-third-party = [
'attr',
'black',
'boltons',
'cached_property',
'click',
'cupy',
'dace',
'devtools',
'factory',
'hypothesis',
'importlib_resources',
'jinja2',
'mako',
'networkx',
'numpy',
'packaging',
'pybind11',
'pytest',
'pytest_factoryboy',
'setuptools',
'tabulate',
'typing_extensions',
'xxhash'
]
lines-after-imports = 2
order-by-type = true
section-order = [
'future',
'standard-library',
'third-party',
'first-party',
'tests',
'local-folder'
]
split-on-trailing-comma = false
[tool.ruff.lint.isort.sections]
'tests' = ['cartesian_tests', 'eve_tests', 'next_tests', 'storage_tests']
[tool.ruff.lint.mccabe]
max-complexity = 15
[tool.ruff.lint.per-file-ignores]
'src/gt4py/cartesian/*' = ['RUF012']
'src/gt4py/eve/extended_typing.py' = ['F401', 'F405']
'src/gt4py/next/__init__.py' = ['F401']
# -- setuptools build backend --
[tool.setuptools]
platforms = ['Linux', 'Mac']
[tool.setuptools.dynamic]
version = {attr = 'gt4py.__about__.__version__'}
[tool.setuptools.package-data]
'*' = ['*.in', '*.txt']
'gt4py' = ['py.typed', '*.md', '*.rst']
[tool.setuptools.packages]
find = {namespaces = false, where = ['src']}