File size: 2,264 Bytes
021e065
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# ============================================================
# Senti AI — Project Task Runner
# ============================================================
# Usage: make <target>
# 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