forked from pola-rs/polars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
297 lines (267 loc) · 8.61 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
[build-system]
requires = ["maturin>=1.3.2"]
build-backend = "maturin"
[project]
name = "polars"
description = "Blazingly fast DataFrame library"
readme = "README.md"
authors = [
]
license = { file = "LICENSE" }
requires-python = ">=3.9"
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.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Rust",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
]
dynamic = ["version"]
[project.urls]
Homepage = "https://www.pola.rs/"
Documentation = "https://docs.pola.rs/api/python/stable/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
polars_cloud = ["polars_cloud >= 0.0.1a1"]
# Interop
numpy = ["numpy >= 1.16.0"]
pandas = ["pandas", "polars[pyarrow]"]
pyarrow = ["pyarrow >= 7.0.0"]
pydantic = ["pydantic"]
# Excel
calamine = ["fastexcel >= 0.9"]
openpyxl = ["openpyxl >= 3.0.0"]
xlsx2csv = ["xlsx2csv >= 0.8.0"]
xlsxwriter = ["xlsxwriter"]
excel = ["polars[calamine,openpyxl,xlsx2csv,xlsxwriter]"]
# Database
adbc = ["adbc-driver-manager[dbapi]", "adbc-driver-sqlite[dbapi]"]
connectorx = ["connectorx >= 0.3.2"]
sqlalchemy = ["sqlalchemy", "polars[pandas]"]
database = ["polars[adbc,connectorx,sqlalchemy]"]
# Cloud
fsspec = ["fsspec"]
# Other I/O
deltalake = ["deltalake >= 0.19.0"]
iceberg = ["pyiceberg >= 0.7.1"]
# Other
async = ["gevent"]
cloudpickle = ["cloudpickle"]
graph = ["matplotlib"]
plot = ["altair >= 5.4.0"]
style = ["great-tables >= 0.8.0"]
timezone = ["tzdata; platform_system == 'Windows'"]
# GPU Engine
gpu = ["cudf-polars-cu12"]
# All
all = [
"polars[async,cloudpickle,database,deltalake,excel,fsspec,graph,iceberg,numpy,pandas,plot,pyarrow,pydantic,style,timezone]",
]
[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.*",
"altair.*",
"arrow_odbc",
"backports",
"connectorx",
"dateutil.*",
"deltalake.*",
"fsspec.*",
"gevent",
"great_tables",
"jax.*",
"kuzu",
"matplotlib.*",
"moto.server",
"openpyxl",
"polars.polars",
"polars_cloud",
"pyarrow.*",
"pydantic",
"pyiceberg.*",
"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 = [
"ANN", # flake8-annotations
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # flake8-docstrings
"E", # pycodestyle
"EM", # flake8-errmsg
"F", # pyflakes
"FA", # flake8-future-annotations
"FBT001", # flake8-boolean-trap
"I", # isort
"ICN", # flake8-import-conventions
"INT", # flake8-gettext
"PERF", # perflint
"PIE", # flake8-pie
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"RUF", # ruff-specific rules
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"TD", # flake8-todos
"TID", # flake8-tidy-imports
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle
]
ignore = [
# ------------------------------------------------------------------
# TODO: Remove errors below to further improve docstring linting
# ------------------------------------------------------------------
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
# ------------------------------------------------------------------
"ANN401", # Dynamically typed expressions (Any) are disallowed
"D401", # Relax NumPy docstring convention: first line should be imperative
"E501", # Line length regulated by formatter
"PT011", # pytest.raises is too broad, set match or use a more specific exception
"PYI041", # Use float instead of int | float
"RUF022", # `__all__` is not sorted
"RUF005", # Consider expression instead of concatenation
"SIM102", # Use a single `if` statement instead of nested `if` statements
"SIM108", # Use ternary operator
"SIM114", # Combine `if` branches
"TD002", # Missing author in TODO
"TD003", # Missing issue link on the line following this TODO
"TRY003", # Avoid specifying long messages outside the exception class
]
allowed-confusables = ["µ"]
[tool.ruff.lint.per-file-ignores]
"dependencies.py" = ["ICN001"]
"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",
"may_fail_auto_streaming: Test that may fail when automatically using the streaming engine for all lazy queries.",
]
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",
# TODO: Database tests lead to unclosed database warnings
# https://github.com/pola-rs/polars/issues/20296
"ignore:unclosed database.*:ResourceWarning",
# Ignore invalid warnings when running earlier versions of SQLAlchemy (we
# know they are invalid because our standard tests run the latest version)
"ignore:Deprecated API features detected.*:DeprecationWarning",
# numpy import can generate this warning in Python 3.13 on certain runners
"ignore:.*numpy\\.longdouble.*:UserWarning",
# The old streaming engine is deprecated, until the new streaming engine is
# done just ignore the deprecation warnings.
"ignore:The old streaming engine*: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 ",
]
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.uv.sources]
torch = [
{ index = "pytorch" },
]