.PHONY: test lint format check docs docs-build render-demos
UV_CACHE_DIR ?= .uv-cache

test:
	UV_CACHE_DIR=$(UV_CACHE_DIR) uv run pytest tests/ -v --tb=short -m "not kind"

test-kind:
	UV_CACHE_DIR=$(UV_CACHE_DIR) uv run pytest tests/ -v --tb=short -m "kind"

lint:
	UV_CACHE_DIR=$(UV_CACHE_DIR) uv run ruff check src/ tests/
	UV_CACHE_DIR=$(UV_CACHE_DIR) uv run ruff format --check src/ tests/
	UV_CACHE_DIR=$(UV_CACHE_DIR) uv run mypy src/

format:
	UV_CACHE_DIR=$(UV_CACHE_DIR) uv run ruff format src/ tests/

render-demos:
	find demos -type f -name '*.tape' -exec sh -c 'printf "\n==> %s\n" "$$1"; vhs -q "$$1"' sh {} \;

docs:
	uvx --with mkdocs-material --with 'cyclopts[mkdocs]' --with . mkdocs serve

docs-build:
	uvx --with mkdocs-material --with 'cyclopts[mkdocs]' --with . mkdocs build --strict

check: lint test
