-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
107 lines (95 loc) · 3.12 KB
/
Makefile
File metadata and controls
107 lines (95 loc) · 3.12 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
.PHONY: install clean test format check lint typecheck security build
# Install Python dependencies with pre-commit hooks
install:
@echo "Creating virtual environment..."
@test -d .venv || python3 -m venv .venv
@echo "Installing package with dev dependencies..."
@. .venv/bin/activate && pip install -e ".[dev]"
@echo "Installing pre-commit hooks..."
@. .venv/bin/activate && pre-commit install
@echo "✓ Installation complete!"
@echo ""
@echo "Activate virtual environment with: source .venv/bin/activate"
# Clean build artifacts and caches
clean:
rm -rf .mypy_cache .ruff_cache .pytest_cache .venv __pycache__
rm -rf build/ dist/ *.egg-info
rm -rf src/**/__pycache__ tests/**/__pycache__
rm -rf .coverage htmlcov/
find . -type f -name '*.pyc' -delete
find . -type d -name '__pycache__' -delete
# Run tests
test:
@if [ ! -d ".venv" ]; then \
echo "Error: Virtual environment not found. Run 'make install' first."; \
exit 1; \
fi
.venv/bin/python -m pytest
# Run tests with coverage
test-cov:
@if [ ! -d ".venv" ]; then \
echo "Error: Virtual environment not found. Run 'make install' first."; \
exit 1; \
fi
.venv/bin/python -m pytest --cov=src --cov-report=html --cov-report=term
# Format code with ruff
format:
@if [ ! -d ".venv" ]; then \
echo "Error: Virtual environment not found. Run 'make install' first."; \
exit 1; \
fi
.venv/bin/ruff format src/ tests/
# Lint with ruff
lint:
@if [ ! -d ".venv" ]; then \
echo "Error: Virtual environment not found. Run 'make install' first."; \
exit 1; \
fi
.venv/bin/ruff check src/ tests/
# Type check with mypy
typecheck:
@if [ ! -d ".venv" ]; then \
echo "Error: Virtual environment not found. Run 'make install' first."; \
exit 1; \
fi
.venv/bin/mypy src/
# Security check with bandit
security:
@if [ ! -d ".venv" ]; then \
echo "Error: Virtual environment not found. Run 'make install' first."; \
exit 1; \
fi
.venv/bin/bandit -r src/ -ll
# Run all checks (lint, typecheck, security, test)
check: lint typecheck security test
@echo "✓ All checks passed!"
# Build wheel distribution
build:
@if [ ! -d ".venv" ]; then \
echo "Error: Virtual environment not found. Run 'make install' first."; \
exit 1; \
fi
@. .venv/bin/activate && python -m build
# Run pre-commit hooks on all files
pre-commit:
@if [ ! -d ".venv" ]; then \
echo "Error: Virtual environment not found. Run 'make install' first."; \
exit 1; \
fi
.venv/bin/pre-commit run --all-files
# Show help
help:
@echo "MCP-ACP Development Commands:"
@echo ""
@echo " make install - Set up development environment"
@echo " make test - Run test suite"
@echo " make test-cov - Run tests with coverage"
@echo " make format - Format code with ruff"
@echo " make lint - Lint code with ruff"
@echo " make typecheck - Type check with mypy"
@echo " make security - Run security checks with bandit"
@echo " make check - Run all checks"
@echo " make build - Build wheel distribution"
@echo " make pre-commit - Run pre-commit hooks"
@echo " make clean - Clean build artifacts"
@echo " make help - Show this help message"