-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (53 loc) · 1.68 KB
/
Makefile
File metadata and controls
69 lines (53 loc) · 1.68 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
CI := 1
.PHONY: help build dev-fmt all check fmt lint mypy test security update-spec e2e coverage
# Default target - show help
.DEFAULT_GOAL := help
# Show this help message
help:
@awk '/^# / { desc=substr($$0, 3) } /^[a-zA-Z0-9_-]+:/ && desc { target=$$1; sub(/:$$/, "", target); printf "%-20s - %s\n", target, desc; desc="" }' Makefile | sort
# Build/install the package in development mode
build:
pip install -e ./gts
# Fix formatting issues
dev-fmt:
ruff format gts/src
# Run all checks and build
all: check build
# Check code formatting
fmt:
ruff format --check gts/src
# Run linter (ruff)
lint:
ruff check gts/src
# Run clippy-equivalent linter with auto-fix
clippy:
ruff check --fix gts/src
# Run type checker
mypy:
mypy gts/src/gts --ignore-missing-imports
# Run all tests
test:
pytest tests/ -v
# Check dependencies for security vulnerabilities
security:
@command -v pip-audit >/dev/null || (echo "Installing pip-audit..." && pip install pip-audit)
pip-audit
# Measure code coverage
coverage:
pytest tests/ --cov=gts --cov-report=xml --cov-report=term
# Update gts-spec submodule to latest
update-spec:
git submodule update --remote .gts-spec
# Run end-to-end tests against gts-spec
e2e: build
@echo "Starting server in background..."
@python -m gts server --port 8000 & echo $$! > .server.pid
@sleep 2
@echo "Running e2e tests..."
@PYTHONDONTWRITEBYTECODE=1 pytest -p no:cacheprovider --log-file=e2e.log ./.gts-spec/tests || (kill `cat .server.pid` 2>/dev/null; rm -f .server.pid; exit 1)
@echo "Stopping server..."
@kill `cat .server.pid` 2>/dev/null || true
@rm -f .server.pid
@echo "E2E tests completed successfully"
# Run all quality checks
check: fmt lint test e2e