-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpyproject.toml
More file actions
299 lines (266 loc) · 6.48 KB
/
pyproject.toml
File metadata and controls
299 lines (266 loc) · 6.48 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
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
[build-system]
requires = ["uv_build>=0.10,<0.11"]
build-backend = "uv_build"
[tool.uv.build-backend]
module-name = ["numpy-stubs", "_numtype", "numtype"]
module-root = "src"
source-exclude = ['\@test', ".ruff_cache", ".ruff.toml"]
[project]
name = "numtype"
version = "2.4.2.0a2.dev0"
description = "Experimental Typing Stubs for NumPy"
readme = "README.md"
authors = [{ name = "Joren Hammudoglu", email = "jhammudoglu@gmail.com" }]
maintainers = [{ name = "NumPy Developers", email = "numpy-discussion@python.org" }]
license = "BSD-3-Clause"
license-files = ["LICENSE"]
keywords = ["numpy", "typing", "stubs"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Typing :: Stubs Only",
"Typing :: Typed",
]
requires-python = ">=3.11"
dependencies = []
[project.optional-dependencies]
numpy = ["numpy>=2.4.2,<2.5.0"]
[project.urls]
Homepage = "https://numpy.org/"
Repository = "https://github.com/numpy/numtype/"
Issues = "https://github.com/numpy/numtype/issues"
Changelog = "https://github.com/numpy/numtype/releases"
[dependency-groups]
numpy = ["numtype[numpy]"]
lint = [
"dprint-py>=0.52.0.0",
"ruff>=0.15.5",
]
pytest = [
{ include-group = "numpy" },
"pytest>=9.0.2",
"typing_extensions>=4.15.0",
]
list_and_test = [
{ include-group = "lint" },
{ include-group = "pytest" },
]
types = [
{ include-group = "pytest" },
"types-setuptools>=82.0.0.20260210",
"types-tabulate>=0.10.0.20260308",
]
basedpyright = [
{ include-group = "numpy" },
{ include-group = "types" },
"basedpyright==1.38.2",
]
mypy = [
{ include-group = "types" },
"mypy[faster-cache]>=1.19.1",
]
typecheck = [
{ include-group = "basedpyright" },
{ include-group = "mypy" },
]
docs = [
"mkdocs-material>=9.7.4",
"mkdocs-awesome-nav>=3.3.0",
"markdown-callouts>=0.4.0",
"mkdocs-include-markdown-plugin>=7.2.1",
"mkdocs-minify-plugin>=0.8.0",
"mkdocstrings[python]>=1.0.3",
"pygments>=2.19.2",
]
dev = [
{ include-group = "list_and_test" },
{ include-group = "typecheck" },
{ include-group = "docs" },
]
# mypy
[tool.mypy]
mypy_path = "src"
strict = true
enable_error_code = [
"explicit-override",
"ignore-without-code",
"redundant-expr",
"truthy-bool",
]
enable_incomplete_feature = ["PreciseTupleTypes"]
allow_redefinition_new = true
local_partial_types = true
warn_incomplete_stub = true
warn_unreachable = false
# (based)pyright
[tool.pyright]
include = ["src", "tool"]
ignore = [".venv"]
exclude = [
".cache",
".git",
".github",
".mypy_cache",
".pytest_cache",
".ruff_cache",
".tox",
".vscode",
"docs",
"site",
]
stubPath = "src"
pythonPlatform = "All"
typeCheckingMode = "strict"
deprecateTypingAliases = true
disableBytesTypePromotions = true
enableTypeIgnoreComments = false
enableReachabilityAnalysis = false
reportCallInDefaultInitializer = true
reportImportCycles = true
reportImplicitOverride = true
reportInvalidStubStatement = false # required for type-testing
reportMissingSuperCall = false
reportPrivateUsage = false
reportPropertyTypeMismatch = false
reportSelfClsParameterName = false
reportUninitializedInstanceVariable = true
reportUnnecessaryTypeIgnoreComment = true
reportUnusedExpression = false
reportUnusedParameter = false
reportUnusedVariable = true
# basedpyright only
failOnWarnings = true
reportIgnoreCommentWithoutRule = true
reportImplicitAbstractClass = true
reportImplicitRelativeImport = true
reportImplicitStringConcatenation = false
reportIncompatibleUnannotatedOverride = true
reportInvalidAbstractMethod = true
reportInvalidCast = true
reportPrivateLocalImportUsage = true
reportUnannotatedClassAttribute = false
strictGenericNarrowing = true
# ruff
[tool.ruff]
src = ["src", "tool"]
extend-exclude = [".git", ".mypy_cache", ".tox", ".venv"]
force-exclude = true
line-length = 120
preview = true
[tool.ruff.format]
line-ending = "lf"
skip-magic-trailing-comma = true
[tool.ruff.lint]
select = ["ALL"]
ignore = ["CPY", "FIX002", "COM812"]
[tool.ruff.lint.per-file-ignores]
"*.pyi" = ["TD"]
[tool.ruff.lint.flake8-builtins]
builtins-allowed-modules = ["random"]
[tool.ruff.lint.flake8-import-conventions]
banned-from = [
"abc",
"basedtyping",
"ctypes",
"datetime",
"os",
"sys",
"numpy",
"numpy.typing",
"_numtype",
]
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
"ctypes" = "ct"
"datetime" = "dt"
"numpy" = "np"
"numpy.typing" = "npt"
"numtype" = "nt"
"_numtype" = "_nt"
[tool.ruff.lint.isort]
case-sensitive = true
combine-as-imports = true
extra-standard-library = ["_typeshed", "typing_extensions"]
known-first-party = ["numpy", "numtype", "_numtype"]
split-on-trailing-comma = false
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.pylint]
allow-dunder-method-names = ["__array__", "__array_ufunc__"]
# pytest
[tool.pytest.ini_options]
minversion = "9.0"
addopts = ["-ra"]
filterwarnings = ["error"]
log_level = "INFO"
strict = true
# tox
[tool.tox]
# install with `uv tool install tox --with tox-uv --upgrade` and run with `uvx tox p`
min_version = "4"
requires = ["tox-uv>=1"]
env_list = [
"ruff",
"pytest",
"basedpyright",
"mypy",
"3.11",
"3.12",
"3.13",
"3.14",
]
[tool.tox.env_run_base]
description = "stubtest ({base_python})"
commands = [
[
"uv",
"run",
"-q",
"-p={base_python}",
"--active",
"tool/stubtest.py",
"--concise",
],
]
[tool.tox.env.ruff]
description = "ruff"
runner = "uv-venv-lock-runner"
dependency_groups = ["dev"]
commands = [
["ruff", "check", "--show-fixes"],
["ruff", "format", "--check"],
]
[tool.tox.env.pytest]
description = "pytest"
runner = "uv-venv-lock-runner"
dependency_groups = ["dev", "numpy"]
commands = [["pytest"]]
[tool.tox.env.basedpyright]
description = "basedpyright"
runner = "uv-venv-lock-runner"
dependency_groups = ["dev"]
commands = [["basedpyright", { replace = "posargs", default = [], extend = true }]]
[tool.tox.env.mypy]
description = "mypy"
runner = "uv-venv-lock-runner"
dependency_groups = ["dev", "types"]
commands = [
[
"mypy",
"--no-incremental",
"--cache-dir=/dev/null",
{ replace = "posargs", default = ["."], extend = true },
],
]
# typos
[tool.typos]
[tool.typos.default]
extend-ignore-identifiers-re = ['ND|nd|nin|NIN|TYP']
[tool.typos.files]
extend-exclude = ["*.pyi", "tool/allowlists/*.txt"]