diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0a5a494..d72a055 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,7 @@ jobs: other_names: | docs lint + py-mise:tox -e py:mise=true node-version-file: .tool-versions check: # This job does nothing and is only used for the branch protection diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 1af5444..ee099ca 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -144,18 +144,34 @@ jobs: run: | echo "$HOME/.local/bin" >> "$GITHUB_PATH" + - name: Install mise + if: ${{ matrix.mise == 'true' }} + run: | + set -exuo pipefail + type mise || { + curl https://mise.run | sh + echo "$HOME/.local/share/mise/bin" >> $GITHUB_PATH + echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH + } + mise install + - name: Install python build tools run: | set -exuo pipefail - echo $PATH - python3 -m pip install --upgrade pip uv - # uv tool update-shell - uv tool install "tox>=4.23.2" --with "tox-uv>=1.16.0" + echo PATH=$PATH + # that depends on python3 blend being used and might not be already in path: + SCRIPTS_DIR=$(python3 -c 'import os,sysconfig;print(sysconfig.get_path("scripts",f"{os.name}_user"))') + if [[ ":$PATH:" != *":$SCRIPTS_DIR:"* ]]; then + export PATH=$SCRIPTS_DIR:$PATH + echo "$SCRIPTS_DIR" >> $GITHUB_PATH + echo "Added $SCRIPTS_DIR to PATH to avoid further issues." + fi + python3 -m pip install --upgrade --user --break-system-packages pip uv 'tox>=4.23.2' 'tox-uv>=1.16.0' + which -a uv pip tox + echo "uv tool update-shell" tox --version - which -a uv - - - name: Log installed dists - run: python3 -m uv pip freeze + echo "Log installed dists" + python3 -m uv pip freeze - run: ${{ matrix.command }}