PACKAGE_DIR := "sandboxa"
TEST_DIR := "tests"

apply-style:
    hatch run dev:apply-style

lint:
    hatch run dev:lint

test:
    hatch test

build:
    python3 -m build

release part:
    #!/usr/bin/env sh
    if [ "{{part}}" != "patch" ] && [ "{{part}}" != "minor" ] && [ "{{part}}" != "major" ]; then
        echo >&2 "'part' must be patch, minor, or major"
        false
    fi
    just lint
    just test
    # Use bumpversion (in Debian Trixie) or one of its successors.
    if command=$(command -v bump-my-version); then
        "$command" bump "{{part}}"
    elif command=$(command -v bumpversion || command -v bump2version); then
        "$command" "{{part}}"
    else
        echo >&2 "Missing requirement: bumpversion, bump2version or bump-my-version"
        false
    fi
    echo "Hint: push this release if everything looks good."
    echo "  git push && git push --tags"
