-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathpyproject.toml
More file actions
215 lines (188 loc) · 5.85 KB
/
pyproject.toml
File metadata and controls
215 lines (188 loc) · 5.85 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
[build-system]
requires = ["meson-python"]
build-backend = "mesonpy"
[project]
name = "array-api-extra"
version = "0.10.2.dev0"
authors = [
{ name = "Lucas Colley", email = "lucas.colley8@gmail.com" },
# { name = "Open Source Contributors" }, # https://github.com/pypi/warehouse/issues/14813
]
description = "Extra array functions built on top of the array API standard."
readme = "README.md"
license = "MIT"
license-files = ["LICENSE"]
requires-python = ">=3.11"
classifiers = [
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Free Threading :: 3 - Stable",
"Typing :: Typed",
]
dependencies = ["array-api-compat>=1.14.0,<2"]
[project.urls]
Homepage = "https://github.com/data-apis/array-api-extra"
"Bug Tracker" = "https://github.com/data-apis/array-api-extra/issues"
Changelog = "https://github.com/data-apis/array-api-extra/releases"
# pytest
[tool.pytest.ini_options]
minversion = "6.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
xfail_strict = true
filterwarnings = ["error"]
log_cli_level = "INFO"
testpaths = ["tests"]
markers = [
"skip_xp_backend(library, /, *, reason=None): Skip test for a specific backend",
"xfail_xp_backend(library, /, *, reason=None, strict=None): Xfail test for a specific backend",
]
# Coverage
[tool.coverage]
run.source = ["array_api_extra"]
# mypy
[tool.mypy]
files = ["src", "tests", "vendor_tests"]
python_version = "3.11"
warn_unused_configs = true
strict = true
enable_error_code = ["ignore-without-code", "truthy-bool"]
disable_error_code = ["no-any-return"]
[[tool.mypy.overrides]]
# slow or unavailable on Windows; do not add to the lint env
module = ["cupy.*", "jax.*", "sparse.*", "torch.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["tests/*"]
disable_error_code = ["no-untyped-def"] # test(...) without -> None
[[tool.mypy.overrides]]
module = ["vendor_tests/*"]
disable_error_code = ["no-untyped-def"] # test(...) without -> None
[[tool.mypy.overrides]]
module = ["vendor_tests/array_api_compat/*"]
ignore_errors = true
# pyrefly
[tool.pyrefly.errors]
# Redundant with mypy checks
missing-import = false
# extra checks from scipy/scipy-stubs
implicit-abstract-class = "error"
implicitly-defined-attribute = "error"
missing-override-decorator = "error"
missing-source = "ignore"
not-required-key-access = "error"
open-unpacking = "error"
unannotated-attribute = "error"
unannotated-parameter = "error"
unannotated-return = "error"
untyped-import = "error"
unused-ignore = "error"
variance-mismatch = "error"
[[tool.pyrefly.sub-config]]
matches = "tests/*.py"
errors = { unannotated-return = false }
[[tool.pyrefly.sub-config]]
matches = "vendor_tests/*.py"
errors = { unannotated-return = false }
# pyright
[tool.basedpyright]
include = ["src", "tests", "vendor_tests"]
exclude = ["vendor_tests/array_api_compat"]
pythonVersion = "3.11"
pythonPlatform = "All"
typeCheckingMode = "all"
# https://github.com/data-apis/array-api-typing
reportAny = false
reportExplicitAny = false
# no array-api-strict type stubs; pytest fixtures
reportUnknownMemberType = false
# no array-api-compat type stubs; pytest fixtures
reportUnknownVariableType = false
# Redundant with mypy checks
reportMissingImports = false
reportMissingTypeStubs = false
# false positives for input validation
reportUnreachable = false
# ruff handles this
reportUnusedParameter = false
# cyclic imports inside function bodies
reportImportCycles = false
# PyRight can't trace types in lambdas
reportUnknownLambdaType = false
executionEnvironments = [
{ root = "tests", reportPrivateUsage = false, reportUnknownArgumentType = false },
{ root = "vendor_tests", reportPrivateUsage = false, reportUnknownArgumentType = false },
{ root = "src" },
]
# Ruff
[tool.ruff]
target-version = "py311"
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"F", # Pyflakes
"I", # isort
"E", # Pycodestyle
"W", # Pycodestyle
"N", # pep8-naming
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"G", # flake8-logging-format
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
"EXE", # flake8-executable
"NPY", # NumPy specific rules
"PD", # pandas-vet
"UP", # Pyupgrade
]
ignore = [
"PLR09", # Too many <...>
"PLR2004", # Magic value used in comparison
"ISC001", # Conflicts with formatter
"N801", # Class name should use CapWords convention
"N802", # Function name should be lowercase
"N806", # Variable in function should be lowercase
"PLC0415", # `import` should be at the top-level of a file
]
# Pylint
[tool.pylint]
py-version = "3.11"
reports.output-format = "colorized"
messages_control.disable = [
"design", # ignore heavily opinionated design checks
"fixme", # allow FIXME comments
"line-too-long", # ruff handles this
"unused-argument", # ruff handles this
"missing-function-docstring", # numpydoc handles this
"import-error", # mypy handles this
"import-outside-toplevel", # optional dependencies
]
# numpydoc
[tool.numpydoc_validation]
checks = [
"all", # report on all checks, except the below
"EX01", # most docstrings do not need an example
"SA01", # data-apis/array-api-extra#87
"ES01", # most docstrings do not need an extended summary
]
exclude = [ # don't report on objects that match any of these regex
'.*test_*',
]