Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
287 lines (272 loc) · 7.53 KB
/
Copy pathpyproject.toml
File metadata and controls
287 lines (272 loc) · 7.53 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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
[project]
name = "sidemantic"
version = "0.13.2"
description = "Universal semantic layer - import from Cube, dbt, LookML, Hex, and more"
readme = "README.md"
license = {file = "LICENSE"}
requires-python = ">=3.11"
dependencies = [
"antlr4-python3-runtime>=4.13.2",
"sqlglot>=30.1.0",
"pyyaml>=6.0",
"pydantic>=2.0.0",
"jinja2>=3.1.0",
"duckdb>=1.4.4",
"click>=8.0.0",
"typer>=0.18.0",
]
[project.scripts]
sidemantic = "sidemantic.cli:app"
[project.optional-dependencies]
rust = [
# PYODIDE: Native wheels are excluded from Emscripten installs.
"sidemantic-rs==0.13.2; sys_platform != 'emscripten'",
]
dev = [
"pytest>=8.0.0",
"pytest-cov>=5.0.0",
"ruff>=0.6.0",
"mypy>=1.11.0",
"pandas>=2.2,<3",
"numpy>=1.26,<3",
"playwright>=1.50.0",
"fastapi>=0.115.0",
"httpx>=0.28.0",
"jsonschema>=4.23,<5",
"pyarrow>=14.0.0",
"uvicorn>=0.34.0",
# fakesnow pinned out until it supports sqlglot 30.x
# "fakesnow>=0.9.0", # For Snowflake integration tests
"lkml>=1.3.7",
"inflect>=7.0.0",
"antlr4-python3-runtime>=4.13.2",
"sqlglot[c]>=30.1.0",
]
workbench = [
"textual[syntax]>=1.0.0",
"plotext>=5.3.2",
"textual-plotext>=1.0.1",
"lkml>=1.3.7", # The bundled workbench demo includes LookML models.
]
mcp = [
"mcp[cli]>=1.25.0,<2",
"lkml>=1.3.7", # The bundled --demo models include LookML.
]
apps = [
"mcp[cli]>=1.25.0,<2",
"altair>=5.0.0; python_version < '3.14'",
"altair>=6.0.0; python_version >= '3.14'",
"vl-convert-python>=1.0.0",
"lkml>=1.3.7", # The bundled --demo models include LookML.
]
charts = [
"altair>=5.0.0; python_version < '3.14'",
"altair>=6.0.0; python_version >= '3.14'",
"vl-convert-python>=1.0.0",
]
fast = [
"sqlglot[c]>=30.1.0",
]
ossie = [
"jsonschema>=4.23,<5",
]
serve = [
# riffq changes its handler API in minor releases; 0.4 is the tested series.
"riffq>=0.4.1,<0.5",
"pyarrow>=14.0.0",
"lkml>=1.3.7", # The bundled --demo models include LookML.
]
api = [
"fastapi>=0.115.0",
"pyarrow>=14.0.0",
"uvicorn>=0.34.0",
"lkml>=1.3.7", # The bundled --demo models include LookML.
]
postgres = [
"psycopg[binary]>=3.0.0",
"pyarrow>=14.0.0", # For Arrow support
]
bigquery = [
"google-cloud-bigquery>=3.0.0",
"pyarrow>=14.0.0", # For Arrow support
]
snowflake = [
"snowflake-connector-python>=3.0.0",
"pyarrow>=14.0.0", # For Arrow support
]
clickhouse = [
"clickhouse-connect>=0.6.0",
"pyarrow>=14.0.0", # For Arrow support
]
databricks = [
"databricks-sql-connector>=2.0.0",
"pyarrow>=14.0.0", # For Arrow support
]
spark = [
"PyHive>=0.7.0",
"thrift>=0.16.0",
"thrift_sasl>=0.4.3",
"pure-sasl>=0.6.2", # Pure Python SASL for PyHive (no C deps)
"pyarrow>=14.0.0", # For Arrow support
]
adbc = [
"adbc-driver-manager>=1.0.0",
"pyarrow>=14.0.0", # For Arrow support
]
lsp = [
"lsprotocol>=2025.0.0",
"pygls>=2.0.0",
]
dax = [
"sidemantic-dax>=0.13.2",
]
lookml = [
"lkml>=1.3.7",
]
malloy = [
"antlr4-python3-runtime>=4.13.2",
]
metricflow = [
"inflect>=7.0.0",
]
widget = [
"anywidget>=0.9.0",
"pyarrow>=14.0.0",
]
# Convenience bundles
all-databases = [
"sidemantic[postgres,bigquery,snowflake,clickhouse,databricks,spark,adbc]",
]
full = [
"sidemantic[workbench,mcp,apps,charts,lsp,dax,lookml,malloy,metricflow,widget,api,ossie,rust]",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.sdist]
exclude = [
"/.claude",
"/.git",
"/.github",
"/.mypy_cache",
"/.pytest_cache",
"/.ruff_cache",
"/.venv",
"/crates/dax-pyo3/dist",
"/crates/dax-pyo3/target",
"/crates/dax-parser/target",
"/dist",
"/docs",
"/tests",
"/examples/__pycache__",
"/examples/cube",
"/examples/hex",
"/examples/lookml",
"/examples/metricflow",
"/examples/omni",
"/examples/rill",
"/examples/sidemantic",
"/examples/sql",
"/examples/superset",
"/sidemantic-duckdb",
"/sidemantic-rs",
"/plugins",
"/target",
"/vscode-sidemantic",
"**/__pycache__",
"*.pyc",
"*.pkg",
"test_*.py",
"uv.lock",
]
# README.md is included via readme field in [project]
# examples/multi_format_demo is kept for demo mode
[tool.hatch.build.targets.wheel]
packages = ["sidemantic"]
[tool.hatch.build.targets.wheel.shared-data]
"sidemantic/man/sidemantic.1" = "share/man/man1/sidemantic.1"
[tool.hatch.build.targets.wheel.force-include]
"examples/multi_format_demo/cube" = "sidemantic/examples/multi_format_demo/cube"
"examples/multi_format_demo/hex" = "sidemantic/examples/multi_format_demo/hex"
"examples/multi_format_demo/lookml" = "sidemantic/examples/multi_format_demo/lookml"
"examples/multi_format_demo/demo_data.py" = "sidemantic/examples/multi_format_demo/demo_data.py"
"sidemantic/widget/static/widget.js" = "sidemantic/widget/static/widget.js"
"sidemantic/widget/static/widget.css" = "sidemantic/widget/static/widget.css"
[tool.ruff]
line-length = 120
target-version = "py311"
force-exclude = true
extend-exclude = [
"sidemantic/adapters/malloy_grammar", # ANTLR-generated files
"sidemantic/adapters/holistics_grammar", # ANTLR-generated files
"tests/ossie-fixtures/upstream/**/validation/validate.py", # Exact pinned Apache validator fixtures
]
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "UP"]
ignore = ["E501", "N807"] # N807: dunder methods like __init__ are supposed to have __
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["."]
markers = [
"integration: marks tests as integration tests requiring external services (deselect with '-m \"not integration\"')",
"yardstick_upstream: opt-in tests that fetch and replay live upstream Yardstick SQL tests",
]
addopts = "-m 'not integration' --cov=sidemantic --cov-report=term-missing" # Skip integration tests by default and show coverage
[tool.coverage.run]
source = ["sidemantic"]
[tool.mypy]
python_version = "3.11"
files = [
"sidemantic/__init__.py",
"sidemantic/core/dimension.py",
"sidemantic/core/freshness.py",
"sidemantic/core/metric.py",
"sidemantic/core/model.py",
"sidemantic/core/parameter.py",
"sidemantic/core/pre_aggregation.py",
"sidemantic/core/preagg_recommender.py",
"sidemantic/core/query_plan.py",
"sidemantic/core/registry.py",
"sidemantic/core/relationship.py",
"sidemantic/core/security.py",
"sidemantic/core/segment.py",
"sidemantic/core/semantic_graph.py",
"sidemantic/core/semantic_layer.py",
]
check_untyped_defs = true
follow_imports = "skip"
ignore_missing_imports = true
show_error_codes = true
warn_redundant_casts = true
warn_unused_ignores = true
[tool.uv]
prerelease = "if-necessary"
# Require binary wheels for the CPython versions exercised by CI, without
# imposing a Python upper bound on users or requiring future/PyPy wheels.
required-environments = [
"sys_platform == 'linux' and platform_machine == 'x86_64' and implementation_name == 'cpython' and platform_python_implementation == 'CPython' and python_version < '3.15'",
]
[tool.uv.sources]
sidemantic-rs = { path = "sidemantic-rs" }
sidemantic-dax = { path = "crates/dax-pyo3" }
[dependency-groups]
dev = [
"antlr4-python3-runtime>=4.13.2",
"fastapi>=0.115.0",
"httpx>=0.28.0",
"inflect>=7.0.0",
"jupyterlab>=4.5.1",
"lkml>=1.3.7",
"lsprotocol>=2025.0.0",
"marimo==0.23.9",
"numpy>=1.26,<3",
"pandas>=2.2,<3",
"polars>=1.36.1",
"playwright>=1.50.0",
"pyarrow>=14.0.0",
"pygls>=2.0.0",
"pytest>=8.4.2",
"pytest-cov>=5.0.0",
"ruff>=0.14.0",
"uvicorn>=0.34.0",
]