forked from pola-rs/polars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
255 lines (234 loc) · 7.48 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
[build-system]
requires = ["maturin>=1.3.2"]
build-backend = "maturin"
[project]
name = "polars"
description = "Blazingly fast DataFrame library"
readme = "README.md"
authors = [
{ name = "Ritchie Vink", email = "[email protected]" },
]
license = { file = "LICENSE" }
requires-python = ">=3.8"
keywords = ["dataframe", "arrow", "out-of-core"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Rust",
"Topic :: Scientific/Engineering",
]
[project.urls]
Homepage = "https://www.pola.rs/"
Documentation = "https://docs.pola.rs/py-polars/html/reference/index.html"
Repository = "https://github.com/pola-rs/polars"
Changelog = "https://github.com/pola-rs/polars/releases"
[project.optional-dependencies]
# NOTE: keep this list in sync with show_versions() and requirements-dev.txt
adbc = ["adbc_driver_manager", "adbc_driver_sqlite"]
async = ["nest_asyncio"]
cloudpickle = ["cloudpickle"]
connectorx = ["connectorx >= 0.3.2"]
deltalake = ["deltalake >= 0.15.0"]
fastexcel = ["fastexcel >= 0.9"]
fsspec = ["fsspec"]
gevent = ["gevent"]
iceberg = ["pyiceberg >= 0.5.0"]
matplotlib = ["matplotlib"]
numpy = ["numpy >= 1.16.0"]
openpyxl = ["openpyxl >= 3.0.0"]
pandas = ["pyarrow >= 7.0.0", "pandas"]
plot = ["hvplot >= 0.9.1"]
pyarrow = ["pyarrow >= 7.0.0"]
pydantic = ["pydantic"]
pyxlsb = ["pyxlsb >= 1.0"]
sqlalchemy = ["sqlalchemy", "pandas"]
timezone = ["backports.zoneinfo; python_version < '3.9'", "tzdata; platform_system == 'Windows'"]
torch = ["torch"]
xlsx2csv = ["xlsx2csv >= 0.8.0"]
xlsxwriter = ["xlsxwriter"]
all = [
"polars[adbc,async,cloudpickle,connectorx,deltalake,fastexcel,fsspec,gevent,numpy,pandas,plot,pyarrow,pydantic,iceberg,sqlalchemy,timezone,torch,xlsx2csv,xlsxwriter]",
]
[tool.maturin]
include = [{ path = "rust-toolchain.toml", format = "sdist" }]
[tool.mypy]
files = ["polars", "tests"]
strict = true
enable_error_code = [
"redundant-expr",
"truthy-bool",
"ignore-without-code",
]
disable_error_code = [
"empty-body",
]
[[tool.mypy.overrides]]
module = [
"IPython.*",
"adbc_driver_manager.*",
"adbc_driver_sqlite.*",
"arrow_odbc",
"backports",
"connectorx",
"deltalake.*",
"fsspec.*",
"gevent",
"hvplot.*",
"kuzu",
"matplotlib.*",
"moto.server",
"nest_asyncio",
"openpyxl",
"polars.polars",
"pyarrow.*",
"pydantic",
"pyiceberg.*",
"pyxlsb",
"sqlalchemy.*",
"torch.*",
"xlsx2csv",
"xlsxwriter.*",
"zoneinfo",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"IPython.*",
"matplotlib.*",
]
follow_imports = "skip"
[[tool.mypy.overrides]]
module = ["polars.*"]
# We exclude the polars module from warn_return_any, because the PyO3 api does not have Python
# type annotations. See https://github.com/PyO3/pyo3/issues/1112 for a discussion on adding
# this capability. We could add a stub file for polars.polars (the PyO3 api), but that
# amounts to duplicating almost all type annotations on our api, as the Python api itself is a
# thin wrapper around the PyO3 api to start with.
warn_return_any = false
[tool.ruff]
line-length = 88
fix = true
[tool.ruff.lint]
select = [
"E", # pycodestyle
"W", # pycodestyle
"F", # Pyflakes
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # flake8-docstrings
"D213", # Augment NumPy docstring convention: Multi-line docstring summary should start at the second line
"D417", # Augment NumPy docstring convention: Missing argument descriptions
"I", # isort
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"PT", # flake8-pytest-style
"RUF", # Ruff-specific rules
"PTH", # flake8-use-pathlib
"FA", # flake8-future-annotations
"PIE", # flake8-pie
"TD", # flake8-todos
"TRY", # tryceratops
"EM", # flake8-errmsg
"FBT001", # flake8-boolean-trap
]
ignore = [
# Line length regulated by formatter
"E501",
# pydocstyle: http://www.pydocstyle.org/en/stable/error_codes.html
"D401", # Relax NumPy docstring convention: First line should be in imperative mood
# flake8-pytest-style:
"PT011", # pytest.raises({exception}) is too broad, set the match parameter or use a more specific exception
# flake8-simplify
"SIM102", # Use a single `if` statement instead of nested `if` statements
"SIM108", # Use ternary operator
# ruff
"RUF005", # unpack-instead-of-concatenating-to-collection-literal
# pycodestyle
# TODO: Remove errors below to further improve docstring linting
# Ordered from most common to least common errors.
"D105", # Missing docstring in magic method
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
# flake8-todos
"TD002", # Missing author in TODO
"TD003", # Missing issue link on the line following this TODO
# tryceratops
"TRY003", # Avoid specifying long messages outside the exception class
# Lints below are turned off because of conflicts with the ruff formatter
"D206",
"W191",
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["D100", "D102", "D103", "B018", "FBT001"]
[tool.ruff.lint.pycodestyle]
max-doc-length = 88
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.flake8-type-checking]
strict = true
[tool.ruff.format]
docstring-code-format = true
[tool.pytest.ini_options]
addopts = [
"--tb=short",
"--strict-config",
"--strict-markers",
"--import-mode=importlib",
# Default to running fast tests only. To run ALL tests, run: pytest -m ""
"-m not slow and not write_disk and not release and not docs and not hypothesis and not benchmark and not ci_only",
]
markers = [
"ci_only: Tests that should only run on CI by default.",
"debug: Tests that should be run on a Polars debug build.",
"docs: Documentation code snippets",
"release: Tests that should be run on a Polars release build.",
"slow: Tests with a longer than average runtime.",
"write_disk: Tests that write to disk",
]
filterwarnings = [
# Fail on warnings
"error",
# Allow debugging in an IPython console
"ignore:.*unrecognized arguments.*PyDevIPCompleter:DeprecationWarning",
# Ignore warnings issued by dependency internals
"ignore:.*is_sparse is deprecated.*:FutureWarning",
"ignore:FigureCanvasAgg is non-interactive:UserWarning",
"ignore:datetime.datetime.utcfromtimestamp\\(\\) is deprecated.*:DeprecationWarning",
"ignore:datetime.datetime.utcnow\\(\\) is deprecated.*:DeprecationWarning",
# Introspection under PyCharm IDE can generate this in Python 3.12
"ignore:.*co_lnotab is deprecated, use co_lines.*:DeprecationWarning",
# TODO: Excel tests lead to unclosed file warnings
# https://github.com/pola-rs/polars/issues/14466
"ignore:unclosed file.*:ResourceWarning",
"ignore:the 'pyxlsb' engine is deprecated.*:DeprecationWarning",
]
xfail_strict = true
[tool.coverage.run]
source = ["polars"]
branch = true
[tool.coverage.report]
fail_under = 85
skip_covered = true
show_missing = true
exclude_lines = [
"pragma: no cover",
"@overload",
"except ImportError",
"if TYPE_CHECKING:",
"from typing_extensions import ",
]