-
-
Notifications
You must be signed in to change notification settings - Fork 169
Expand file tree
/
Copy pathpyproject.toml
More file actions
348 lines (311 loc) · 10.5 KB
/
pyproject.toml
File metadata and controls
348 lines (311 loc) · 10.5 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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
[tool.poetry]
name = "pandas-stubs"
version = "3.0.0.260204"
description = "Type annotations for pandas"
authors = ["The Pandas Development Team <pandas-dev@python.org>"]
license = "BSD-3-Clause"
readme = "README.md"
homepage = "https://pandas.pydata.org"
repository = "https://github.com/pandas-dev/pandas-stubs"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"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",
"Topic :: Scientific/Engineering",
"Typing :: Stubs Only",
]
packages = [{ include = "pandas-stubs" }]
exclude = ["pandas-stubs/__init__.py"]
[tool.poetry.urls]
"Bug Tracker" = "https://github.com/pandas-dev/pandas-stubs/issues"
"Documentation" = "https://pandas.pydata.org/pandas-docs/stable"
[tool.poetry.dependencies]
python = ">=3.11"
numpy = ">=1.23.5"
[tool.poetry.group.dev.dependencies]
mypy = ">=1.19.1"
pandas = "3.0.1"
pyarrow = ">=10.0.1"
pytest = ">=8.4.2"
pyright = ">=1.1.408"
ty = ">=0.0.12"
pyrefly = ">=0.53.0"
poethepoet = ">=0.16.5"
loguru = ">=0.6.0"
typing-extensions = ">=4.5.0"
matplotlib = ">=3.10.1"
pre-commit = ">=4.3.0"
black = ">=25.9.0"
isort = ">=7.0.0"
openpyxl = ">=3.0.10"
numexpr = ">=2.13.1"
lxml = ">=4.9.1"
pyreadstat = ">=1.2.0"
xlrd = ">=2.0.1"
xlsxwriter = ">=3.0.3"
pyxlsb = ">=1.0.10"
odfpy = ">=1.4.1"
xarray = ">=22.6.0"
tabulate = ">=0.8.10"
jinja2 = ">=3.1"
scipy = ">=1.9.1"
scipy-stubs = ">=1.15.3.0"
SQLAlchemy = ">=2.0.39"
types-python-dateutil = ">=2.8.19"
beautifulsoup4 = ">=4.14.2"
html5lib = ">=1.1"
python-calamine = ">=0.2.0"
pyarrow-stubs = { version = ">=20.0.0.20250928", python = "<4" }
fsspec = "^2025.10.0"
tables = ">=3.10.2"
pytz = "^2025.2"
types-pytz = ">=2022.1.1"
pyiceberg = "^0.10.0"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poe.tasks.test_all]
help = "Run all tests"
script = "scripts.test:run_tests(src=True, dist=True)"
[tool.poe.tasks.test]
help = "Run local tests (includes 'mypy', 'pyright', 'pytest', and 'style')"
script = "scripts.test:run_tests(src=True)"
[tool.poe.tasks.test_dist]
help = "Run tests on the installed stubs (includes 'mypy_dist' and 'pyright_dist')"
script = "scripts.test:run_tests(dist=True)"
[tool.poe.tasks.pytest]
help = "Run pytest"
script = "scripts.test:pytest(nightly)"
args = [
{ name = "nightly", positional = false, default = false, type = "boolean", required = false, help = "Use pandas nightly (off by default)" },
]
[tool.poe.tasks.style]
help = "Run pre-commit"
script = "scripts.test.run:style"
[tool.poe.tasks.mypy]
help = "Run mypy on 'tests' (using the local stubs) and on the local stubs"
args = [
{ name = "mypy_nightly", positional = false, default = false, type = "boolean", required = false, help = "Use mypy nightly (off by default)" },
]
script = "scripts.test:mypy_src(mypy_nightly)"
[tool.poe.tasks.mypy_dist]
help = "Run mypy on 'tests' using the installed stubs"
script = "scripts.test:run_tests(dist=True, type_checker='mypy')"
[tool.poe.tasks.ty]
help = "Run ty on pandas-stubs"
script = "scripts.test.run:ty"
[tool.poe.tasks.pyrefly]
help = "Run pyrefly on pandas-stubs"
script = "scripts.test.run:pyrefly"
[tool.poe.tasks.pyright]
help = "Run pyright on 'tests' (using the local stubs) and on the local stubs"
script = "scripts.test.run:pyright_src"
[tool.poe.tasks.pyright_dist]
help = "Run pyright on 'tests' using the installed stubs"
script = "scripts.test:run_tests(dist=True, type_checker='pyright')"
[tool.poe.tasks.stubtest]
script = "scripts.test:stubtest(allowlist, check_missing, nightly)"
help = "Run stubtest to compare the installed stubs against pandas"
args = [
{ name = "allowlist", positional = true, default = "", required = false, help = "Path to an allowlist (optional)" },
{ name = "check_missing", positional = false, default = false, type = "boolean", required = false, help = "Report errors when the stubs are incomplete (off by default)" },
{ name = "nightly", positional = false, default = false, type = "boolean", required = false, help = "Compare against pandas nightly (off by default)" },
]
[tool.poe.tasks.type_completeness]
help = "Check type completeness"
script = "scripts.test.run:type_completeness"
[tool.black]
target-version = ["py311"]
[tool.isort]
known_pre_libs = "pandas._config"
known_pre_core = [
"pandas._libs",
"pandas._typing",
"pandas.util._*",
"pandas.compat",
"pandas.errors",
]
known_dtypes = "pandas.core.dtypes"
known_post_core = ["pandas.tseries", "pandas.io", "pandas.plotting"]
sections = [
"FUTURE",
"STDLIB",
"THIRDPARTY",
"PRE_LIBS",
"PRE_CORE",
"DTYPES",
"FIRSTPARTY",
"POST_CORE",
"LOCALFOLDER",
]
profile = "black"
combine_as_imports = true
force_grid_wrap = 2
force_sort_within_sections = true
skip_glob = "env"
[tool.ruff]
target-version = "py311"
fix = true
[tool.ruff.lint]
extend-select = ["ALL"]
ignore = [
# The following rules are ignored permanently for good reasons
"COM", # https://docs.astral.sh/ruff/rules/#flake8-commas-com
"D", # https://docs.astral.sh/ruff/rules/#pydocstyle-d
"E501", # handled by black https://docs.astral.sh/ruff/rules/line-too-long/
"FBT", # https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt
"I", # handled by isort
"TRY003", # https://docs.astral.sh/ruff/rules/raise-vanilla-args/
]
[tool.ruff.lint.per-file-ignores]
"*.pyi" = [
# The following rules are ignored permanently for good reasons
"A002", # https://docs.astral.sh/ruff/rules/builtin-argument-shadowing/
"ANN401", # https://docs.astral.sh/ruff/rules/any-type/
"FIX002", # https://docs.astral.sh/ruff/rules/line-contains-todo/
"N", # https://docs.astral.sh/ruff/rules/#pep8-naming-n
"TD002", # https://docs.astral.sh/ruff/rules/missing-todo-author/
# The following rules are ignored temporarily. Either fix them or move to the permanent list above.
"A001", # https://docs.astral.sh/ruff/rules/builtin-variable-shadowing/
"A004", # https://docs.astral.sh/ruff/rules/builtin-import-shadowing/
"PYI001", # https://docs.astral.sh/ruff/rules/unprefixed-type-param/
"PYI042", # https://docs.astral.sh/ruff/rules/snake-case-type-alias/
"ERA001",
"PLR0402",
"PLC0105",
]
"scripts/*" = [
# The following rules are ignored permanently for good reasons
"EM", # https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
"S603", # https://docs.astral.sh/ruff/rules/subprocess-without-shell-equals-true/
]
"tests/*" = [
# The following rules are ignored permanently for good reasons
"ANN401", # https://docs.astral.sh/ruff/rules/any-type/
"ARG", # https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
"B905", # https://docs.astral.sh/ruff/rules/zip-without-explicit-strict/
"E731", # https://docs.astral.sh/ruff/rules/lambda-assignment/
"EM", # https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
"FIX002", # https://docs.astral.sh/ruff/rules/line-contains-todo/
"PD", # Pandas is here
"PLC0415", # https://docs.astral.sh/ruff/rules/import-outside-top-level/
"PLW0108", # https://docs.astral.sh/ruff/rules/unnecessary-lambda/
"S101", # https://docs.astral.sh/ruff/rules/assert/
"TD002", # https://docs.astral.sh/ruff/rules/missing-todo-author/
# The following rules are ignored temporarily. Either fix them or move to the permanent list above.
"A001", # https://docs.astral.sh/ruff/rules/builtin-variable-shadowing/
"PYI042", # https://docs.astral.sh/ruff/rules/snake-case-type-alias/
"SLF001", # https://docs.astral.sh/ruff/rules/private-member-access/
"ERA",
"RUF",
"SIM",
"TRY",
"PT",
"NPY",
"N",
"DTZ",
"PLR",
"TC",
"PGH",
"S311",
"C901",
]
"tests/test_io.py" = [
# The following rules are ignored permanently for good reasons
"S301", # https://docs.astral.sh/ruff/rules/suspicious-pickle-usage/
]
[tool.mypy]
# Import discovery
namespace_packages = false
explicit_package_bases = false
ignore_missing_imports = true
follow_imports = "normal"
follow_imports_for_stubs = false
no_site_packages = false
no_silence_site_packages = false
# Disallow dynamic typing
disallow_any_unimported = false # TODO
disallow_any_expr = false # TODO
disallow_any_decorated = false # TODO
disallow_any_explicit = false # TODO
disallow_any_generics = false # TODO
disallow_subclassing_any = false # TODO
# Untyped definitions and calls
disallow_untyped_calls = false # TODO
disallow_untyped_defs = false # TODO
disallow_incomplete_defs = false # TODO
check_untyped_defs = true
disallow_untyped_decorators = true
# None and Optional handling
no_implicit_optional = true
strict_optional = true
# Configuring warnings
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_return_any = false # TODO
warn_unreachable = true
# Suppressing errors
ignore_errors = false
enable_error_code = "ignore-without-code" # same as in pandas
# Miscellaneous strictness flags
allow_untyped_globals = false
allow_redefinition = false
local_partial_types = false
implicit_reexport = false # pyright behaves the same
strict_equality = true
# Configuring error messages
show_error_context = false
show_column_numbers = false
show_error_codes = true
[tool.pyright]
typeCheckingMode = "strict"
stubPath = "."
include = ["tests", "pandas-stubs"]
enableTypeIgnoreComments = false # use pyright-specific ignores
reportUnnecessaryTypeIgnoreComment = true
# enable optional checks
reportMissingModuleSource = true
[tool.codespell]
ignore-words-list = "indext, mose, sav, ser, ttest"
[tool.pytest.ini_options]
filterwarnings = [
# treat warnings as errors
"error",
]
# Next line needed to avoid poetry complaint
[tool.setuptools_scm]
[tool.pyrefly]
project-includes = ["pandas-stubs", "tests"]
enabled-ignores = ["pyrefly"]
python-version = "3.11"
[tool.pyrefly.errors]
# Import discovery
untyped-import = false
# enable optional checks
implicit-abstract-class = true
implicitly-defined-attribute = true
open-unpacking = true
unannotated-attribute = true
# TODO: enable
# implicit-any = true
# missing-source = true
# missing-override-decorator = true
# unannotated-parameter = true
# unannotated-return = true
[tool.ty.environment]
python-platform = "all"
python-version = "3.11"
[tool.ty.rules]
possibly-unresolved-reference = "error"
[tool.ty.analysis]
respect-type-ignore-comments = false