-
Notifications
You must be signed in to change notification settings - Fork 356
Expand file tree
/
Copy pathpyproject.toml
More file actions
317 lines (296 loc) · 8.55 KB
/
pyproject.toml
File metadata and controls
317 lines (296 loc) · 8.55 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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
[project]
name = "sqlmesh"
dynamic = ["version"]
description = "Next-generation data transformation framework"
readme = "README.md"
authors = [{ name = "TobikoData Inc.", email = "engineering@tobikodata.com" }]
license = { file = "LICENSE" }
requires-python = ">= 3.9"
dependencies = [
"astor",
"click",
"croniter",
"duckdb>=0.10.0,!=0.10.3",
"dateparser<=1.2.1",
"humanize",
"hyperscript>=0.1.0",
"importlib-metadata; python_version<'3.12'",
"ipywidgets",
"jinja2",
"packaging",
"pandas<3.0.0",
"pydantic>=2.0.0",
"python-dotenv",
"requests",
"rich[jupyter]",
"ruamel.yaml",
"sqlglot[rs]~=28.10.1",
"tenacity",
"time-machine",
"json-stream"
]
classifiers = [
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: SQL",
"Programming Language :: Python :: 3 :: Only",
]
[project.optional-dependencies]
athena = ["PyAthena[Pandas]"]
azuresql = ["pymssql"]
azuresql-odbc = ["pyodbc>=5.0.0"]
bigquery = [
"google-cloud-bigquery[pandas]",
"google-cloud-bigquery-storage"
]
# bigframes has to be separate to support environments with an older google-cloud-bigquery pin
# this is because that pin pulls in an older bigframes and the bigframes team
# pinned an older SQLGlot which is incompatible with SQLMesh
bigframes = ["bigframes>=1.32.0"]
clickhouse = ["clickhouse-connect"]
databricks = ["databricks-sql-connector[pyarrow]"]
dev = [
"agate",
"beautifulsoup4",
"clickhouse-connect",
"cryptography",
"databricks-sql-connector",
"dbt-bigquery",
"dbt-core",
"dbt-duckdb>=1.7.1",
# version 1.10.1 of dbt-snowflake declares that it's compatible with dbt-adapters>=1.16 but in reality
# it depends on the 'InvalidCatalogIntegrationConfigError' class that only exists as of dbt-adapters==1.16.6
# so we exclude it to prevent failures and hope that upstream releases a new version with the correct constraint
"dbt-snowflake!=1.10.1",
"dbt-athena-community",
"dbt-clickhouse",
"dbt-databricks",
"dbt-redshift",
"dbt-trino",
"Faker",
"google-auth",
"google-cloud-bigquery",
"google-cloud-bigquery-storage",
"httpx",
"mypy~=1.13.0",
"numpy",
"pandas-stubs",
"pre-commit",
"psycopg2-binary",
"pydantic",
"PyAthena[Pandas]",
"PyGithub>=2.6.0",
"pyodbc>=5.0.0",
"pyperf",
"pyspark~=3.5.0",
"pytest",
"pytest-asyncio",
"pytest-mock",
"pytest-rerunfailures",
"pytest-xdist",
"pytz",
"redshift_connector",
"ruff~=0.11.0",
"snowflake-connector-python[pandas,secure-local-storage]>=3.0.2",
"sqlalchemy-stubs",
"trino",
"types-croniter",
"types-dateparser",
"types-PyMySQL",
"types-python-dateutil",
"types-pytz",
"types-requests==2.28.8",
"typing-extensions",
]
dbt = ["dbt-core<2"]
dlt = ["dlt"]
duckdb = []
fabric = ["pyodbc>=5.0.0"]
gcppostgres = ["cloud-sql-python-connector[pg8000]>=1.8.0"]
github = ["PyGithub>=2.6.0"]
motherduck = ["duckdb>=1.3.2"]
mssql = ["pymssql"]
mssql-odbc = ["pyodbc>=5.0.0"]
mysql = ["pymysql"]
mwaa = ["boto3"]
postgres = ["psycopg2"]
redshift = ["redshift_connector"]
slack = ["slack_sdk"]
snowflake = [
"cryptography",
"snowflake-connector-python[pandas,secure-local-storage]",
"snowflake-snowpark-python",
]
trino = ["trino"]
web = [
"fastapi==0.120.1",
"watchfiles>=0.19.0",
"uvicorn[standard]==0.22.0",
"sse-starlette>=0.2.2",
"pyarrow",
]
lsp = [
# Duplicate of web
"fastapi==0.120.1",
"watchfiles>=0.19.0",
# "uvicorn[standard]==0.22.0",
"sse-starlette>=0.2.2",
"pyarrow",
# For lsp
"pygls>=1.2.0,<2.0.0",
"lsprotocol",
]
risingwave = ["psycopg2"]
[project.scripts]
sqlmesh = "sqlmesh.cli.main:cli"
sqlmesh_dbt = "sqlmesh_dbt.cli:dbt"
sqlmesh_cicd = "sqlmesh.cicd.bot:bot"
sqlmesh_lsp = "sqlmesh.lsp.main:main"
[project.urls]
Homepage = "https://sqlmesh.com/"
Documentation = "https://sqlmesh.readthedocs.io/en/stable/"
Repository = "https://github.com/TobikoData/sqlmesh"
Issues = "https://github.com/TobikoData/sqlmesh/issues"
[build-system]
requires = ["setuptools >= 61.0", "setuptools_scm"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
include-package-data = false
[tool.setuptools_scm]
version_file = "sqlmesh/_version.py"
fallback_version = "0.0.0"
local_scheme = "no-local-version"
[tool.setuptools.packages.find]
include = ["sqlmesh", "sqlmesh.*", "sqlmesh_dbt", "sqlmesh_dbt.*", "web*"]
[tool.setuptools.package-data]
web = ["client/dist/**"]
"*" = ["py.typed"]
# MyPy Rules
[tool.mypy]
plugins = "pydantic.mypy"
no_implicit_optional = true
disallow_untyped_defs = true
[[tool.mypy.overrides]]
module = [
"examples.*.macros.*",
"tests.*",
"sqlmesh.migrations.*"
]
disallow_untyped_defs = false
# Sometimes it's helpful to use types within an "untyped" function because it allows IDE assistance
# Unfortunately this causes MyPy to print an annoying 'By default the bodies of untyped functions are not checked'
# warning so we disable that warning here
disable_error_code = "annotation-unchecked"
[[tool.mypy.overrides]]
module = [
"api.*",
"astor.*",
"IPython.*",
"hyperscript.*",
"py.*",
"ruamel.*",
"setuptools.*",
"graphviz.*",
"ipywidgets.*",
"google.*",
"snowflake.*",
"redshift_connector",
"databricks.*",
"faker.*",
"agate.*",
"databricks_cli.*",
"mysql.*",
"pymssql.*",
"pyodbc.*",
"psycopg2.*",
"pytest_lazyfixture.*",
"dbt.adapters.*",
"slack_sdk.*",
"py4j.*",
"boto3.*",
"trino.*",
"bs4.*",
"pydantic_core.*",
"dlt.*",
"bigframes.*",
"json_stream.*",
"duckdb.*"
]
ignore_missing_imports = true
[tool.pytest.ini_options]
markers = [
# Test Type Markers
# Tests are ordered from fastest to slowest
"fast: fast tests (automatically applied if no type markers)",
"slow: slow tests that typically involve interacting with a local DB (like DuckDB)",
"docker: test that involves interacting with a Docker container",
"remote: test that involves interacting with a remote DB",
"cicdonly: test that only runs on CI/CD",
"isolated: tests that need to run sequentially usually because they use fork",
"dialect_isolated: tests that need to run separately due to global dialect overrides",
# Test Domain Markers
# default: core functionality
"cli: test for CLI",
"dbt: test for dbt adapter",
"github: test for Github CI/CD bot",
"jupyter: tests for Jupyter integration",
"web: tests for web UI",
# Engine Adapters
"engine: test all engine adapters",
"athena: test for Athena",
"bigquery: test for BigQuery",
"clickhouse: test for Clickhouse (standalone mode / cluster mode)",
"clickhouse_cloud: test for Clickhouse (cloud mode)",
"databricks: test for Databricks",
"duckdb: test for DuckDB",
"fabric: test for Fabric",
"motherduck: test for MotherDuck",
"mssql: test for MSSQL",
"mysql: test for MySQL",
"postgres: test for Postgres",
"gcp_postgres: test for Postgres on GCP",
"redshift: test for Redshift",
"snowflake: test for Snowflake",
"spark: test for Spark",
"pyspark: test for PySpark that need to run separately from the other spark tests",
"trino: test for Trino (all connectors)",
"risingwave: test for Risingwave",
# Other
"set_default_connection",
"registry_isolation"
]
addopts = "-n 0 --dist=loadgroup"
asyncio_default_fixture_loop_scope = "session"
log_cli = false # Set this to true to enable logging during tests
log_cli_format = "%(asctime)s.%(msecs)03d %(filename)s:%(lineno)d %(levelname)s %(message)s"
log_cli_level = "INFO"
filterwarnings = [
"ignore:The localize method is no longer necessary, as this time zone supports the fold attribute"
]
reruns_delay = 10
[tool.ruff]
line-length = 100
[tool.ruff.lint]
select = [
"F401",
"RET505",
"T100",
]
extend-select = ["TID"]
[tool.ruff.lint.flake8-tidy-imports]
banned-module-level-imports = [
"duckdb",
"numpy",
"pandas",
]
# Bans imports from sqlmesh.lsp in files outside of sqlmesh/lsp
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"sqlmesh.lsp".msg = "Only files within sqlmesh/lsp can import from sqlmesh.lsp"
[tool.ruff.lint.per-file-ignores]
# TID251 is used to ignore the import of sqlmesh.lsp in files outside sqlmesh/lsp
"sqlmesh/lsp/**/*.py" = ["TID251"]
"tests/lsp/**/*.py" = ["TID251"]
"benchmarks/lsp*.py" = ["TID251"]
"sqlmesh/dbt/builtin.py" = ["T100"]