From bd74cb4622db86d04c9e663d63d1ac00a44e8a2a Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Tue, 22 Oct 2024 20:47:56 -0400 Subject: [PATCH] Try to simplify some of the CI and add support for Python 3.13 --- .github/workflows/ci.yml | 7 ++++--- .github/workflows/doc.yml | 25 +++++++++---------------- .github/workflows/format.yml | 19 ++++--------------- .github/workflows/lint.yml | 17 +++-------------- .github/workflows/mypy.yml | 22 +++++++--------------- 5 files changed, 27 insertions(+), 63 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b35ac514..6a25f275 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,14 +2,14 @@ # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions name: CI -on: [push, pull_request] +on: [ push, pull_request ] jobs: ci: strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + os: [ ubuntu-latest, macos-latest, windows-latest ] + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ] fail-fast: false runs-on: ${{ matrix.os }} steps: @@ -22,6 +22,7 @@ jobs: uses: actions/setup-python@v5 # https://github.com/actions/setup-python with: python-version: ${{ matrix.python-version }} + allow-prereleases: true - name: Install python prerequisites run: pip install -U --user pip setuptools setuptools-scm nox - name: Run tests and post coverage results diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 9605605f..663b1401 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -2,30 +2,23 @@ # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions name: Doc -on: [push, pull_request] +on: [ push, pull_request, workflow_dispatch ] permissions: contents: read jobs: - doc: - strategy: - matrix: - os: [ubuntu-latest] - python-version: ["3.12"] - fail-fast: false - runs-on: ${{ matrix.os }} + build_docs: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # https://github.com/actions/checkout + - uses: actions/setup-python@v5 with: + python-version: 3.13 + allow-prereleases: true # Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. # Set fetch-depth: 0 to fetch all history for all branches and tags. fetch-depth: 0 # Needed for setuptools_scm to work correctly - - name: Set up Python - uses: actions/setup-python@v5 # https://github.com/actions/setup-python - with: - python-version: ${{ matrix.python-version }} - - name: Install python prerequisites - run: pip install -U --user pip setuptools setuptools-scm nox - - name: Sphinx documentation build - run: python -m nox --non-interactive --session docs + - run: pip install --upgrade pip + - run: pip install -r docs/requirements.txt + - run: sphinx-build -c docs . docs/_build/html diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 9c474be9..bbef3430 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -8,24 +8,13 @@ permissions: contents: read jobs: - lint: - strategy: - matrix: - os: [ ubuntu-latest ] - python-version: [ "3.12" ] - fail-fast: false - runs-on: ${{ matrix.os }} + format: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # https://github.com/actions/checkout with: # Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. # Set fetch-depth: 0 to fetch all history for all branches and tags. fetch-depth: 0 # Needed for setuptools_scm to work correctly - - name: Set up Python - uses: actions/setup-python@v5 # https://github.com/actions/setup-python - with: - python-version: ${{ matrix.python-version }} - - name: Install python prerequisites - run: pip install -U --user ruff - - name: Ruff format - run: ruff format --check + - run: pip install --user ruff + - run: ruff format --check diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 967e9a5f..50913bcf 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,23 +9,12 @@ permissions: jobs: lint: - strategy: - matrix: - os: [ ubuntu-latest ] - python-version: [ "3.12" ] - fail-fast: false - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # https://github.com/actions/checkout with: # Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. # Set fetch-depth: 0 to fetch all history for all branches and tags. fetch-depth: 0 # Needed for setuptools_scm to work correctly - - name: Set up Python - uses: actions/setup-python@v5 # https://github.com/actions/setup-python - with: - python-version: ${{ matrix.python-version }} - - name: Install python prerequisites - run: pip install -U --user ruff - - name: Ruff lint - run: ruff check + - run: pip install --user ruff + - run: ruff check --output-format=github . diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 727ed43d..cf1833fd 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -2,30 +2,22 @@ # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions name: MyPy -on: [push, pull_request] +on: [ push, pull_request ] permissions: contents: read jobs: mypy: - strategy: - matrix: - os: [ubuntu-latest] - python-version: ["3.12"] - fail-fast: false - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # https://github.com/actions/checkout + - uses: actions/setup-python@v5 # https://github.com/actions/setup-python with: + python-version: 3.13 + allow-prereleases: true # Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. # Set fetch-depth: 0 to fetch all history for all branches and tags. fetch-depth: 0 # Needed for setuptools_scm to work correctly - - name: Set up Python - uses: actions/setup-python@v5 # https://github.com/actions/setup-python - with: - python-version: ${{ matrix.python-version }} - - name: Install python prerequisites - run: pip install -U --user pip setuptools setuptools-scm nox - - name: MyPy - run: python -m nox --non-interactive --session validate-${{ matrix.python-version }} -k mypy # Run nox for mypy + - run: pip install -U --user pip setuptools setuptools-scm nox + - run: python -m nox --non-interactive --session validate-${{ python-version }} -k mypy # Run nox for mypy