-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (48 loc) · 1.55 KB
/
Makefile
File metadata and controls
60 lines (48 loc) · 1.55 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
54
55
56
57
58
59
60
.PHONY: setup dev test lint ast-verify migrate db-start db-stop db-status clean
# Development setup
setup: db-start
python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
@echo ""
@echo "Creating database if it doesn't exist..."
createdb agentgraph 2>/dev/null || true
@echo ""
@echo "Setup complete. Activate venv with: source .venv/bin/activate"
# Run dev server
dev:
.venv/bin/uvicorn src.main:app --reload --host 0.0.0.0 --port 8000
# Run tests
test:
.venv/bin/pytest tests/ -v
# Lint
lint:
.venv/bin/ruff check src/ tests/
# Lint and fix
lint-fix:
.venv/bin/ruff check --fix src/ tests/
# AST verify all Python files
ast-verify:
@find src tests -name "*.py" -exec python3 -c "import ast, sys; ast.parse(open(sys.argv[1]).read()); print('OK:', sys.argv[1])" {} \;
# Run Alembic migration
migrate:
.venv/bin/alembic upgrade head
# Create new migration
migration:
@read -p "Migration message: " msg; \
.venv/bin/alembic revision --autogenerate -m "$$msg"
# Database management (Homebrew services)
db-start:
brew services start postgresql@16 2>/dev/null || true
brew services start redis 2>/dev/null || true
@echo "PostgreSQL and Redis started"
db-stop:
brew services stop postgresql@16 2>/dev/null || true
brew services stop redis 2>/dev/null || true
@echo "PostgreSQL and Redis stopped"
db-status:
@brew services list | grep -E "postgresql|redis"
# Clean build artifacts
clean:
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
rm -rf .pytest_cache .coverage htmlcov