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