# ============================================================ # Senti AI — Project Task Runner # ============================================================ # Usage: make # Run `make help` to see all available targets. # ============================================================ .PHONY: help dev test test-unit test-integration test-golden build-rust lint clean setup PYTHON ?= python PYTEST ?= pytest SENTI_DIR = senti help: ## Show this help @echo "Senti AI — Available commands:" @echo "" @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \ awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' @echo "" # --- Development --- dev: ## Start FastAPI dev server cd $(SENTI_DIR) && $(PYTHON) -m uvicorn backend.api.main:app --reload --port 8000 setup: ## Install Python dependencies pip install -r $(SENTI_DIR)/requirements.txt # --- Testing --- test: ## Run all tests cd $(SENTI_DIR) && $(PYTEST) tests/ -v --tb=short test-unit: ## Run unit tests only cd $(SENTI_DIR) && $(PYTEST) tests/unit/ -v --tb=short test-integration: ## Run integration tests only cd $(SENTI_DIR) && $(PYTEST) tests/integration/ -v --tb=short test-golden: ## Run golden answer tests cd $(SENTI_DIR) && $(PYTEST) tests/golden/ -v --tb=short test-auth: ## Run auth tests only cd $(SENTI_DIR) && $(PYTEST) tests/unit/test_auth.py tests/integration/test_auth_flow.py -v # --- Rust Engine --- build-rust: ## Build the Rust senti_calc engine cd $(SENTI_DIR)/senti_calc && maturin develop --release # --- Code Quality --- lint: ## Run linting checks cd $(SENTI_DIR) && $(PYTHON) -m ruff check . # --- Database --- migrate: ## Run database migrations (Alembic) cd $(SENTI_DIR) && alembic upgrade head # --- Cleanup --- clean: ## Remove build artifacts, caches, and temp files find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true find . -name "*.pyc" -delete 2>/dev/null || true @echo "Cleaned." # --- Docker --- docker-build: ## Build Docker image docker build -t senti-ai . docker-up: ## Start all services via docker-compose docker-compose up -d docker-down: ## Stop all services docker-compose down