.PHONY: install lint typecheck test format check all clean build publish

install:
	uv sync

lint:
	uv run ruff check src tests

typecheck:
	uv run mypy src tests

test:
	uv run pytest

format:
	uv run ruff format src tests
	uv run ruff check --fix src tests

check:
	uv run ruff format --check src tests
	uv run ruff check src tests
	uv run mypy src tests

all: lint typecheck test

clean:
	rm -rf .pytest_cache .mypy_cache .ruff_cache .coverage htmlcov dist build *.egg-info
	find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true

build: clean
	uv build

publish: build
	uv publish
