-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
127 lines (98 loc) · 2.81 KB
/
Copy pathMakefile
File metadata and controls
127 lines (98 loc) · 2.81 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
.PHONY: help install dev-install test test-unit test-integration lint format type-check security clean build docker-build docker-run docs serve-docs
# Default target
help:
@echo "Available commands:"
@echo " make install Install the package"
@echo " make dev-install Install with development dependencies"
@echo " make test Run all tests with coverage"
@echo " make test-unit Run unit tests only"
@echo " make test-integration Run integration tests only"
@echo " make lint Run all linters"
@echo " make format Format code with black"
@echo " make type-check Run type checking with mypy"
@echo " make security Run security checks"
@echo " make clean Clean build artifacts"
@echo " make build Build distribution packages"
@echo " make docker-build Build Docker image"
@echo " make docker-run Run Docker container"
@echo " make docs Build documentation"
@echo " make serve-docs Serve documentation locally"
# Installation
install:
pip install -e .
dev-install:
pip install -e ".[dev,test,docs]"
pre-commit install
# Testing
test:
pytest --cov=otel_query_server --cov-report=html --cov-report=term --cov-report=xml -v
test-unit:
pytest tests/unit/ -v
test-integration:
pytest tests/integration/ -v
test-watch:
ptw tests/ -- -v
# Code Quality
lint: format type-check ruff-check security
format:
black src tests
format-check:
black --check src tests
ruff-check:
ruff check src tests
ruff-fix:
ruff check --fix src tests
type-check:
mypy src
security:
bandit -r src/
pip-audit
# Cleaning
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
rm -rf .coverage
rm -rf coverage.xml
rm -rf htmlcov/
rm -rf .pytest_cache/
rm -rf .mypy_cache/
rm -rf .ruff_cache/
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
# Building
build: clean
python -m build
# Docker
docker-build:
docker build -t otel-query-server:latest .
docker-run:
docker run --rm -it \
-v $(PWD)/config.yaml:/app/config.yaml \
-p 8080:8080 \
otel-query-server:latest
docker-compose-up:
docker-compose -f examples/docker-compose.yaml up -d
docker-compose-down:
docker-compose -f examples/docker-compose.yaml down
docker-compose-logs:
docker-compose -f examples/docker-compose.yaml logs -f
# Documentation
docs:
mkdocs build
serve-docs:
mkdocs serve
# Development server
run:
python -m otel_query_server.server --config config.yaml
run-debug:
OTEL_QUERY_SERVER__LOG_LEVEL=DEBUG python -m otel_query_server.server --config config.yaml
# MCP specific
mcp-run:
fastmcp run otel_query_server.server:mcp
mcp-run-http:
fastmcp run otel_query_server.server:mcp --transport http --port 8080
# CI simulation
ci: clean lint test build
# Quick checks before committing
pre-commit: format lint test-unit