diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0a5a494..1195e79 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: uses: ./.github/workflows/tox.yml with: default_python: "3.10" - jobs_producing_coverage: 6 + jobs_producing_coverage: 8 max_python: "3.13" min_python: "3.10" run_post: echo 'Running post' @@ -21,6 +21,8 @@ jobs: other_names: | docs lint + py-mise-macos:tox -e py:runner=macos-latest;mise=true + py-mise-ubuntu:tox -e py:runner=ubuntu-24.04;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..84c9582 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -124,7 +124,7 @@ jobs: key: pre-commit-${{ matrix.name }}-${{ hashFiles('.pre-commit-config.yaml') }} - name: Set up Python ${{ matrix.python_version || '3.12' }} - if: ${{ !contains(matrix.shell, 'wsl') }} + if: ${{ !contains(matrix.shell, 'wsl') && matrix.mise != 'true' }} uses: actions/setup-python@v5 with: cache: ${{ hashFiles('requirements.txt', 'pyproject.toml') && 'pip' || '' }} @@ -144,18 +144,43 @@ jobs: run: | echo "$HOME/.local/bin" >> "$GITHUB_PATH" + - name: Install mise + if: ${{ matrix.mise == 'true' }} + run: | + set -exuo pipefail + type mise >/dev/null || { + curl -s https://mise.run | MISE_QUIET=1 sh + echo "$HOME/.local/share/mise/bin" >> $GITHUB_PATH + echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH + } + mise install + + - name: Ensure mise python3 is used by default + if: ${{ matrix.mise == 'true' }} + run: | + set -exuo pipefail + if [[ "$(which python3)" != */mise/* ]]; then + echo "python3 is not the mise python3" + exit 1 + fi + - 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 --disable-pip-version-check --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 }} diff --git a/.readthedocs.yml b/.readthedocs.yml index 75792ce..25e12bf 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -8,9 +8,9 @@ mkdocs: build: os: ubuntu-24.04 tools: - python: "3.12" + python: "3.13" commands: - - pip install --user tox + - python3 -m pip install --user tox - python3 -m tox -e docs python: install: diff --git a/.tool-versions b/.tool-versions index f31e6b0..ab27b5e 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1,2 @@ nodejs 20.18.0 +python 3.13.0