SHELL := /bin/bash
VERSION := $(shell grep -m1 '^version' pyproject.toml | cut -d'"' -f2)

.PHONY: setup dev serve test offline-test package clean

setup:            ## instalacja zależności (bez Homebrew, user-space)
	bash installer/deps.sh
	bash installer/models.sh --profile auto

dev:              ## środowisko deweloperskie
	uv sync --extra dev

serve:            ## panel operatora (127.0.0.1:8477)
	uv run uvicorn app.panel.main:app --host 127.0.0.1 --port 8477

test:
	uv run pytest -q

offline-test:     ## testy z zablokowaną siecią (E5.1)
	LOGBOOK_BLOCK_NET=1 uv run pytest -q

package:          ## paczka dystrybucyjna zip (E6.2)
	bash installer/package.sh $(VERSION)

clean:
	rm -rf dist .pytest_cache
