.PHONY: help install dev-install update build test test-fast test-unit test-integration test-contract clean example-simple example-langchain example-react lint format typecheck publish publish-test

help:
	@echo "Available targets:"
	@echo "  install          - Install package dependencies"
	@echo "  dev-install      - Install package with development dependencies"
	@echo "  update           - Update all dependencies"
	@echo "  build            - Build distribution packages"
	@echo "  test             - Run all tests (including integration)"
	@echo "  test-fast        - Run tests excluding integration tests"
	@echo "  test-unit        - Run unit tests only"
	@echo "  test-integration - Run integration tests only"
	@echo "  test-contract    - Run contract tests only"
	@echo "  lint             - Run linting checks (ruff + mypy + pyright)"
	@echo "  typecheck        - Run type checking (pyright)"
	@echo "  format           - Format code"
	@echo "  clean            - Remove build artifacts"
	@echo "  publish-test     - Publish to TestPyPI"
	@echo "  publish          - Publish to PyPI"

install:
	uv sync --no-dev

dev-install:
	uv sync

update:
	uv lock --upgrade

build: clean
	uv build

test:
	uv run python -m pytest tests/ -v

test-fast:
	uv run python -m pytest tests/ -v -m "not integration"

test-unit:
	uv run python -m pytest tests/unit/ -v

test-integration:
	uv run python -m pytest tests/integration/ -v

test-contract:
	uv run python -m pytest tests/contract/ -v

lint:
	uv run ruff check src/ tests/ examples/
	uv run mypy src/
	uv run pyright

typecheck:
	uv run pyright

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

clean:
	rm -rf build/
	rm -rf dist/
	rm -rf *.egg-info
	rm -rf .pytest_cache
	rm -rf .mypy_cache
	rm -rf .ruff_cache
	rm -rf .pyright_cache
	rm -rf pyrightconfig.json
	find . -type d -name __pycache__ -exec rm -rf {} +
	find . -type f -name "*.pyc" -delete


publish-test: build
	uv publish --publish-url https://test.pypi.org/legacy/ dist/*

publish: build
	uv publish dist/*
