.SILENT: clean

COMPOSE := @docker compose -f docker-compose.yml
COMPOSE_PACKAGE := @docker compose -f docker-compose.yml run --rm package

ARG=

setup:
	uv sync --all-groups


build:
	$(COMPOSE) build

up:
	$(COMPOSE) up

bash:
	$(COMPOSE_PACKAGE) bash

publish:
	$(COMPOSE_PACKAGE) ./publish.sh

clean:
	docker ps -aq | xargs docker stop
	docker ps -aq | xargs docker rm

lint:
	uv run ruff check documente_shared tests

lint_fix:
	uv run ruff check --fix documente_shared tests

format:
	uv run ruff format documente_shared tests

format_check:
	uv run ruff format --check documente_shared tests

check: lint format_check

test:
	$(COMPOSE_PACKAGE) bash -c "uv run pytest --pyargs $(ARG)"

test_single:
	$(COMPOSE_PACKAGE) bash -c "uv run pytest --pyargs -m single"
