-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (32 loc) · 1.35 KB
/
Makefile
File metadata and controls
39 lines (32 loc) · 1.35 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
.PHONY: help install dev lint format test clean
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
install: ## Install the package (auto-detects root, uv, pipx, or pip)
@if [ "$$(id -u)" = "0" ]; then \
echo "Running as root, installing system-wide..."; \
pip install .; \
elif command -v uv >/dev/null 2>&1; then \
echo "Installing with uv..."; \
uv tool install .; \
elif command -v pipx >/dev/null 2>&1; then \
echo "Installing with pipx..."; \
pipx install .; \
else \
echo "Tip: Install uv or pipx for isolated installs (pacman -S uv, apt install pipx, brew install uv)"; \
echo "Falling back to pip install --user ..."; \
PIP_BREAK_SYSTEM_PACKAGES=1 pip install --user .; \
fi
dev: ## Install with dev dependencies (editable)
PIP_BREAK_SYSTEM_PACKAGES=1 pip install -e ".[dev]"
lint: ## Run ruff linter and formatter check
python -m ruff check src/ tests/
python -m ruff format --check src/ tests/
format: ## Auto-format code
python -m ruff check --fix src/ tests/
python -m ruff format src/ tests/
test: ## Run tests
python -m pytest
clean: ## Remove build artifacts
rm -rf dist/ build/ *.egg-info src/*.egg-info .pytest_cache .ruff_cache
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true