-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (51 loc) · 2.05 KB
/
Copy pathMakefile
File metadata and controls
64 lines (51 loc) · 2.05 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
61
62
63
64
# Makefile for A2A-ACP Server
.PHONY: help install dev-install format lint type test quality clean
help:
@echo "Available commands:"
@echo " install - Create venv and install production dependencies."
@echo " dev-install - Create venv and install all (prod + dev) dependencies."
@echo " format - Format code with black and ruff."
@echo " lint - Lint code with ruff."
@echo " type - Type-check code with mypy."
@echo " test - Run tests with pytest."
@echo " quality - Run all quality checks (format, lint, type, test)."
@echo " clean - Remove virtual environment and cache files."
# Create a virtual environment if it doesn't exist
.venv:
python3 -m venv .venv
./.venv/bin/pip install -U pip uv
# Installation targets
install: .venv
@echo "--> Installing production dependencies..."
./.venv/bin/uv pip install .
dev-install: .venv
@echo "--> Installing development dependencies..."
./.venv/bin/uv pip install ".[dev]"
# Quality check targets, depend on dev-install to ensure tools are present
format: dev-install
@echo "--> Formatting code..."
./.venv/bin/uv run black src tests
./.venv/bin/uv run ruff format src tests
./.venv/bin/uv run ruff check src tests --fix
lint: dev-install
@echo "--> Linting code..."
./.venv/bin/uv run ruff check src tests
type: dev-install
@echo "--> Type-checking code..."
./.venv/bin/uv run mypy src
test: dev-install
@echo "--> Running tests..."
A2A_AGENT_COMMAND=true timeout 60 ./.venv/bin/uv run python -m pytest --tb=no -q
coverage: dev-install
@echo "--> Running tests with coverage..."
A2A_AGENT_COMMAND=true timeout 60 ./.venv/bin/uv run python -m pytest --tb=no --cov=src --cov-report=term-missing --cov-report=html
quality: format lint type test
# Cleanup target
clean:
@echo "--> Cleaning up..."
rm -rf .venv
rm -rf .pytest_cache .mypy_cache .ruff_cache
find . -type d -name "__pycache__" -exec rm -r {} +
run: dev-install
@echo "--> Starting A2A-ACP Server..."
./.venv/bin/uv run uvicorn src.a2a_acp.main:create_app --port $(or $(PORT),8000) --host "0.0.0.0"