.PHONY: help install install-dev test test-cov clean format lint examples build

help:
	@echo "Available targets:"
	@echo "  install       - Install package in production mode"
	@echo "  install-dev   - Install package in development mode with dev dependencies"
	@echo "  test          - Run unit tests"
	@echo "  test-cov      - Run tests with coverage report"
	@echo "  examples      - Run example tests"
	@echo "  clean         - Remove build artifacts and cache"
	@echo "  format        - Format code with black and isort"
	@echo "  lint          - Run linting checks"
	@echo "  build         - Build distribution packages"

install:
	pip install .

install-dev:
	pip install -e .
	pip install -r requirements-dev.txt

test:
	pytest tests/ -v

test-cov:
	pytest tests/ --cov=pytest_casewise_package_install --cov-report=html --cov-report=term

examples:
	cd examples && pytest -v -s

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

format:
	black pytest_casewise_package_install/ tests/ examples/
	isort pytest_casewise_package_install/ tests/ examples/

lint:
	flake8 pytest_casewise_package_install/ tests/ examples/
	mypy pytest_casewise_package_install/

build:
	python setup.py sdist bdist_wheel
