-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
271 lines (254 loc) · 7.75 KB
/
pyproject.toml
File metadata and controls
271 lines (254 loc) · 7.75 KB
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
[build-system]
requires = ["setuptools>=82.0.1", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "spicepy"
dynamic = ["version"]
description = "Spice.ai client library for Python"
readme = "README.md"
license = {text = "Apache-2.0"}
requires-python = ">=3.11"
dependencies = [
"pyarrow>=24.0.0",
"pandas>=3.0.3",
"certifi>=2026.4.22",
"requests>=2.34.0",
]
authors = [
{name = "Spice AI, Inc.", email = "webmaster@spice.ai"}
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries",
"Typing :: Typed",
]
keywords = ["spice", "spiceai", "AI", "data", "analytics", "arrow", "flight", "SQL", "federated"]
[project.urls]
Homepage = "https://github.com/spiceai/spicepy"
Documentation = "https://docs.spice.ai/sdks/python-sdk"
Repository = "https://github.com/spiceai/spicepy"
Issues = "https://github.com/spiceai/spicepy/issues"
[project.optional-dependencies]
test = [
"pylint>=4.0.5",
"flake8>=7.3.0",
"ruff>=0.15.12",
"mypy>=2.1.0",
"pytest>=9.0.3",
"pytest-cov>=7.1.0",
"pytest-xdist>=3.8.0",
"pytest-timeout>=2.4.0",
"pytest_httpserver==1.1.5",
"types-requests>=2.33.0.20260508",
"pandas-stubs>=3.0.0.260204",
"black>=26.3.1",
"bandit>=1.9.4",
"pandas>=3.0.3",
"pyarrow>=24.0.0",
"adbc-driver-flightsql>=1.11.0",
"adbc-driver-manager>=1.11.0",
"polars>=1.40.1",
]
params = [
"adbc-driver-flightsql>=1.11.0",
"adbc-driver-manager>=1.11.0",
]
polars = [
"polars>=1.40.1",
]
# ============== Tool Configuration ==============
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
warn_redundant_casts = true
strict_equality = true
check_untyped_defs = false
disallow_untyped_defs = false
disallow_incomplete_defs = false
disallow_untyped_decorators = false
no_implicit_optional = false
warn_no_return = true
warn_unreachable = false
show_error_codes = true
show_column_numbers = true
pretty = true
exclude = [
"^\\.venv/",
"^build/",
"^dist/",
]
[[tool.mypy.overrides]]
module = [
"pyarrow.*",
"adbc_driver_flightsql.*",
"adbc_driver_manager.*",
"certifi",
"pandas",
"polars",
"polars.*",
"_pytest.*",
"pytest.*",
]
ignore_missing_imports = true
[tool.ruff]
target-version = "py311"
line-length = 120
exclude = [
".git",
".mypy_cache",
".ruff_cache",
".venv",
"build",
"dist",
"*.egg-info",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"PTH", # flake8-use-pathlib
"ERA", # eradicate (commented out code)
"PL", # pylint
"RUF", # ruff-specific rules
"S", # flake8-bandit (security)
"N", # pep8-naming
"D", # pydocstring
"ANN", # flake8-annotations
"T20", # flake8-print
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"TRY", # tryceratops
]
ignore = [
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
"D107", # Missing docstring in __init__
"D203", # 1 blank line required before class docstring (conflicts with D211)
"D213", # Multi-line docstring summary should start at the second line (conflicts with D212)
"ANN401", # Dynamically typed expressions (Any) are disallowed
"ANN001", # Missing type annotation for function argument (too strict for legacy code)
"ANN002", # Missing type annotation for *args
"ANN003", # Missing type annotation for **kwargs
"ANN201", # Missing return type annotation for public function
"ANN202", # Missing return type annotation for private function
"ANN204", # Missing return type annotation for special method __init__
"ANN205", # Missing return type annotation for staticmethod
"ANN206", # Missing return type annotation for classmethod
"PLR0913", # Too many arguments in function definition
"PLR0911", # Too many return statements
"PLR0915", # Too many statements
"S101", # Use of assert detected (needed for tests)
"TRY003", # Avoid specifying long messages outside exception class
"TRY300", # Consider moving statement to else block
"TRY301", # Abstract raise to an inner function
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D105", # Missing docstring in magic method
"D205", # 1 blank line required between summary line and description
"D212", # Multi-line docstring summary should start at the first line (using Google style)
"PLR2004", # Magic value used in comparison
"PLC0415", # import should be at top-level (needed for optional imports)
"RET504", # Unnecessary assignment before return
"RUF013", # PEP 484 prohibits implicit Optional
"PTH123", # open() should use Path.open()
"B007", # Loop control variable not used
"B017", # Do not assert blind exception
"SIM117", # Use single with statement
"ERA001", # Found commented-out code
"TC003", # Move standard library import into type-checking block
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"D", # No docstrings required in tests
"ANN", # No annotations required in tests
"S101", # assert is ok in tests
"PLR2004", # Magic values ok in tests
"ARG", # Unused arguments ok in tests (fixtures)
"T20", # Print statements ok in tests
"N812", # `functions as F` is the DataFrame convention
"S608", # asserting SQL fragments is the point of these tests
]
"spicepy/_client.py" = [
"S608", # SQL is constructed from escaped identifiers/literals; lint can't tell
]
"spicepy/_dataframe.py" = [
"S608", # The DataFrame layer's entire job is composing SQL; identifiers and literals are escaped
]
[tool.ruff.lint.isort]
known-first-party = ["spicepy"]
force-single-line = false
force-sort-within-sections = true
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_functions = ["test_*"]
addopts = [
"-v",
"--strict-markers",
"--strict-config",
"-ra",
"--tb=short",
]
markers = [
"unit: Unit tests that don't require external services",
"integration: Integration tests that require Spice runtime",
"cloud: Tests that require Spice.ai cloud connection",
"slow: Tests that take a long time to run",
]
filterwarnings = [
"error",
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
"ignore::pytest.PytestUnraisableExceptionWarning",
]
[tool.coverage.run]
source = ["spicepy"]
branch = true
omit = [
"tests/*",
"*/__pycache__/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
"@abstractmethod",
]
fail_under = 80
show_missing = true
skip_covered = false
[tool.coverage.html]
directory = "htmlcov"
[tool.bandit]
exclude_dirs = ["tests", ".venv"]
skips = [
"B101", # assert_used
"B608", # hardcoded_sql_expressions: composing SQL with escaped identifiers/literals is this package's job
]
[dependency-groups]
dev = [
"build>=1.5.0",
]