1+ # Mark all the commands that don't have a target
2+ .PHONY : help test lint fix format install type-check build clean build-docs serve-docs
3+ .DEFAULT_GOAL := help
4+
15#
26# Colors
37#
@@ -66,6 +70,42 @@ PYTHON := python -W ignore -m
6670# Commands
6771#
6872
73+ help : # # Show this help. Example: make help
74+ @egrep -h ' \s##\s' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
75+
76+ install : # # Install dependencies with uv
77+ $(call banner, ⚙️ Installing dependencies ⚙️ )
78+ uv sync --all-extras
79+
80+ test : # # Run tests with coverage
81+ $(call banner, 🧪 Running tests 🧪)
82+ uv run pytest --cov -sv
83+
84+ lint : # # Check code with ruff
85+ $(call banner, 🛡️ Linting code 🛡️ )
86+ uv run ruff check
87+
88+ format : # # Format code with ruff
89+ $(call banner, 🎨 Formatting code 🎨 )
90+ uv run ruff format
91+
92+ fix : # # Auto-fix linting issues
93+ $(call banner, 🔧 Auto-fixing issues 🔧)
94+ @uv run ruff check --fix
95+
96+ type-check : # # Verify static typing with pyright
97+ $(call banner, 🔍 Verifying static typing 🔍)
98+ uv run pyright
99+
100+ build : # # Build distribution packages
101+ $(call banner, 📦 Building distribution packages 📦)
102+ uv build --sdist --wheel
103+
104+ clean : # # Remove build artifacts
105+ $(call banner, 🧹 Cleaning build artifacts 🧹)
106+ rm -rf dist/ build/ * .egg-info .pytest_cache .ruff_cache
107+ find . -type d -name __pycache__ -exec rm -rf {} +
108+
69109build-docs : # # Build the docs
70110 $(call banner, 📚 Building docs 📚)
71111 @rm -rf _build/
@@ -77,17 +117,3 @@ serve-docs: ## Test the site
77117 @rm -rf _build/
78118 @rm -rf docs/_build
79119 @cd docs && $(UV ) make livehtml
80-
81- #
82- # Extras
83- #
84-
85-
86- help : # # Show this help. Example: make help
87- @egrep -h ' \s##\s' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
88-
89-
90- # Mark all the commands that don't have a target
91- .PHONY : help \
92- format \
93- serve
0 commit comments