.PHONY: install install-sb3 test lint format typecheck ci clean

# Install with dev dependencies (core only — no SB3/torch)
install:
	uv sync --extra dev

# Install with SB3 extras (for export/callback development)
install-sb3:
	uv sync --extra dev --extra sb3

# Run tests
test:
	uv run pytest $(ARGS)

# Lint with ruff
lint:
	uv run ruff check src/ tests/
	uv run ruff format --check src/ tests/

# Format code
format:
	uv run ruff check --fix src/ tests/
	uv run ruff format src/ tests/

# Type check (core modules only — SB3 modules excluded due to incomplete torch/SB3 stubs)
typecheck:
	uv run basedpyright

# All CI checks
ci: lint typecheck test

# Remove build artifacts
clean:
	rm -rf build/ dist/ *.egg-info src/*.egg-info
	find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
	find . -type f -name "*.pyc" -delete 2>/dev/null || true
