-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
211 lines (182 loc) · 5.55 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "numtype"
version = "2.2.2.0.dev0"
description = "Experimental Typing Stubs for NumPy"
readme = "README.md"
authors = [{name = "Joren Hammudoglu", email = "[email protected]"}]
maintainers = [{name = "NumPy Developers", email = "[email protected]"}]
license = "BSD-3-Clause"
keywords = ["numpy", "typing", "stubs"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Typing :: Stubs Only",
"Typing :: Typed",
]
requires-python = ">=3.10"
packages = [{include = "src/numpy-stubs"}]
dependencies = []
[project.optional-dependencies]
numpy = ["numpy>=2.2.2,<2.3"]
[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]"]
dev = [
{include-group = "numpy"},
"libcst>=1.6.0",
"ruff>=0.9.5",
"mypy[faster-cache]>=1.15.0",
"basedpyright>=1.27.0",
"pytest>=8.3.4",
]
[tool.hatch.build]
packages = ["src/numpy-stubs"]
[tool.hatch.build.targets.sdist]
exclude = [
"/.github",
"/.vscode",
"/dist",
"/doc",
"/test",
"/tool",
".libcst.codemod.yaml",
"CONTRIBUTING.md",
"uv.lock",
]
[tool.mypy]
python_version = "3.10"
mypy_path = "src"
pretty = false
show_error_context = false
show_error_code_links = false
show_traceback = false
strict = true
strict_bytes = true
strict_concatenate = true
local_partial_types = true
enable_error_code = ["ignore-without-code", "truthy-bool"]
disable_error_code = ["explicit-override"]
enable_incomplete_feature = ["PreciseTupleTypes"]
disallow_any_explicit = false
disallow_any_expr = false
disallow_any_decorated = false
warn_incomplete_stub = true
warn_unreachable = false
# basedmypy/mypy compat
# bare_literals = false
# default_return = false
[tool.pyright]
include = [
"src/numpy-stubs",
"test/runtime/accept",
"test/static/accept",
"test/static/reject",
"test/static/sanity",
"tool",
]
ignore = [".venv", "test/.venv"]
stubPath = "."
venvPath = "."
venv = ".venv"
pythonPlatform = "All"
pythonVersion = "3.10"
typeCheckingMode = "standard" # TODO(jorenham): set to "all"
deprecateTypingAliases = true
enableTypeIgnoreComments = false
enableReachabilityAnalysis = false
reportCallInDefaultInitializer = true
reportImportCycles = true
reportImplicitOverride = false # TODO
reportMissingSuperCall = false
reportPrivateUsage = false
reportPropertyTypeMismatch = false
reportShadowedImports = true
reportUninitializedInstanceVariable = true
reportUnnecessaryTypeIgnoreComment = true
reportUnusedExpression = false
reportUnusedParameter = false
# basedpyright only
failOnWarnings = true
reportIgnoreCommentWithoutRule = true
reportImplicitAbstractClass = true
reportImplicitRelativeImport = true
reportImplicitStringConcatenation = false
reportInvalidCast = true
reportPrivateLocalImportUsage = true
reportUnannotatedClassAttribute = false # TODO
strictGenericNarrowing = true
[tool.ruff]
src = ["src/numpy-stubs", "test/runtime", "test/static", "tool"]
extend-exclude = [".git", ".mypy_cache", ".tox", ".venv"]
force-exclude = true
# https://typing.readthedocs.io/en/latest/guides/writing_stubs.html#maximum-line-length
line-length = 130
preview = true
[tool.ruff.format]
docstring-code-format = true
line-ending = "lf"
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"FBT", # flake8-boolean-trap
"CPY", # flake8-copyright
"EM", # flake8-errmsg
"FIX", # flake8-fixme
"ANN401", # flake8-annotations: any-type
"PYI041", # flake8-pyi: redundant-numeric-union
]
[tool.ruff.lint.per-file-ignores]
"*.pyi" = [
"N", # pep8-naming
"TD", # flake8-todo
"COM812", # flake8-commas: missing-trailing-comma
"PYI054", # flake8-pyi: numeric-literal-too-long
"PLC2701", # pylint/C: import-private-name
]
[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",
]
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
"ctypes" = "ct"
"datetime" = "dt"
"numpy" = "np"
"numpy.typing" = "npt"
[tool.ruff.lint.isort]
case-sensitive = true
combine-as-imports = true
extra-standard-library = ["_typeshed", "typing_extensions"]
known-first-party = ["numpy"]
split-on-trailing-comma = true
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.pylint]
allow-dunder-method-names = ["__array__", "__array_ufunc__"]
[tool.typos.default]
extend-ignore-identifiers-re = ['ND|nd']
[tool.typos.files]
extend-exclude = ["*.pyi", ".mypyignore"]