
@function clean():
    echo "Cleaning up..."
    rm -rfv .pytest_cache .venv .ruff_cache
    find . -name "__pycache__" -type d -exec rm -r {} +
    echo "Cleaned down"

test:
    > desc: Тестирование библиотеки

    all:
        > script: |
            test:lint
            test:unit
            test:integration
    unit:
        > script: |
            echo "Unit tests (offline, HTTP is mocked)"
            uv run pytest --cov --cov-report=term-missing

    integration:
        > script: |
            echo "Live tests against the real FIAS API"
            uv run pytest -m integration

    lint:
        > script: |
            echo "Lint"
            uv run ruff check .

    > before: uv sync --extra dev
    > after[hide]: clean
