Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5f03a0f

Browse files
authored
Init SQLMesh codebase (SQLMesh#1)
1 parent efe5bac commit 5f03a0f

148 files changed

Lines changed: 19514 additions & 9 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
__pycache__
2+
*.pyc
3+
*.pyo
4+
*.pyd
5+
.Python
6+
env*
7+
.env*
8+
.git
9+
.mypy_cache

.gitignore

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
*.ipynb
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
.python-version
87+
88+
# pipenv
89+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
90+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
91+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
92+
# install all needed dependencies.
93+
#Pipfile.lock
94+
95+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
96+
__pypackages__/
97+
98+
# Celery stuff
99+
celerybeat-schedule
100+
celerybeat.pid
101+
102+
# SageMath parsed files
103+
*.sage.py
104+
105+
# Environments
106+
.env*
107+
.venv
108+
env/
109+
venv/
110+
ENV/
111+
env.bak/
112+
venv.bak/
113+
114+
# Spyder project settings
115+
.spyderproject
116+
.spyproject
117+
118+
# Rope project settings
119+
.ropeproject
120+
121+
# mkdocs documentation
122+
/site
123+
124+
# mypy
125+
.mypy_cache/
126+
.dmypy.json
127+
dmypy.json
128+
129+
# Pyre type checker
130+
.pyre/
131+
132+
# PyCharm
133+
.idea/
134+
135+
# Emacs
136+
*~
137+
*#
138+
139+
# Airflow example
140+
example/airflow/Dockerfile
141+
example/airflow/docker-compose.yaml
142+
example/airflow/airflow.sh
143+
example/airflow/.env
144+
example/airflow/logs
145+
example/airflow/plugins
146+
example/airflow/warehouse
147+
148+
*.duckdb
149+
*.duckdb.wal

.pre-commit-config.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: autoflake
5+
name: autoflake
6+
entry: autoflake
7+
language: system
8+
"types": [ python ]
9+
require_serial: true
10+
files: ^(sqlmesh/|tests/|web/|example/|setup.py)
11+
- id: isort
12+
name: isort
13+
entry: isort
14+
language: system
15+
"types": [ python ]
16+
files: ^(sqlmesh/|tests/|web/|example/|setup.py)
17+
require_serial: true
18+
- id: black
19+
name: black
20+
language: system
21+
entry: black
22+
require_serial: true
23+
files: ^(sqlmesh/|tests/|web/|example/|setup.py)
24+
types_or:
25+
- python
26+
- pyi
27+
- id: mypy
28+
name: mypy
29+
language: system
30+
entry: mypy
31+
"types": [ python ]
32+
files: ^(sqlmesh/|tests/|web/|setup.py)
33+
require_serial: true

Makefile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
.PHONY: docs
2+
3+
install-dev:
4+
pip install -e ".[dev,web]"
5+
6+
install-pre-commit:
7+
pre-commit install
8+
9+
style:
10+
pre-commit run --all-files
11+
12+
unit-test:
13+
pytest -m "not integration"
14+
15+
doc-test:
16+
PYTEST_PLUGINS=tests.common_fixtures pytest --doctest-modules sqlmesh/core sqlmesh/utils
17+
18+
core-it-test:
19+
pytest -m "core_integration"
20+
21+
it-test: core-it-test airflow-it-test-with-env
22+
23+
test: unit-test it-test doc-test
24+
25+
airflow-init:
26+
export AIRFLOW_ENGINE_OPERATOR=spark && make -C ./example/airflow init
27+
28+
airflow-run:
29+
make -C ./example/airflow run
30+
31+
airflow-stop:
32+
make -C ./example/airflow stop
33+
34+
airflow-clean:
35+
make -C ./example/airflow clean
36+
37+
airflow-psql:
38+
make -C ./example/airflow psql
39+
40+
airflow-spark-sql:
41+
make -C ./example/airflow spark-sql
42+
43+
airflow-it-test:
44+
export AIRFLOW__DATABASE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow:airflow@localhost/airflow && \
45+
pytest -m "airflow_integration"
46+
47+
airflow-it-test-with-env: airflow-clean airflow-init airflow-run airflow-it-test airflow-stop
48+
49+
docs:
50+
pdoc/cli.py -o docs
51+
52+
docs-serve:
53+
pdoc/cli.py
54+
55+
web-serve:
56+
uvicorn web.main:app --port 8000 --reload

0 commit comments

Comments
 (0)