Skip to content

dev: migrate to tox-uv and fix metadata #19

dev: migrate to tox-uv and fix metadata

dev: migrate to tox-uv and fix metadata #19

Workflow file for this run

name: test
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
concurrency:
group: test-${{ github.head_ref }}
cancel-in-progress: true
env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
jobs:
check:
name: Static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Install uv
uses: astral-sh/setup-uv@v3
- run: uv venv
- name: Install tox
run: uv pip install tox tox-uv
- name: Run static analysis
run: uv run tox run -e lint
- name: Run mypy
run: uv run tox run -e type
run:
needs: check
name: ${{ startsWith(matrix.python-version, 'pypy') && 'PyPy' || 'CPython' }} ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "pypy3.7"
- "pypy3.8"
- "pypy3.9"
- "pypy3.10"
include:
- os: windows-latest
python-version: 3.12
- os: macos-latest
python-version: 3.12
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install uv
uses: astral-sh/setup-uv@v3
- run: uv venv
- name: Install tox
if: ${{ ! endsWith(matrix.python-version, '3.7') }}
run: uv pip install tox tox-uv tox-gh-actions
- name: Run tests
if: ${{ ! endsWith(matrix.python-version, '3.7') }}
run: uv run tox
- name: Install deps (Python 3.7)
if: ${{ endsWith(matrix.python-version, '3.7') }}
run: |
uv pip install pytest pytest-cov
uv pip install -e .
- name: Run tests (Python 3.7)
if: ${{ endsWith(matrix.python-version, '3.7') }}
run: uv run python -m pytest --doctest-modules --doctest-glob="*.md" .