.PHONY: install generate lint typecheck test build all

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

# Regenerate pydantic models from the pinned OpenAPI spec.
generate:
	datamodel-codegen \
		--input tests/resources/openapi.json \
		--input-file-type openapi \
		--output src/kainguru/models.py \
		--output-model-type pydantic_v2.BaseModel \
		--target-python-version 3.10 \
		--disable-timestamp

lint:
	ruff check src tests

typecheck:
	mypy

test:
	pytest

build:
	python -m build

all: generate lint typecheck test build
