Switch code formatter from Flake8 to Ruff #237
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: test | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ['3.10', 3.11, '3.12', '3.13', '3.14', 'pypy-3.11'] | |
| exclude: | |
| # too slow | |
| - os: macos-latest | |
| python-version: pypy-3.11 | |
| - os: windows-latest | |
| python-version: pypy-3.11 | |
| include: | |
| - os: ubuntu-latest | |
| pip-cache: ~/.cache/pip | |
| poetry-cache: ~/.cache/pypoetry | |
| - os: macos-latest | |
| pip-cache: ~/Library/Caches/pip | |
| poetry-cache: ~/Library/Caches/pypoetry | |
| - os: windows-latest | |
| pip-cache: ~\AppData\Local\pip\Cache | |
| poetry-cache: ~\AppData\Local\pypoetry\Cache | |
| - os: ubuntu-latest | |
| python-version: 3.10 | |
| build-docs: true | |
| - os: ubuntu-latest | |
| python-version: 3.12 | |
| build-docs: true | |
| build-dist: true | |
| - python-version: 3.12 | |
| run-mypy: true | |
| 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 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ matrix.pip-cache }} | |
| ${{ matrix.poetry-cache }} | |
| key: ${{ runner.os }}-${{ hashFiles('**/pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}- | |
| - name: Install dependencies | |
| run: | | |
| pipx install poetry build | |
| poetry install | |
| - name: Run tests | |
| run: | | |
| poetry run coverage run --branch setup.py test | |
| poetry run coverage xml -i | |
| - name: Run mypy | |
| if: matrix.run-mypy | |
| run: | | |
| poetry run mypy . | |
| - name: Run ruff | |
| run: | | |
| poetry run ruff check --output-format=github . | |
| poetry run ruff format --check . | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| - name: Build docs | |
| if: matrix.build-docs | |
| run: | | |
| poetry install --with docs | |
| poetry run sphinx-build -W -a -E -b html -n docs docs/_build | |
| - name: Build dist | |
| if: matrix.build-dist | |
| run: | | |
| pyproject-build | |
| - name: Upload dist | |
| if: matrix.build-dist | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/* |