-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (33 loc) · 1.45 KB
/
Makefile
File metadata and controls
44 lines (33 loc) · 1.45 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
.PHONY: help install install-dev install-demo test lint serve stop clean
PYTHON ?= python3
PIP ?= $(PYTHON) -m pip
PORT ?= 8000
PID_FILE := .uvicorn.pid
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
install: ## Install the package
$(PIP) install -e .
install-dev: ## Install with dev dependencies (pytest)
$(PIP) install -e ".[dev]"
install-demo: ## Install with demo dependencies (FastAPI, uvicorn)
$(PIP) install -e ".[demo]"
install-all: ## Install with all optional dependencies
$(PIP) install -e ".[dev,demo]"
test: ## Run tests
$(PYTHON) -m pytest tests/ -v
serve: stop ## Start the demo server (PORT=8000)
uvicorn api.main:app --host 127.0.0.1 --port $(PORT) & echo $$! > $(PID_FILE)
@echo "Server running on http://127.0.0.1:$(PORT) (pid $$(cat $(PID_FILE)))"
serve-fg: stop ## Start the demo server in the foreground
uvicorn api.main:app --host 127.0.0.1 --port $(PORT) --reload
stop: ## Stop the demo server
@if [ -f $(PID_FILE) ]; then \
kill $$(cat $(PID_FILE)) 2>/dev/null && echo "Server stopped" || echo "Server not running"; \
rm -f $(PID_FILE); \
fi
clean: stop ## Remove build artifacts and caches
rm -rf build/ dist/ *.egg-info hobby_spline/*.egg-info
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type d -name .pytest_cache -exec rm -rf {} + 2>/dev/null || true
rm -f $(PID_FILE)