forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
349 lines (333 loc) · 9.76 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
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
349
[build-system]
# Minimum requirements for the build system to execute.
# See https://github.com/scipy/scipy/pull/12940 for the AIX issue.
requires = [
"setuptools>=51.0.0",
"wheel",
"Cython>=0.29.32,<3", # Note: sync with setup.py, environment.yml and asv.conf.json
"oldest-supported-numpy>=0.10"
]
# uncomment to enable pep517 after versioneer problem is fixed.
# https://github.com/python-versioneer/python-versioneer/issues/193
# build-backend = "setuptools.build_meta"
[tool.cibuildwheel]
skip = "cp36-* cp37-* pp37-* *-manylinux_i686 *_ppc64le *_s390x *-musllinux*"
build-verbosity = "3"
test-requires = "hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-asyncio>=0.17"
test-command = "python {project}/ci/test_wheels.py"
[tool.cibuildwheel.macos]
archs = "x86_64 universal2"
test-skip = "*_arm64 *_universal2:arm64"
[tool.cibuildwheel.windows]
repair-wheel-command = "python ci/fix_wheels.py {wheel} {dest_dir}"
[[tool.cibuildwheel.overrides]]
select = "*-win*"
# We test separately for Windows, since we use
# the base windows docker image to check if any dlls are
# missing from the wheel
test-command = ""
[[tool.cibuildwheel.overrides]]
select = "*-win32"
environment = { IS_32_BIT="true" }
[tool.black]
target-version = ['py38', 'py39']
exclude = '''
(
asv_bench/env
| \.egg
| \.git
| \.hg
| \.mypy_cache
| \.nox
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| setup.py
)
'''
[tool.pylint.messages_control]
max-line-length = 88
disable = [
"abstract-class-instantiated",
"access-member-before-definition",
"import-error",
"invalid-repr-returned",
"invalid-unary-operand-type",
"no-member",
"no-name-in-module",
"no-value-for-parameter",
"not-an-iterable",
"not-callable",
"redundant-keyword-arg",
"too-many-function-args",
"undefined-variable",
"unexpected-keyword-arg",
"unpacking-non-sequence",
"unsubscriptable-object",
"unsupported-assignment-operation",
"unsupported-membership-test",
"used-before-assignment",
# pylint type "C": convention, for programming standard violation
"consider-iterating-dictionary",
"consider-using-dict-items",
"consider-using-f-string",
"disallowed-name",
"import-outside-toplevel",
"invalid-name",
"line-too-long",
"missing-class-docstring",
"missing-function-docstring",
"missing-module-docstring",
"singleton-comparison",
"superfluous-parens",
"too-many-lines",
"typevar-name-incorrect-variance",
"ungrouped-imports",
"unidiomatic-typecheck",
"unnecessary-dunder-call",
"unnecessary-lambda-assignment",
"unneeded-not",
"use-implicit-booleaness-not-comparison",
"use-implicit-booleaness-not-len",
"use-maxsplit-arg",
"use-sequence-for-iteration",
"useless-import-alias",
"wrong-import-order",
"wrong-import-position",
# pylint type "R": refactor, for bad code smell
"chained-comparison",
"comparison-of-constants",
"comparison-with-itself",
"consider-merging-isinstance",
"consider-using-from-import",
"consider-using-get",
"consider-using-min-builtin",
"consider-using-sys-exit",
"consider-using-ternary",
"consider-using-with",
"cyclic-import",
"duplicate-code",
"inconsistent-return-statements",
"invalid-sequence-index",
"literal-comparison",
"no-else-continue",
"no-else-raise",
"no-else-return",
"no-self-use",
"redefined-argument-from-local",
"simplifiable-if-expression",
"simplifiable-if-statement",
"too-few-public-methods",
"too-many-ancestors",
"too-many-arguments",
"too-many-boolean-expressions",
"too-many-branches",
"too-many-instance-attributes",
"too-many-locals",
"too-many-locals",
"too-many-nested-blocks",
"too-many-public-methods",
"too-many-return-statements",
"too-many-statements",
"unnecessary-comprehension",
"unnecessary-list-index-lookup",
"use-a-generator",
"useless-option-value",
"useless-return",
# pylint type "W": warning, for python specific problems
"abstract-method",
"arguments-differ",
"arguments-out-of-order",
"arguments-renamed",
"attribute-defined-outside-init",
"broad-except",
"cell-var-from-loop",
"comparison-with-callable",
"confusing-with-statement",
"dangerous-default-value",
"deprecated-module",
"duplicate-value",
"eval-used",
"expression-not-assigned",
"fixme",
"global-statement",
"global-variable-not-assigned",
"import-self",
"invalid-envvar-default",
"invalid-overridden-method",
"keyword-arg-before-vararg",
"method-cache-max-size-none",
"nan-comparison",
"non-parent-init-called",
"overridden-final-method",
"pointless-statement",
"pointless-string-statement",
"possibly-unused-variable",
"protected-access",
"raise-missing-from",
"redefined-builtin",
"redefined-outer-name",
"reimported",
"self-assigning-variable",
"self-cls-assignment",
"signature-differs",
"subprocess-run-check",
"super-init-not-called",
"try-except-raise",
"undefined-loop-variable",
"unnecessary-lambda",
"unnecessary-pass",
"unspecified-encoding",
"unused-argument",
"unused-import",
"unused-variable",
"unused-wildcard-import",
"using-constant-test",
"useless-else-on-loop",
"useless-parent-delegation",
"wildcard-import"
]
[tool.pytest.ini_options]
# sync minversion with pyproject.toml & install.rst
minversion = "6.0"
addopts = "--strict-data-files --strict-markers --strict-config --capture=no --durations=30 --junitxml=test-data.xml"
empty_parameter_set_mark = "fail_at_collect"
xfail_strict = true
testpaths = "pandas"
doctest_optionflags = [
"NORMALIZE_WHITESPACE",
"IGNORE_EXCEPTION_DETAIL",
"ELLIPSIS",
]
filterwarnings = [
"error:Sparse:FutureWarning",
"error:The SparseArray:FutureWarning",
# Deprecation gives warning on import during pytest collection
"ignore:pandas.core.index is deprecated:FutureWarning:importlib",
"ignore:pandas.util.testing is deprecated:FutureWarning:importlib",
# Will be fixed in numba 0.56: https://github.com/numba/numba/issues/7758
"ignore:`np.MachAr` is deprecated:DeprecationWarning:numba",
]
junit_family = "xunit2"
markers = [
"single_cpu: tests that should run on a single cpu only",
"slow: mark a test as slow",
"network: mark a test as network",
"db: tests requiring a database (mysql or postgres)",
"clipboard: mark a pd.read_clipboard test",
"arm_slow: mark a test as slow for arm64 architecture",
"arraymanager: mark a test to run with ArrayManager enabled",
]
asyncio_mode = "strict"
[tool.mypy]
# Import discovery
mypy_path = "typings"
files = ["pandas", "typings"]
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
# Platform configuration
python_version = "3.8"
platform = "linux-64"
# 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 = false # GH#27396
# Suppressing errors
ignore_errors = false
enable_error_code = "ignore-without-code"
# Miscellaneous strictness flags
allow_untyped_globals = false
allow_redefinition = false
local_partial_types = false
implicit_reexport = true
strict_equality = true
# Configuring error messages
show_error_context = false
show_column_numbers = false
show_error_codes = true
[[tool.mypy.overrides]]
module = [
"pandas.tests.*",
"pandas._version",
"pandas.io.clipboard",
]
check_untyped_defs = false
[[tool.mypy.overrides]]
module = [
"pandas.tests.apply.test_series_apply",
"pandas.tests.arithmetic.conftest",
"pandas.tests.arrays.sparse.test_combine_concat",
"pandas.tests.dtypes.test_common",
"pandas.tests.frame.methods.test_to_records",
"pandas.tests.groupby.test_rank",
"pandas.tests.groupby.transform.test_transform",
"pandas.tests.indexes.interval.test_interval",
"pandas.tests.indexing.test_categorical",
"pandas.tests.io.excel.test_writers",
"pandas.tests.reductions.test_reductions",
"pandas.tests.test_expressions",
]
ignore_errors = true
# To be kept consistent with "Import Formatting" section in contributing.rst
[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"
skip = "pandas/__init__.py"
[tool.pyright]
pythonVersion = "3.8"
typeCheckingMode = "basic"
include = ["pandas", "typings"]
exclude = ["pandas/tests", "pandas/io/clipboard", "pandas/util/version"]
# enable subset of "strict"
reportDuplicateImport = true
reportInvalidStubStatement = true
reportOverlappingOverload = true
reportPropertyTypeMismatch = true
reportUntypedClassDecorator = true
reportUntypedFunctionDecorator = true
reportUntypedNamedTuple = true
reportUnusedImport = true
# disable subset of "basic"
reportGeneralTypeIssues = false
reportMissingModuleSource = false
reportOptionalCall = false
reportOptionalIterable = false
reportOptionalMemberAccess = false
reportOptionalOperand = false
reportOptionalSubscript = false
reportPrivateImportUsage = false
reportUnboundVariable = false