Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/py-polars/pyproject.toml
6936 views
1
[build-system]
2
requires = ["maturin>=1.3.2"]
3
build-backend = "maturin"
4
5
[project]
6
name = "polars"
7
description = "Blazingly fast DataFrame library"
8
readme = "README.md"
9
authors = [
10
{ name = "Ritchie Vink", email = "[email protected]" },
11
]
12
license = { file = "LICENSE" }
13
requires-python = ">=3.9"
14
15
keywords = ["dataframe", "arrow", "out-of-core"]
16
classifiers = [
17
"Development Status :: 5 - Production/Stable",
18
"Environment :: Console",
19
"Intended Audience :: Science/Research",
20
"License :: OSI Approved :: MIT License",
21
"Operating System :: OS Independent",
22
"Programming Language :: Python",
23
"Programming Language :: Python :: 3",
24
"Programming Language :: Python :: 3 :: Only",
25
"Programming Language :: Python :: 3.9",
26
"Programming Language :: Python :: 3.10",
27
"Programming Language :: Python :: 3.11",
28
"Programming Language :: Python :: 3.12",
29
"Programming Language :: Python :: 3.13",
30
"Programming Language :: Rust",
31
"Topic :: Scientific/Engineering",
32
"Typing :: Typed",
33
]
34
dynamic = ["version"]
35
36
[project.urls]
37
Homepage = "https://www.pola.rs/"
38
Documentation = "https://docs.pola.rs/api/python/stable/reference/index.html"
39
Repository = "https://github.com/pola-rs/polars"
40
Changelog = "https://github.com/pola-rs/polars/releases"
41
42
[project.optional-dependencies]
43
# NOTE: keep this list in sync with show_versions() and requirements-dev.txt
44
polars_cloud = ["polars_cloud >= 0.0.1a1"]
45
# Interop
46
numpy = ["numpy >= 1.16.0"]
47
pandas = ["pandas", "polars[pyarrow]"]
48
pyarrow = ["pyarrow >= 7.0.0"]
49
pydantic = ["pydantic"]
50
51
# Excel
52
calamine = ["fastexcel >= 0.9"]
53
openpyxl = ["openpyxl >= 3.0.0"]
54
xlsx2csv = ["xlsx2csv >= 0.8.0"]
55
xlsxwriter = ["xlsxwriter"]
56
excel = ["polars[calamine,openpyxl,xlsx2csv,xlsxwriter]"]
57
58
# Database
59
adbc = ["adbc-driver-manager[dbapi]", "adbc-driver-sqlite[dbapi]"]
60
connectorx = ["connectorx >= 0.3.2"]
61
sqlalchemy = ["sqlalchemy", "polars[pandas]"]
62
database = ["polars[adbc,connectorx,sqlalchemy]"]
63
64
# Cloud
65
fsspec = ["fsspec"]
66
67
# Other I/O
68
deltalake = ["deltalake >= 1.0.0"]
69
iceberg = ["pyiceberg >= 0.7.1"]
70
71
# Other
72
async = ["gevent"]
73
cloudpickle = ["cloudpickle"]
74
graph = ["matplotlib"]
75
plot = ["altair >= 5.4.0"]
76
style = ["great-tables >= 0.8.0"]
77
timezone = ["tzdata; platform_system == 'Windows'"]
78
79
# GPU Engine
80
gpu = ["cudf-polars-cu12"]
81
82
# All
83
all = [
84
"polars[async,cloudpickle,database,deltalake,excel,fsspec,graph,iceberg,numpy,pandas,plot,pyarrow,pydantic,style,timezone]",
85
]
86
87
[tool.maturin]
88
include = [{ path = "rust-toolchain.toml", format = "sdist" }]
89
90
[tool.mypy]
91
files = ["polars", "tests"]
92
strict = true
93
enable_error_code = [
94
"redundant-expr",
95
"truthy-bool",
96
"ignore-without-code",
97
]
98
disable_error_code = [
99
"empty-body",
100
]
101
102
[[tool.mypy.overrides]]
103
module = [
104
"IPython.*",
105
"adbc_driver_manager.*",
106
"adbc_driver_sqlite.*",
107
"altair.*",
108
"arrow_odbc",
109
"backports",
110
"connectorx",
111
"dateutil.*",
112
"deltalake.*",
113
"fsspec.*",
114
"gevent",
115
"great_tables",
116
"jax.*",
117
"kuzu",
118
"matplotlib.*",
119
"moto.server",
120
"openpyxl",
121
"polars.polars",
122
"polars._plr",
123
"polars_cloud",
124
"pyarrow.*",
125
"pydantic",
126
"pyiceberg.*",
127
"sqlalchemy.*",
128
"torch.*",
129
"xlsx2csv",
130
"xlsxwriter.*",
131
"zoneinfo",
132
]
133
ignore_missing_imports = true
134
135
[[tool.mypy.overrides]]
136
module = [
137
"IPython.*",
138
"matplotlib.*",
139
]
140
follow_imports = "skip"
141
142
[[tool.mypy.overrides]]
143
module = ["polars.*"]
144
# We exclude the polars module from warn_return_any, because the PyO3 api does not have Python
145
# type annotations. See https://github.com/PyO3/pyo3/issues/1112 for a discussion on adding
146
# this capability. We could add a stub file for polars._plr (the PyO3 api), but that
147
# amounts to duplicating almost all type annotations on our api, as the Python api itself is a
148
# thin wrapper around the PyO3 api to start with.
149
warn_return_any = false
150
151
[tool.ruff]
152
line-length = 88
153
fix = true
154
155
[tool.ruff.lint]
156
select = [
157
"ANN", # flake8-annotations
158
"B", # flake8-bugbear
159
"C4", # flake8-comprehensions
160
"D", # flake8-docstrings
161
"E", # pycodestyle
162
"EM", # flake8-errmsg
163
"F", # pyflakes
164
"FA", # flake8-future-annotations
165
"FBT001", # flake8-boolean-trap
166
"I", # isort
167
"ICN", # flake8-import-conventions
168
"INT", # flake8-gettext
169
"PERF", # perflint
170
"PIE", # flake8-pie
171
"PT", # flake8-pytest-style
172
"PTH", # flake8-use-pathlib
173
"PYI", # flake8-pyi
174
"RUF", # ruff-specific rules
175
"SIM", # flake8-simplify
176
"TCH", # flake8-type-checking
177
"TD", # flake8-todos
178
"TID", # flake8-tidy-imports
179
"TRY", # tryceratops
180
"UP", # pyupgrade
181
"W", # pycodestyle
182
]
183
184
ignore = [
185
# ------------------------------------------------------------------
186
# TODO: Remove errors below to further improve docstring linting
187
# ------------------------------------------------------------------
188
"D100", # Missing docstring in public module
189
"D104", # Missing docstring in public package
190
"D105", # Missing docstring in magic method
191
# ------------------------------------------------------------------
192
"ANN401", # Dynamically typed expressions (Any) are disallowed
193
"D401", # Relax NumPy docstring convention: first line should be imperative
194
"E501", # Line length regulated by formatter
195
"PT011", # pytest.raises is too broad, set match or use a more specific exception
196
"PYI041", # Use float instead of int | float
197
"RUF022", # `__all__` is not sorted
198
"RUF005", # Consider expression instead of concatenation
199
"SIM102", # Use a single `if` statement instead of nested `if` statements
200
"SIM108", # Use ternary operator
201
"SIM114", # Combine `if` branches
202
"TD002", # Missing author in TODO
203
"TD003", # Missing issue link on the line following this TODO
204
"TRY003", # Avoid specifying long messages outside the exception class
205
]
206
allowed-confusables = ["µ"]
207
208
[tool.ruff.lint.per-file-ignores]
209
"dependencies.py" = ["ICN001"]
210
"tests/**/*.py" = ["D100", "D102", "D103", "B018", "FBT001"]
211
212
[tool.ruff.lint.pycodestyle]
213
max-doc-length = 88
214
215
[tool.ruff.lint.pydocstyle]
216
convention = "numpy"
217
218
[tool.ruff.lint.flake8-tidy-imports]
219
ban-relative-imports = "all"
220
221
[tool.ruff.lint.flake8-type-checking]
222
strict = true
223
224
[tool.ruff.format]
225
docstring-code-format = true
226
227
[tool.pytest.ini_options]
228
doctest_optionflags = [
229
"DONT_ACCEPT_TRUE_FOR_1",
230
"NORMALIZE_WHITESPACE",
231
"ELLIPSIS",
232
]
233
addopts = [
234
"--tb=short",
235
"--strict-config",
236
"--strict-markers",
237
"--import-mode=importlib",
238
# Default to running fast tests only. To run ALL tests, run: pytest -m ""
239
"-m not slow and not write_disk and not release and not docs and not hypothesis and not benchmark and not ci_only",
240
]
241
markers = [
242
"ci_only: Tests that should only run on CI by default.",
243
"benchmark: Tests used to benchmark with.",
244
"debug: Tests that should be run on a Polars debug build.",
245
"docs: Documentation code snippets",
246
"release: Tests that should be run on a Polars release build.",
247
"slow: Tests with a longer than average runtime.",
248
"write_disk: Tests that write to disk",
249
"may_fail_auto_streaming: Test that may fail when automatically using the streaming engine for all lazy queries.",
250
"may_fail_cloud: Test that may fail when automatically using the cloud distributed engine for all lazy queries.",
251
]
252
filterwarnings = [
253
# Fail on warnings
254
"error",
255
# Allow debugging in an IPython console
256
"ignore:.*unrecognized arguments.*PyDevIPCompleter:DeprecationWarning",
257
# Ignore warnings issued by dependency internals
258
"ignore:.*is_sparse is deprecated.*:FutureWarning",
259
"ignore:FigureCanvasAgg is non-interactive:UserWarning",
260
"ignore:datetime.datetime.utcfromtimestamp\\(\\) is deprecated.*:DeprecationWarning",
261
"ignore:datetime.datetime.utcnow\\(\\) is deprecated.*:DeprecationWarning",
262
# Introspection under PyCharm IDE can generate this in Python 3.12
263
"ignore:.*co_lnotab is deprecated, use co_lines.*:DeprecationWarning",
264
# TODO: Excel tests lead to unclosed file warnings
265
# https://github.com/pola-rs/polars/issues/14466
266
"ignore:unclosed file.*:ResourceWarning",
267
# TODO: Database tests lead to unclosed database warnings
268
# https://github.com/pola-rs/polars/issues/20296
269
"ignore:unclosed database.*:ResourceWarning",
270
# Ignore invalid warnings when running earlier versions of SQLAlchemy (we
271
# know they are invalid because our standard tests run the latest version)
272
"ignore:Deprecated API features detected.*:DeprecationWarning",
273
# numpy import can generate this warning in Python 3.13 on certain runners
274
"ignore:.*numpy\\.longdouble.*:UserWarning",
275
]
276
xfail_strict = true
277
278
[tool.coverage.run]
279
source = ["polars"]
280
branch = true
281
282
[tool.coverage.report]
283
fail_under = 85
284
skip_covered = true
285
show_missing = true
286
exclude_lines = [
287
"pragma: no cover",
288
"@overload",
289
"except ImportError",
290
"if TYPE_CHECKING:",
291
"from typing_extensions import ",
292
]
293
294
[[tool.uv.index]]
295
name = "pytorch"
296
url = "https://download.pytorch.org/whl/cpu"
297
explicit = true
298
299
[tool.uv.sources]
300
torch = [
301
{ index = "pytorch" },
302
]
303
304