This repository was archived by the owner on Jul 1, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathMakefile
More file actions
100 lines (78 loc) · 3.25 KB
/
Copy pathMakefile
File metadata and controls
100 lines (78 loc) · 3.25 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
.DEFAULT_GOAL := help
VENV_PYTHON ?= $(firstword $(wildcard .venv/Scripts/python.exe .venv/bin/python))
PYTHON ?= $(if $(VENV_PYTHON),$(VENV_PYTHON),python)
PIP ?= $(PYTHON) -m pip
PYTEST ?= $(PYTHON) -m pytest
RUFF ?= $(PYTHON) -m ruff
DOCKER_COMPOSE ?= docker compose
TEST_ARGS ?= tests/ -x --tb=short
TEST_ALL_ARGS ?= tests/
TEST_COV_ARGS ?= tests/ --cov=engram --cov-report=term-missing
export PYTHONPATH := src
.PHONY: help install install-dev test test-all test-cov lint format format-check check build clean serve docker-build docker-up docker-up-sqlite docker-up-postgres docker-down docker-logs
help:
@echo "Engram development commands"
@echo ""
@echo "Setup:"
@echo " make install Install Engram with development dependencies"
@echo " make install-dev Alias for make install"
@echo " Override Python with PYTHON=/path/to/python"
@echo ""
@echo "Quality:"
@echo " make test Run the CI-style pytest suite"
@echo " Override with TEST_ARGS='tests/test_file.py -q'"
@echo " make test-all Run the full pytest suite without fail-fast"
@echo " make test-cov Run the full pytest suite with coverage"
@echo " Override with TEST_COV_ARGS='tests/test_file.py --cov=engram'"
@echo " make lint Run ruff lint checks"
@echo " make format Format Python files with ruff"
@echo " make format-check Check formatting without modifying files"
@echo " make check Run lint, format-check, and tests"
@echo ""
@echo "Runtime:"
@echo " make serve Run the local HTTP MCP server"
@echo " make build Build Python package artifacts"
@echo " make clean Remove local build and Python cache artifacts"
@echo ""
@echo "Docker:"
@echo " make docker-build Build Docker images"
@echo " make docker-up Start the SQLite Docker profile"
@echo " make docker-up-sqlite Start the SQLite Docker profile"
@echo " make docker-up-postgres Start the PostgreSQL Docker profile"
@echo " make docker-down Stop Docker Compose services"
@echo " make docker-logs Follow Docker Compose logs"
install:
$(PIP) install --upgrade pip
$(PIP) install -e ".[dev]"
install-dev: install
test:
$(PYTEST) $(TEST_ARGS)
test-all:
$(PYTEST) $(TEST_ALL_ARGS)
test-cov:
$(PYTEST) $(TEST_COV_ARGS)
lint:
$(RUFF) check .
format:
$(RUFF) format .
format-check:
$(RUFF) format --check .
check: lint format-check test
build:
$(PIP) install --upgrade build
$(PYTHON) -m build
clean:
$(PYTHON) -c "import pathlib, shutil; targets=[pathlib.Path('.pytest_cache'), pathlib.Path('.ruff_cache'), pathlib.Path('build'), pathlib.Path('dist')]; targets += list(pathlib.Path('.').rglob('__pycache__')); targets += list(pathlib.Path('.').glob('*.egg-info')); [shutil.rmtree(path, ignore_errors=True) for path in targets]"
serve:
$(PYTHON) -m engram.cli serve --http
docker-build:
$(DOCKER_COMPOSE) --profile sqlite --profile postgres build
docker-up: docker-up-sqlite
docker-up-sqlite:
$(DOCKER_COMPOSE) --profile sqlite up --build
docker-up-postgres:
$(DOCKER_COMPOSE) --profile postgres up --build
docker-down:
$(DOCKER_COMPOSE) down
docker-logs:
$(DOCKER_COMPOSE) logs -f