# SPDX-License-Identifier: 0BSD
# SPDX-FileCopyrightText: Copyright 2023 David Seaward and contributors

_default:
    @just --list

# Set up Python development environment.
bootstrap:
    uv sync

# Run from source.
run:
    uv run carmine

# Remove all build artefacts.
clean:
    rm -rf *.egg-info
    rm -rf .pytest_cache
    rm -rf dist
    rm -rf build
    rm -f .coverage
    find . -name "__pycache__" -type d -exec rm -rf {} +

# Run tests and generate coverage report.
test:
    uv run coverage run -m pytest
    uv run coverage report | tee coverage.txt
    git diff --exit-code

# Fix or warn about linting errors.
lint:
    uv run prek run --all-files

# Clean, test, lint, then generate new build artefacts.
build: clean test lint
    uv build --clear
