.PHONY: install install-dev install-ai test lint format clean build publish run-hello run-analyze run-explain run-doctor

install:
	pip install -e .

install-dev:
	pip install -e ".[dev]"

install-ai:
	pip install -e ".[ai,dev]"

test:
	pytest tests/ -v --cov=src/kraimind --cov-report=term-missing

lint:
	mypy src/kraimind
	black --check src/ tests/
	isort --check-only src/ tests/

format:
	black src/ tests/
	isort src/ tests/

clean:
	rm -rf build/ dist/ *.egg-info src/*.egg-info
	find . -type d -name __pycache__ -exec rm -rf {} +
	find . -type d -name .pytest_cache -exec rm -rf {} +
	find . -type d -name .mypy_cache -exec rm -rf {} +

build: clean
	python -m build

publish: build
	python -m twine upload dist/*

run-hello:
	kraimind hello

run-analyze:
	kraimind analyze examples/sample-python-project

run-explain:
	kraimind explain requests

run-doctor:
	kraimind doctor examples/sample-python-project
