.PHONY: test fulltest typecheck clean

# Check for uv
UV := $(shell command -v uv 2>/dev/null)
ifndef UV
$(error "uv is not installed. Install it from https://docs.astral.sh/uv/getting-started/installation/")
endif

# Run tests with default Python
test:
	uv run pytest

# Run type checker
typecheck:
	uvx ty check

# Run tests on all supported Python versions + type checking
fulltest: typecheck
	uv run --python 3.10 pytest
	uv run --python 3.11 pytest
	uv run --python 3.12 pytest
	uv run --python 3.13 pytest
	uv run --python 3.14 pytest
	uv run --python 3.15 pytest

clean:
	rm -rf build dist
	rm -rf __pycache__ .pytest_cache
	rm -rf src/__pycache__ src/*.egg-info
	rm -rf test/__pycache__ test/support/__pycache__
	find . -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true
