Skip to content

Commit 173a4c0

Browse files
authored
Chore!: Switch from setup.py to pyproject.toml (#3953)
1 parent 20871ed commit 173a4c0

8 files changed

Lines changed: 198 additions & 206 deletions

File tree

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ ui-style:
1919
SKIP=ruff,ruff-format,mypy pre-commit run --all-files
2020

2121
doc-test:
22-
PYTEST_PLUGINS=tests.common_fixtures pytest --doctest-modules sqlmesh/core sqlmesh/utils
22+
PYTEST_PLUGINS=tests.common_fixtures python -m pytest --doctest-modules sqlmesh/core sqlmesh/utils
2323

2424
package:
25-
pip3 install wheel && python3 setup.py sdist bdist_wheel
25+
pip3 install build && python3 -m build
2626

2727
publish: package
2828
pip3 install twine && python3 -m twine upload dist/*
2929

3030
package-tests:
31-
pip3 install wheel && python3 tests/setup.py sdist bdist_wheel
31+
pip3 install build && cp pyproject.toml tests/sqlmesh_pyproject.toml && python3 -m build tests/
3232

3333
publish-tests: package-tests
3434
pip3 install twine && python3 -m twine upload -r tobiko-private tests/dist/*

examples/airflow/Dockerfile.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ RUN pip install apache-airflow-providers-databricks==6.4.0 \
6464

6565
# Install Deps
6666
USER root
67-
ADD setup.py /opt/sqlmesh/setup.py
67+
ADD pyproject.toml /opt/sqlmesh/pyproject.toml
6868
RUN mkdir /opt/sqlmesh/sqlmesh && touch /opt/sqlmesh/sqlmesh/__init__.py && chown -R airflow /opt/sqlmesh
6969

7070
ADD examples/custom_materializations /opt/custom_materializations

pyproject.toml

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
[project]
2+
name = "sqlmesh"
3+
dynamic = ["version"]
4+
description = "Next-generation data transformation framework"
5+
readme = "README.md"
6+
authors = [{ name = "TobikoData Inc.", email = "engineering@tobikodata.com" }]
7+
license = { file = "LICENSE" }
8+
requires-python = ">= 3.9"
9+
dependencies = [
10+
"astor",
11+
"click",
12+
"croniter",
13+
"duckdb!=0.10.3",
14+
"dateparser",
15+
"hyperscript>=0.1.0",
16+
"importlib-metadata; python_version<'3.12'",
17+
"ipywidgets",
18+
"jinja2",
19+
"pandas",
20+
"pydantic>=2.0.0",
21+
"requests",
22+
"rich[jupyter]",
23+
"ruamel.yaml",
24+
"sqlglot[rs]~=26.8.0",
25+
"tenacity",
26+
"time-machine",
27+
]
28+
classifiers=[
29+
"Intended Audience :: Developers",
30+
"Intended Audience :: Science/Research",
31+
"License :: OSI Approved :: Apache Software License",
32+
"Operating System :: OS Independent",
33+
"Programming Language :: SQL",
34+
"Programming Language :: Python :: 3 :: Only",
35+
]
36+
37+
[project.optional-dependencies]
38+
athena = ["PyAthena[Pandas]"]
39+
azuresql = ["pymssql"]
40+
bigquery = [
41+
"google-cloud-bigquery[pandas]",
42+
"google-cloud-bigquery-storage"
43+
]
44+
bigframes = ["bigframes>=1.32.0"]
45+
clickhouse = ["clickhouse-connect"]
46+
databricks = ["databricks-sql-connector"]
47+
dev = [
48+
"agate==1.7.1",
49+
"apache-airflow==2.9.1",
50+
"opentelemetry-proto==1.27.0", # pip was having trouble resolving this transitive dependency of airflow
51+
"beautifulsoup4",
52+
"clickhouse-connect",
53+
"cryptography",
54+
"databricks-sql-connector",
55+
"dbt-bigquery",
56+
"dbt-core",
57+
"dbt-duckdb>=1.7.1",
58+
"dbt-snowflake",
59+
"dbt-athena-community",
60+
"dbt-clickhouse",
61+
"dbt-databricks",
62+
"dbt-redshift",
63+
"dbt-sqlserver>=1.7.0",
64+
"dbt-trino",
65+
"Faker",
66+
"google-auth",
67+
"google-cloud-bigquery",
68+
"google-cloud-bigquery-storage",
69+
"mypy~=1.13.0",
70+
"pandas-stubs",
71+
"pre-commit",
72+
"psycopg2-binary",
73+
"pydantic",
74+
"PyAthena[Pandas]",
75+
"PyGithub~=2.5.0",
76+
"pyspark~=3.5.0",
77+
"pytest",
78+
"pytest-asyncio",
79+
"pytest-mock",
80+
"pytest-retry",
81+
"pytest-xdist",
82+
"pytz",
83+
"redshift_connector",
84+
"ruff~=0.7.0",
85+
"snowflake-connector-python[pandas,secure-local-storage]>=3.0.2",
86+
"sqlalchemy-stubs",
87+
"trino",
88+
"types-croniter",
89+
"types-dateparser",
90+
"types-PyMySQL",
91+
"types-python-dateutil",
92+
"types-pytz",
93+
"types-requests==2.28.8",
94+
"typing-extensions",
95+
]
96+
dbt = ["dbt-core<2"]
97+
dlt = ["dlt"]
98+
gcppostgres = ["cloud-sql-python-connector[pg8000]>=1.8.0"]
99+
github = ["PyGithub~=2.5.0"]
100+
llm = ["langchain", "openai"]
101+
mssql = ["pymssql"]
102+
mysql = ["pymysql"]
103+
mwaa = ["boto3"]
104+
postgres = ["psycopg2"]
105+
redshift = ["redshift_connector"]
106+
slack = ["slack_sdk"]
107+
snowflake = [
108+
"cryptography",
109+
"snowflake-connector-python[pandas,secure-local-storage]",
110+
# as at 2024-08-05, snowflake-snowpark-python is only available up to Python 3.11
111+
"snowflake-snowpark-python; python_version<'3.12'",
112+
]
113+
trino = ["trino"]
114+
web = [
115+
"fastapi==0.115.5",
116+
"watchfiles>=0.19.0",
117+
"uvicorn[standard]==0.22.0",
118+
"sse-starlette>=0.2.2",
119+
"pyarrow",
120+
]
121+
risingwave = ["psycopg2"]
122+
123+
[project.scripts]
124+
sqlmesh = "sqlmesh.cli.main:cli"
125+
sqlmesh_cicd = "sqlmesh.cicd.bot:bot"
126+
127+
[project.entry-points."airflow.plugins"]
128+
sqlmesh_airflow = "sqlmesh.schedulers.airflow.plugin:SqlmeshAirflowPlugin"
129+
130+
[project.urls]
131+
Homepage = "https://sqlmesh.com/"
132+
Documentation = "https://sqlmesh.readthedocs.io/en/stable/"
133+
Repository = "https://github.com/TobikoData/sqlmesh"
134+
Issues = "https://github.com/TobikoData/sqlmesh/issues"
135+
136+
[build-system]
137+
requires = ["setuptools >= 61.0", "setuptools_scm"]
138+
build-backend = "setuptools.build_meta"
139+
140+
[tool.setuptools]
141+
include-package-data = false
142+
143+
[tool.setuptools_scm]
144+
version_file = "sqlmesh/_version.py"
145+
fallback_version = "0.0.0"
146+
local_scheme = "no-local-version"
147+
148+
[tool.setuptools.packages.find]
149+
include=["sqlmesh", "sqlmesh.*", "web*"]
150+
151+
[tool.setuptools.package-data]
152+
web = ["client/dist/**"]
153+
"*" = ["py.typed"]
154+
155+

setup.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[metadata]
2-
version = attr: sqlmesh.__version__
3-
41
[mypy]
52
plugins = pydantic.mypy
63
no_implicit_optional = True

setup.py

Lines changed: 0 additions & 175 deletions
This file was deleted.

tests/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sqlmesh_pyproject.toml

0 commit comments

Comments
 (0)