-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (35 loc) · 2.62 KB
/
Copy pathMakefile
File metadata and controls
53 lines (35 loc) · 2.62 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
.PHONY: help install test lint requirements migrate full-deploy deploy-destroy clean
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-15s %s\n", $$1, $$2}'
# ── Dev ──────────────────────────────────────────────────────────────────────
install: ## Install all dependencies (incl. dev)
uv sync --all-groups
test: ## Run unit tests
uv run pytest tests/ -v
test-cov: ## Run tests with coverage report
uv run pytest tests/ -v --tb=short --cov=claw --cov-report=term-missing
lint: ## Lint and type-check
uv run ruff check claw/ tests/
uv run mypy claw/ --ignore-missing-imports
requirements: ## Generate requirements.txt from pyproject.toml
uv export --no-dev --no-hashes -o requirements.txt
# ── Database ─────────────────────────────────────────────────────────────────
migrate: ## Run Alembic migrations to head (requires DATABRICKS_* env vars)
uv run python scripts/migrate.py
migrate-local: ## Run migrations against local Postgres (requires PGHOST, PGUSER, PGPASSWORD, PGDATABASE)
uv run alembic upgrade head
migration: ## Autogenerate a new migration (MSG="description")
uv run alembic revision --autogenerate -m "$(MSG)"
# ── App ───────────────────────────────────────────────────────────────────────
run: ## Run the app locally (requires .env)
uv run uvicorn claw.main:app --host 0.0.0.0 --port 8000 --reload
# ── Deploy ────────────────────────────────────────────────────────────────────
full-deploy: ## Full deploy (build + validate + deploy + migrate + start)
bash scripts/deploy.sh full
deploy-destroy: ## Tear down the Databricks App
databricks bundle destroy
# ── Cleanup ───────────────────────────────────────────────────────────────────
clean: ## Remove build artifacts and caches
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -name "*.pyc" -delete 2>/dev/null || true
rm -rf .venv dist build *.egg-info .pytest_cache .coverage