docstring nit #2120
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
| # This workflow will install Python dependencies, run tests and lint with a single version of Python | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| name: Continuous integration | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| types: [ opened, synchronize, reopened, ready_for_review ] # defaults plus ready_for_review | |
| workflow_dispatch: | |
| workflow_call: | |
| jobs: | |
| install: | |
| name: Installation check | |
| if: github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: 3.13 | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| **/pyproject.toml | |
| - name: Install package and dependencies | |
| run: uv sync --extra dev | |
| format: | |
| name: Lint and type check | |
| if: github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| needs: install | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: 3.13 | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| **/pyproject.toml | |
| - name: Install package and dependencies | |
| run: uv sync --extra dev | |
| - name: Run ruff format | |
| id: ruff-format | |
| run: uv run python checks/format_.py --check | |
| continue-on-error: true | |
| - name: Run ruff check | |
| id: ruff-check | |
| run: uv run python checks/lint_.py | |
| continue-on-error: true | |
| - name: Run mypy | |
| id: mypy | |
| run: uv run python checks/mypy_.py | |
| continue-on-error: true | |
| - name: Check for failures | |
| run: | | |
| FAILED=0 | |
| if [ ${{ steps.ruff-format.outcome }} != 'success' ]; then | |
| echo "ruff format failed" | |
| FAILED=1 | |
| fi | |
| if [ ${{ steps.ruff-check.outcome }} != 'success' ]; then | |
| echo "ruff check failed" | |
| FAILED=2 | |
| fi | |
| if [ ${{ steps.mypy.outcome }} != 'success' ]; then | |
| echo "mypy failed" | |
| FAILED=3 | |
| fi | |
| exit $FAILED | |
| coverage: | |
| name: Pytest and coverage check | |
| if: github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| needs: install | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: 3.13 | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| **/pyproject.toml | |
| - name: Install package and dependencies | |
| run: uv sync --extra dev | |
| - name: Run coverage | |
| run: uv run python checks/coverage_.py |