-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (47 loc) · 1.66 KB
/
Makefile
File metadata and controls
63 lines (47 loc) · 1.66 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
PYTHON ?= python3
UV ?= uv
VENV_DIR ?= .venv
DOCKER_COMPOSE ?= docker compose
.PHONY: help venv install run run-venv format format-check check clean docker-up docker-down docker-logs
.PHONY: bootstrap-uv ensure-uv
help:
@echo "Targets:"
@echo " make bootstrap-uv - install uv in user site-packages"
@echo " make venv - create virtual environment with uv"
@echo " make install - install runtime + dev dependencies with uv"
@echo " make run - run MCP server with uv"
@echo " make run-venv - alias for make run"
@echo " make format - format Python files using Black"
@echo " make format-check - check Black formatting"
@echo " make check - compile check + Black check"
@echo " make docker-up - start server with docker compose"
@echo " make docker-down - stop docker compose service"
@echo " make docker-logs - tail docker compose logs"
@echo " make clean - remove local virtual environment"
bootstrap-uv:
sh -c "curl -LsSf https://astral.sh/uv/install.sh | sh"
ensure-uv:
@command -v $(UV) >/dev/null 2>&1 || \
(echo "uv is not installed or not on PATH. Run 'make bootstrap-uv' and add ~/.local/bin to PATH." && exit 1)
venv: ensure-uv
$(UV) venv $(VENV_DIR)
install: ensure-uv venv
$(UV) sync --dev
run: ensure-uv
$(UV) run -m src.server
run-venv: run
format: ensure-uv
$(UV) run black src
format-check: ensure-uv
$(UV) run black --check src
check: ensure-uv
$(UV) run python -m py_compile src/server.py src/__init__.py
$(MAKE) format-check
docker-up:
$(DOCKER_COMPOSE) up --build -d
docker-down:
$(DOCKER_COMPOSE) down
docker-logs:
$(DOCKER_COMPOSE) logs -f mcp-server
clean:
rm -rf $(VENV_DIR)