-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
253 lines (225 loc) · 6.42 KB
/
pyproject.toml
File metadata and controls
253 lines (225 loc) · 6.42 KB
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
# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
[build-system]
requires = ["rich", "setuptools>80", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "aedifix"
authors = [{name = "NVIDIA Corporation"}]
license = "Apache-2.0"
description = "aedifix - Build system for Legate libraries"
classifiers = [
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13"
]
dependencies = [
"rich",
]
dynamic = ["version"]
requires-python = ">=3.11"
[project.optional-dependencies]
test = [
"coverage",
"mypy>=0.961",
"pytest-cov",
"pytest",
]
[project.urls]
homepage = "https://github.com/nv-legate/aedifix"
[project.scripts]
aedifix-select-arch-color = "aedifix.scripts.select_arch_color:main"
[tool.setuptools_scm]
write_to = "src/aedifix/_version.py"
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"@abstract"
]
[tool.mypy]
python_version = "3.11"
cache_dir = "./.cache/mypy"
pretty = true
show_error_codes = true
show_error_context = true
show_column_numbers = true
namespace_packages = true
ignore_missing_imports = false
disallow_any_unimported = true
disallow_any_expr = false
disallow_any_decorated = false
disallow_any_explicit = false
disallow_any_generics = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
strict_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_return_any = false
warn_unreachable = true
ignore_errors = false
allow_untyped_globals = false
allow_redefinition = false
implicit_reexport = true
strict_equality = true
warn_unused_configs = true
[tool.pytest.ini_options]
cache_dir = "./.cache/pytest"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')"
]
filterwarnings = ["error"]
[tool.ruff]
cache-dir = "./.cache/ruff"
extend-exclude = [
"venv",
"*venv",
"src/aedifix/templates/*",
]
line-length = 79
src = [".", "src/python/legate"]
[tool.ruff.format]
skip-magic-trailing-comma = true
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# Don't warn about missing trailing commas, the formatter will insert those for us.
"COM812",
# Don't care about annotations, we let mypy do that for us.
"ANN",
# Allow TODO's.
"FIX",
# Ruff is a bit too opinionated about the format of TODO statements.
"TD",
# We well and truly don't care about timezones
"DTZ",
"BLE001",
# Keep commented-out code for now, there are false-positives.
"ERA001",
# Allow use of assert.
"S101",
# Always prefer absolute imports...
"TID252",
# Many false positives.
"S603",
# Disable the naming-convention checks. This is "dangerous" insofar that we need to
# manually enforce this, but there are so many manual (but reasonable!) violations in
# there currently that littering the repo with noqa N80 seems dumb.
"N80",
"N81",
# We don't document modules
"D100",
"D101",
"D104",
# We want a blank line after descriptions, but this has false positives when it comes
# to summaries that are ever so slightly longer than 1 line.
"D205",
# Imperative mood checker is a bit finnicky
"D401",
# We don't care if hashes are cryptographically secure
"S311",
# We don't care about using absolute paths for all executables. When we say "run conda
# foo bar baz", we don't care where conda came from
"S607",
# Let mypy type-check the __enter__ and __exit__ functions
"PYI036",
# We don't always *need* to `raise NewException(...) from old_exn`
"B904",
# Let the formatter concatenate strings
"ISC001",
# Doing typing.cast("SomeType", ...) instead of typing.cast(SomeType, ...) looks
# bad. The docs say this is for consistency (sometimes you cannot import SomeType due
# to circular import), and also because it might be slow to evaluate complex type
# expressions at runtime but...
#
# None of our python code is in a hot-loop, and typing.cast() is so seldom used that
# this is OK to silence.
"TC006"
]
[tool.ruff.lint.extend-per-file-ignores]
"__init__.py" = [
"F401",
]
"src/**/*.py" = [
"D101",
"D102",
"D103",
"D105",
"D106",
# OK to pass raw boolean params in config, as this is usually done when setting cmake
# variables
"FBT003",
]
"tests/**/*.py" = [
# asserts allowed in tests...
"S101",
# Don't care about booleans as positional arguments in tests, e.g. via
# @pytest.mark.parametrize()
"FBT",
# Test modules don't need docstrings...
"D100",
# ...and neither do classes...
"D101",
# ...or methods...
"D102",
# ...or functions...
"D103",
# ...or packages...
"D104",
# ...or magic methods...
"D105",
# ...or nested classes...
"D106",
# ...or __init__ statements
"D107",
# Tests are allowed to access private members
"SLF001",
# TODO(jfaibussowit) enable this eventually...
"PT007",
# Ignore magic values in tests, there are simply far too many to fix...
"PLR2004",
# Tests can have unused function params, since they might be fixtures
"ARG001",
"ARG002",
# Tests can have a lot of arguments if many of them are fixtures
"PLR0913",
# OK to use np.random.random, we don't care about using the new Generator class
"NPY002",
]
[tool.ruff.lint.flake8-pytest-style]
parametrize-values-type = "tuple"
[tool.ruff.lint.isort]
known-third-party = []
known-first-party = ["aedifix"]
length-sort-straight = true
combine-as-imports = true
split-on-trailing-comma = false
required-imports = ["from __future__ import annotations"]
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"local-folder",
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
ignore-decorators = ["typing.overload"]
[tool.codespell]
# This needs to be a list like so, not an array. Codespell does not parse arrays
# correctly.
builtin = "clear,rare,informal,names,en-GB_to_en-US"
context = 1
[tool.pyright]
stubPath = "src/typings"
pythonVersion = "3.11"
reportMissingModuleSource = false