-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathpyproject.toml
253 lines (218 loc) · 6.64 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "scipy-stubs"
version = "1.15.2.3.dev0"
description = "Type annotations for SciPy"
readme = "README.md"
authors = [
{name = "Joren Hammudoglu", email = "[email protected]"},
]
maintainers = [
{name = "SciPy Developers", email = "[email protected]"},
{name = "Joren Hammudoglu", email = "[email protected]"},
]
license = "BSD-3-Clause"
keywords = ["scipy", "typing", "pep484"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"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",
]
requires-python = ">=3.10"
dependencies = ["optype>=0.9.3"]
[project.optional-dependencies]
scipy = ["scipy>=1.15.2,<1.16"]
[project.urls]
Homepage = "https://scipy.org/"
Repository = "https://github.com/scipy/scipy-stubs/"
Issues = "https://github.com/scipy/scipy-stubs/issues"
Changelog = "https://github.com/scipy/scipy-stubs/releases"
[dependency-groups]
extras = ["scipy-stubs[scipy]"]
ci = ["packaging>=24.2"]
mdformat = [
"mdformat>=0.7.22",
"mdformat-gfm>=0.4.1",
"mdformat-gfm-alerts>=1.0.1",
]
lint = [
{include-group = "extras"},
{include-group = "mdformat"},
"ruff>=0.11.4",
"sp-repo-review[cli]>=2025.1.22",
]
type = [
{include-group = "extras"},
{include-group = "ci"},
"basedmypy[faster-cache]>=2.10.0",
"basedpyright>=1.28.4",
]
dev = [
{include-group = "lint"},
{include-group = "type"},
]
[tool.hatch.build]
packages = ["scipy-stubs"]
[tool.hatch.build.targets.sdist]
exclude = ["CODE_OF_CONDUCT.md", "README.md", "SECURITY.md", "uv.lock"]
force-include = {".mypyignore" = ".mypyignore"} # for scipy-stubs-feedstock
[tool.poe.tasks.clean]
cmd = """
rm -rf
scipy-stubs/**/*.pyc
scipy-stubs/**/__pycache__
scripts/*.pyc
scripts/__pycache__
tests/**/*.pyc
tests/**/__pycache__
./**/.cache
./**/.mypy_cache
./**/.ruff_cache
./**/.tox
"""
[tool.poe.tasks.stubtest]
cmd = """
uv run
--no-editable
--reinstall-package=scipy-stubs
stubtest
--mypy-config-file=pyproject.toml
--allowlist=.mypyignore
--ignore-unused-allowlist
$modules
"""
args = [{name = "modules", positional = true, multiple = true, default = "scipy"}]
[tool.typos.files]
extend-exclude = ["*.pyi", ".mypyignore"]
[tool.mypy]
strict = true
strict_bytes = true
enable_error_code = [
"ignore-without-code",
"redundant-expr",
"truthy-bool",
]
warn_unreachable = false
warn_unused_ignores = true
# basedmypy/mypy compat
disallow_any_decorated = false
disallow_any_explicit = false
disallow_any_expr = false
disallow_subclassing_any = false
# https://github.com/python/mypy/issues/18744
disable_bytearray_promotion = true
disable_memoryview_promotion = true
# optype numpy compat
always_true = ["NP123", "NP124", "NP125", "NP126", "NP20", "NP21", "NP22"]
always_false = ["NP23", "NP30"]
[tool.pyright]
include = ["scipy-stubs", "scripts", "tests"]
ignore = [".venv"]
stubPath = "."
pythonPlatform = "All"
typeCheckingMode = "strict"
deprecateTypingAliases = true
enableReachabilityAnalysis = false
enableTypeIgnoreComments = false
reportCallInDefaultInitializer = true
reportImplicitOverride = true
reportImportCycles = true
reportMissingSuperCall = true
reportPropertyTypeMismatch = false
reportShadowedImports = true
reportUninitializedInstanceVariable = true
reportUnnecessaryTypeIgnoreComment = true
# overridden in the execution environments
reportInvalidStubStatement = false
# type-checkers should type-check; linters should lint
reportImplicitStringConcatenation = false
reportPrivateImportUsage = false
reportPrivateUsage = false
# basedpyright
failOnWarnings = true
reportIgnoreCommentWithoutRule = true
reportImplicitAbstractClass = true
reportImplicitRelativeImport = true
reportInvalidCast = true
reportPrivateLocalImportUsage = true
reportUnannotatedClassAttribute = false
strictGenericNarrowing = false
[[executionEnvironments]]
root = "scipy-stubs"
reportInvalidStubStatement = true
reportUnusedCallResult = true
[[executionEnvironments]]
root = "tests"
reportAny = true
reportExplicitAny = true
reportPrivateUsage = true
reportUnreachable = true
reportUnsafeMultipleInheritance = true # base
[tool.pyright.defineConstant]
# optype numpy compat
NP123 = true
NP124 = true
NP125 = true
NP126 = true
NP20 = true
NP21 = true
NP22 = true
NP23 = false
NP30 = false
[tool.repo-review]
ignore = [
"PY004", # no /docs
"PY006", # pre-commit should not be used
"PY007", # tox configured in tox.toml
"PP301", # pytest is irrelevant
"PC111", # no blacken-docs because markdown has no code
"PC170", # no pygrep-hooks because no rST
"RTD", # no RTD
]
[tool.ruff]
src = ["scipy-stubs", "scripts"]
extend-exclude = [".venv", ".git", ".mypy_cache", ".tox"]
force-exclude = true
# https://typing.readthedocs.io/en/latest/guides/writing_stubs.html#maximum-line-length
line-length = 130
[tool.ruff.format]
docstring-code-format = true
line-ending = "lf"
[tool.ruff.lint]
preview = true
select = ["ALL"]
ignore = ["D", "FBT", "COM812", "CPY", "EM", "TD", "FIX", "DOC"]
[tool.ruff.lint.per-file-ignores]
"*.pyi" = ["F", "E741", "N", "A", "PYI054", "PLC2701", "PLW3201", "PLR", "FURB"]
[tool.ruff.lint.flake8-import-conventions]
banned-from = ["numpy", "numpy.typing", "optype", "optype.numpy", "optype.typing"]
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
"ctypes" = "ct"
"datetime" = "dt"
"numpy" = "np"
"numpy.typing" = "npt"
"optype" = "op"
"optype.numpy" = "onp"
"optype.typing" = "opt"
[tool.ruff.lint.isort]
combine-as-imports = true
known-first-party = ["scipy"]
no-lines-before = ["typing", "first-party", "local-folder"]
section-order = ["standard-library", "typing", "third-party", "first-party", "local-folder"]
split-on-trailing-comma = true
[tool.ruff.lint.isort.sections]
typing = ["collections.abc", "types", "typing", "typing_extensions"]
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true
mypy-init-return = true