forked from GridTools/gt4py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
426 lines (386 loc) · 10.7 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
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
[build-system]
build-backend = 'setuptools.build_meta'
requires = ['setuptools>=60.6', 'wheel', 'cython']
# ---- Project description ----
# -- Standard options (PEP 621) --
[project]
authors = [{name = 'ETH Zurich', email = 'gridtools@cscs.ch'}]
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Environment :: GPU :: NVIDIA CUDA',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Operating System :: POSIX',
'Programming Language :: Python',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'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.0',
'deepdiff>=5.6.0',
'devtools>=0.6',
'frozendict>=2.3',
'gridtools-cpp>=2.3.0,==2.*',
"importlib-resources>=5.0;python_version<'3.9'",
'jinja2>=3.0.0',
'lark>=1.1.2',
'mako>=1.1',
'ninja>=1.10',
'numpy>=1.21.2',
'packaging>=20.0',
'pybind11>=2.5',
'setuptools>=65.5.0',
'tabulate>=0.8.10',
'typing-extensions>=4.2,<4.6.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 = {text = 'GPL-3.0-or-later'}
name = 'gt4py'
readme = 'README.md'
requires-python = '>=3.8'
[project.optional-dependencies]
cuda = ['cupy']
cuda110 = ['cupy-cuda110']
cuda111 = ['cupy-cuda111']
cuda112 = ['cupy-cuda112']
cuda113 = ['cupy-cuda113']
cuda114 = ['cupy-cuda114']
cuda115 = ['cupy-cuda115']
cuda116 = ['cupy-cuda116']
cuda117 = ['cupy-cuda117']
cuda11x = ['cupy-cuda11x']
dace = ['dace>=0.14.2,<0.15', 'sympy>=1.7']
formatting = ['clang-format>=9.0']
# Always add all extra packages to 'full' for a simple full gt4py installation
full = [
'clang-format>=9.0',
'dace>=0.14.2,<0.15',
'hypothesis>=6.0.0',
'pytest>=7.0',
'sympy>=1.7',
'scipy>=1.7.2'
]
performance = ['scipy>=1.7.2']
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 ----
# -- black --
[tool.black]
exclude = '''
/(
\.git
| \.gt_cache
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''
include = '\.pyi?$'
line-length = 100
target-version = ['py310']
# -- 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']
# -- flake8 --
# flake8-pyproject plugin is used to load configuration settings
# from this file, since flake8 doesn't support it natively.
[tool.flake8]
count = true
doctests = true
exclude = [
'.eggs',
'.gt_cache',
'.ipynb_checkpoints',
'.tox',
'_local/',
'build',
'dist',
'docs',
'tests/_disabled',
'setup.py'
]
ignore = [
'B008', # Do not perform function calls in argument defaults
'B028', # Consider replacing f"'{foo}'" with f"{foo!r}" # TODO: review this ignore
'D1', # Public code object needs docstring
'DAR', # Disable dargling errors by default
'E203', # Whitespace before ':' (black formatter breaks this sometimes)
'E501', # Line too long (using Bugbear's B950 warning)
'W503' # Line break occurred before a binary operator
]
max-complexity = 15
max-line-length = 100 # It should be the same as in `tool.black.line-length` above
per-file-ignores = [
'src/gt4py/eve/extended_typing.py:F401,F405',
'src/gt4py/next/__init__.py:F401' # We import stuff there in order to reexport.
]
rst-roles = [
'py:mod, mod',
'py:func, func',
'py:data, data',
'py:const, const',
'py:class, class',
'py:meth, meth',
'py:attr, attr',
'py:exc, exc',
'py:obj, obj'
]
# -- isort --
[tool.isort]
combine_as_imports = true
group_by_package = true
known_first_party = ['gt4py', '__externals__', '__gtscript__']
known_tests = ['cartesian_tests', 'eve_tests', 'next_tests', 'storage_tests']
known_third_party = [
'attr',
'black',
'boltons',
'cached_property',
'click',
'dace',
'devtools',
'factory',
'hypothesis',
'importlib_resources',
'jinja2',
'mako',
'networkx',
'numpy',
'packaging',
'pybind11',
'pytest',
'pytest_factoryboy',
'setuptools',
'tabulate',
'typing_extensions',
'xxhash'
]
lexicographical = true
line_length = 100 # It should be the same as in `tool.black.line-length` above
lines_after_imports = 2
profile = 'black'
sections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'TESTS', 'LOCALFOLDER']
skip_gitignore = true
skip_glob = ['*.venv/**', '_local/**']
# -- mypy --
[tool.mypy]
disallow_incomplete_defs = true
exclude = [
'^setup\.py$',
'^build/.*py$',
'^ci/*.py$',
'^tests/cartesian_tests/*.py$',
'^tests/storage_tests/*.py$',
'^tests/eve_tests/*.py$',
'^tests/next_tests/unit_tests/*.py$',
'^tests/next_tests/integration_tests/multi_feature_tests/*.py$',
'^tests/next_tests/integration_tests/feature_tests/ffront_tests/*.py$',
'^tests/next_tests/integration_tests/feature_tests/iterator_tests/*.py$',
'^tests/next_tests/integration_tests/feature_tests/otf_tests/*.py$',
'^tests/next_tests/integration_tests/feature_tests/math_builtin_test_data.py$',
'^tests/next_tests/past_common_fixtures.py$',
'^tests/next_tests/toy_connectivity.py$'
]
ignore_missing_imports = true
install_types = true
namespace_packages = false
no_implicit_optional = true
no_implicit_reexport = true
# 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]]
ignore_missing_imports = false
module = 'gt4py.*'
[[tool.mypy.overrides]]
# The following ignore_errors are only temporary.
# TODO: Fix errors and enable these settings.
disallow_incomplete_defs = false
disallow_untyped_defs = false
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]]
disallow_untyped_defs = true
module = 'gt4py.eve.*'
[[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]]
# # TODO: this should be changed to true after a transition period
disallow_incomplete_defs = false
module = 'gt4py.next.*'
[[tool.mypy.overrides]]
ignore_errors = true
module = 'gt4py.next.ffront.decorator'
[[tool.mypy.overrides]]
ignore_errors = true
module = 'gt4py.next.type_system.type_translation'
[[tool.mypy.overrides]]
ignore_errors = true
module = 'gt4py.next.iterator.runtime'
[[tool.mypy.overrides]]
ignore_errors = true
module = 'gt4py.next.iterator.transforms.global_tmps'
# -- pytest --
[tool.pytest]
[tool.pytest.ini_options]
markers = [
'requires_atlas', # mark tests that require 'atlas4py' bindings package
'requires_dace', # mark tests that require 'dace' package
'requires_gpu:' # mark tests that require a NVidia GPU (assume 'cupy' and 'cudatoolkit' are installed)
]
norecursedirs = ['dist', 'build', 'cpp_backend_tests/build*', '_local/*', '.*']
testpaths = 'tests'
# -- ruff --
[tool.ruff]
ignore = [
'E501',
'B008', # Do not perform function calls in argument defaults
'B028', # Consider replacing f"'{foo}'" with f"{foo!r}" # TODO: review
'B905' # B905 `zip()` without an explicit `strict=` parameter # TODO: review
]
ignore-init-module-imports = true
line-length = 100 # It should be the same as in `tool.black.line-length` above
respect-gitignore = true
# Rules:
# E: pycodestyle
# F: Pyflakes
# I: isort
# B: flake8-bugbear
# A: flake8-builtins
# T100: flake8-debugger
# ERA: eradicate
# NPY: NumPy-specific rules
# RUF: Ruff-specific rules
select = ['E', 'F', 'I', 'B', 'A', 'T100', 'ERA', 'NPY', 'RUF']
show-fixes = true
# show-source = true
target-version = 'py310'
typing-modules = ['gt4py.eve.extended_typing']
unfixable = []
[tool.ruff.isort]
combine-as-imports = true
# force-wrap-aliases = true
known-first-party = ['gt4py', '__externals__', '__gtscript__']
known-third-party = [
'attr',
'black',
'boltons',
'cached_property',
'click',
'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.isort.sections]
'tests' = ['cartesian_tests', 'eve_tests', 'next_tests', 'storage_tests']
[tool.ruff.mccabe]
max-complexity = 15
[tool.ruff.per-file-ignores]
'src/gt4py/eve/extended_typing.py' = ['F401', 'F405']
# -- 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']}