-
Notifications
You must be signed in to change notification settings - Fork 6
Improve Type Hints + Increase Type Checking + Added Makefile #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1e409b2
18eaf54
a7bfe62
2b1da67
ddbda2c
48b9f54
0a4b674
feadd67
189ce5d
7c8263f
1badfdc
6612013
f1430c1
f3f5250
0118277
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,4 +61,7 @@ dbt_packages/ | |
# Python | ||
*.pyc | ||
|
||
*.db | ||
*.db | ||
*.db.* | ||
|
||
sample/dagster_project/storage/ |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.6.2 # Match your ruff version from pyproject.toml | ||
hooks: | ||
- id: ruff | ||
args: [--fix] | ||
- id: ruff-format | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.8.0 | ||
hooks: | ||
- id: mypy | ||
args: [ | ||
--cache-dir=.mypy_cache, # Enable caching for faster runs | ||
--ignore-missing-imports, # Ignore missing imports from third-party packages | ||
] | ||
additional_dependencies: | ||
# Type stubs only - these are lightweight | ||
- types-setuptools | ||
- types-requests | ||
- types-sqlalchemy | ||
- types-PyYAML | ||
- types-python-dateutil | ||
- pyarrow-stubs>=17.0.0 | ||
# Core packages with minimal dependencies | ||
- "dagster[mypy]>=1.7.8" # Only mypy-related dependencies | ||
- sqlmesh<1.0 # No alternative minimal package available | ||
- pytest>=8.0.0 # Includes type hints | ||
# Required for polars integration | ||
- polars>=0.20.5 # No type stubs available yet | ||
- dagster-duckdb-polars>=0.21.8 # Required for polars integration | ||
|
||
- repo: https://github.com/astral-sh/uv-pre-commit | ||
rev: 0.6.2 # Latest stable version | ||
hooks: | ||
- id: uv-lock | ||
name: Lock dependencies | ||
args: ["--python", "3.11"] | ||
files: ^pyproject\.toml$ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# System detection | ||
UNAME := "$(shell uname)" | ||
PYTHON_VENV_NAME := ".venv" | ||
|
||
# Python virtual environment settings | ||
VENV_NAME := .venv | ||
PYTHON := python | ||
|
||
# Check if we're on Windows | ||
ifeq ($(OS),Windows_NT) | ||
PYTHON_CMD := $(CURDIR)/$(VENV_NAME)/Scripts/python | ||
SQLMESH_CMD := $(CURDIR)/$(VENV_NAME)/Scripts/sqlmesh | ||
UV_CMD := "$(subst \,/,$(USERPROFILE))/.local/bin/uv.exe" | ||
ACTIVATE := source $(CURDIR)/$(VENV_NAME)/Scripts/activate | ||
DEACTIVATE := source $(CURDIR)/$(VENV_NAME)/Scripts/deactivate | ||
else | ||
PYTHON_CMD := $(CURDIR)/$(VENV_NAME)/bin/python | ||
SQLMESH_CMD := $(CURDIR)/$(VENV_NAME)/bin/sqlmesh | ||
UV_CMD := uv | ||
ACTIVATE := source $(CURDIR)/$(VENV_NAME)/bin/activate | ||
DEACTIVATE := deactivate | ||
endif | ||
|
||
# Python setup commands | ||
install-python: | ||
ifeq ($(UNAME),"Darwin") | ||
brew install python@3.12 | ||
else | ||
@echo "Please install Python 3.12 manually for your operating system" | ||
@echo "Visit: https://www.python.org/downloads/" | ||
@exit 1 | ||
endif | ||
|
||
check-uv: | ||
@if [ "$(shell uname)" = "Darwin" ]; then \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hrm. This is another thing that should not be the responsibility of this repository. I'd likely get rid of this as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will remove |
||
which uv > /dev/null || (echo "Installing uv via Homebrew..." && brew install uv); \ | ||
else \ | ||
which uv > /dev/null || (echo "Installing uv via curl..." && curl -LsSf https://astral.sh/uv/install.sh | sh); \ | ||
fi | ||
|
||
init-python: | ||
@if [ ! -d "$(PYTHON_VENV_NAME)" ]; then \ | ||
echo "Creating virtual environment with Python 3.12..."; \ | ||
uv venv --python 3.12 $(PYTHON_VENV_NAME); \ | ||
fi | ||
|
||
install-python-deps: | ||
uv sync --all-extras | ||
|
||
upgrade-python-deps: | ||
uv lock --upgrade | ||
make install-python-deps | ||
|
||
# Node.js setup commands | ||
install-node: | ||
ifeq ($(UNAME),"Darwin") | ||
brew install node@18 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as with the python part of this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep will remove |
||
else | ||
@echo "Please install Node.js 18 manually for your operating system" | ||
@echo "Visit: https://nodejs.org/dist/latest-v18.x/" | ||
@exit 1 | ||
endif | ||
|
||
check-pnpm: | ||
@if [ "$(shell uname)" = "Darwin" ]; then \ | ||
which pnpm > /dev/null || (echo "Installing pnpm via npm..." && npm install -g pnpm); \ | ||
else \ | ||
which pnpm > /dev/null || (echo "Installing pnpm via npm..." && npm install -g pnpm); \ | ||
fi | ||
|
||
install-node-deps: | ||
pnpm install | ||
|
||
upgrade-node-deps: | ||
pnpm update | ||
|
||
# Base commands | ||
init: check-uv init-python install-python-deps check-pnpm install-node-deps | ||
|
||
clean: | ||
find . \( -type d -name "__pycache__" -o -type f -name "*.pyc" -o -type d -name ".pytest_cache" -o -type d -name "*.egg-info" \) -print0 | xargs -0 rm -rf | ||
|
||
# Testing commands | ||
test: | ||
$(PYTHON_CMD) -m pytest -vv --log-cli-level=INFO $(filter-out $@,$(MAKECMDGOALS)) | ||
|
||
mypy: | ||
$(PYTHON_CMD) -m mypy dagster_sqlmesh/ sample/ | ||
|
||
# Sample project commands | ||
clean-dagster: | ||
rm -rf sample/dagster_project/storage sample/dagster_project/logs sample/dagster_project/history | ||
|
||
dagster-dev: clean-dagster | ||
DAGSTER_HOME=$(CURDIR)/sample/dagster_project $(PYTHON_CMD) -m dagster dev -h 0.0.0.0 -w sample/dagster_project/workspace.yaml | ||
|
||
dev: dagster-dev # Alias for dagster-dev | ||
|
||
dagster-materialize: | ||
$(PYTHON_CMD) -m dagster asset materialize -f sample/dagster_project/definitions.py --select '*' | ||
|
||
.PHONY: init init-python install-python check-uv install-python-deps upgrade-python-deps clean test mypy install-node check-pnpm install-node-deps upgrade-node-deps sample-dev dagster-dev dagster-materialize clean-dagster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this kind of thing is the responsibility of this repository. You should have python installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. Will remove.