diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 499a722..5a06c8f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,6 @@ on: jobs: build: - runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -16,13 +15,7 @@ jobs: - macos-latest - ubuntu-latest - windows-latest - steps: - uses: actions/checkout@v6 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox - - name: Test - run: | - tox + - uses: jdx/mise-action@v3 + - run: ./build_and_test diff --git a/.mise.toml b/.mise.toml new file mode 100644 index 0000000..abb59a6 --- /dev/null +++ b/.mise.toml @@ -0,0 +1,23 @@ +[tools] +uv = "latest" + +[env.'_'.python.venv] +path = ".venv" +create = true +uv_create_args = ["--seed", "--quiet"] + +[tasks] +"pip-install" = "uv pip --no-cache install -r requirements.txt --quiet" +build_and_test.depends = ["check_formatting", "test", "mypy"] + +[tasks.check_formatting] +run = "python -m black --check ." +depends = ["pip-install"] + +[tasks.test] +run = "python -m pytest -v" +depends = ["pip-install"] + +[tasks.mypy] +run = "python -m mypy ." +depends = ["pip-install"] diff --git a/build_and_test b/build_and_test index 3b5ab02..4ebabcc 100755 --- a/build_and_test +++ b/build_and_test @@ -1,4 +1,9 @@ -#! /bin/sh -eu +#! /usr/bin/env bash +set -euo pipefail -python3 -m pip install tox --disable-pip-version-check -python3 -m tox --parallel +if ! command -v mise >/dev/null 2>&1; then + echo "[error] 'mise' is required but not found on PATH. Install Mise: https://mise.jdx.dev/" + exit 127 +fi + +mise task --quiet run build_and_test diff --git a/build_and_test.cmd b/build_and_test.cmd index bfc80c4..c8f35e9 100644 --- a/build_and_test.cmd +++ b/build_and_test.cmd @@ -1 +1 @@ -@call python -m pip install tox --disable-pip-version-check && call tox --parallel +@"C:\Program Files\Git\bin\bash.exe" ./build_and_test \ No newline at end of file diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 9421179..0000000 --- a/tox.ini +++ /dev/null @@ -1,26 +0,0 @@ -[tox] -envlist = - # `py` is a predefined environment factor. See https://tox.wiki/en/latest/config.html#tox-environments - py-{pytest,mypy} - check_formatting - -[testenv] -deps = - -rrequirements.txt - -[testenv:py-pytest] -commands = - pytest -v - -[testenv:check_formatting] -skip_install = true -commands = black --check . - -[testenv:fix_formatting] -skip_install = true -commands = black . - - -[testenv:py-mypy] -commands = - mypy .