.PHONY: help sync lint format typecheck test build demo serve clean

PYTHON ?= uv run python

help:
	@echo "OptiSpec development commands:"
	@echo "  make sync       Install all extras and dev dependencies with uv"
	@echo "  make lint       Run ruff check and format verification"
	@echo "  make format     Auto-fix and format code with ruff"
	@echo "  make typecheck  Run mypy type checks on src/optispec"
	@echo "  make test       Run pytest suite"
	@echo "  make build      Build sdist and wheel with uv"
	@echo "  make demo       Launch Gradio comparison demo"
	@echo "  make serve      Launch OpenAI-compatible HTTP server"

sync:
	uv sync --all-extras

lint:
	uv run ruff check src tests examples
	uv run ruff format --check src tests examples

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

typecheck:
	uv run mypy src/optispec

test:
	uv run pytest -v

build:
	uv build

demo:
	uv run optispec demo

serve:
	uv run optispec serve

clean:
	rm -rf dist build *.egg-info .pytest_cache .mypy_cache .ruff_cache
