Update sphinx-autodoc-typehints requirement from ~=2.5.0 to ~=3.0.0 #297
Workflow file for this run
This file contains 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: Tests | |
"on": | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
# Run tests every Monday at 9:17 to catch regressions. | |
- cron: "17 9 * * 1" | |
# XXX Concurrency detection sucks and jobs gets killed randonmly. | |
# concurrency: | |
# # Group workflow jobs so new commits cancels in-progress execution triggered by previous commits. | |
# # Source: https://mail.python.org/archives/list/pypa-committers@python.org/thread/PCBCQMJF64JGRBOX7E2EE4YLKHT4DI55/ | |
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
# cancel-in-progress: true | |
jobs: | |
test-matrix: | |
# There is no way to selective flags collections of elements in a matrix, without having to flag all combinations. | |
# This will became unmaintainable and tedious so we use this job to pre-compute which jobs is going to get our | |
# "stable" flag. | |
name: "OS/Python/stable matrix pre-compute" | |
runs-on: ubuntu-24.04 | |
outputs: | |
test_matrix: ${{ steps.create_matrix.outputs.matrix }} | |
steps: | |
- name: Create JSON matrix | |
id: create_matrix | |
shell: python | |
run: | | |
import json | |
import os | |
from itertools import product | |
from pathlib import Path | |
variants: dict[str, set[str]] = { | |
"os": { | |
# Available OSes: https://github.com/actions/runner-images#available-images | |
# We test against all available variants because platforms is the main target of this project. | |
"ubuntu-24.04", # x86 | |
"ubuntu-22.04", # x86 | |
"ubuntu-20.04", # x86 | |
"macos-15", # arm64 | |
"macos-14", # arm64 | |
"macos-13", # x86 | |
"windows-2022", # x86 | |
"windows-2019", # x86 | |
}, | |
"python-version": { | |
"3.10", | |
"3.11", | |
"3.12", | |
"3.13", | |
"3.14-dev", | |
} | |
} | |
# TODO: List of additional variants to include in the matrix. | |
include: list[dict[str, str]] = [] | |
# List of variants to exclude from the matrix. | |
exclude: list[dict[str, str]] = [] | |
# List of unstable criterions. | |
unstable: list[dict[str, str]] = [ | |
# XXX error: Python 3.14 is still not available through uv, which gets its standalone Python executables | |
# from the python-build-standalone project: | |
# https://github.com/astral-sh/python-build-standalone/releases | |
{"python-version": "3.14-dev"}, | |
] | |
# Build the job matrix. | |
jobs: list[dict[str, str]] = [] | |
for variants in product(*[{(key, value) for value in values} for key, values in variants.items()]): | |
job = dict(variants) | |
# Match the job against the exclude criterions. | |
exclude_job = False | |
for criterion in exclude: | |
if set(criterion.items()).issubset(job.items()): | |
exclude_job = True | |
break | |
if exclude_job: | |
continue | |
# Match the job against the unstable criterions. | |
job["state"] = "stable" | |
for criterion in unstable: | |
if set(criterion.items()).issubset(job.items()): | |
job["state"] = "unstable" | |
break | |
jobs.append(job) | |
matrix = json.dumps({"include": jobs}) | |
env_file = Path(os.getenv("GITHUB_OUTPUT")) | |
env_file.write_text(f"matrix={matrix}") | |
- name: Print JSON matrix | |
run: | | |
echo '${{ steps.create_matrix.outputs.matrix }}' | |
jq -aR <<< echo '${{ steps.create_matrix.outputs.matrix }}' | |
tests: | |
needs: | |
- test-matrix | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJson(needs.test-matrix.outputs.test_matrix) }} | |
runs-on: ${{ matrix.os }} | |
# We keep going when a job flagged as not stable fails. | |
continue-on-error: ${{ matrix.state == 'unstable' }} | |
steps: | |
- uses: actions/checkout@v4.2.2 | |
# Default Python on windows-2019 is older than the minimum required by uv: | |
# | |
# ERROR: Ignored the following versions that require a different python version: | |
# (...) 0.5.11 Requires-Python >=3.8 | |
# ERROR: Could not find a version that satisfies the requirement uv==0.5.11 (from versions: none) | |
# ERROR: No matching distribution found for uv==0.5.11 | |
# | |
# XXX This step might be able to be removed after 2025-01-10, once Python 3.8 is the default on windows-2019 | |
# images: https://github.com/actions/runner-images/issues/10893 | |
- name: windows-2019 - Update old Python | |
if: matrix.os == 'windows-2019' | |
uses: actions/setup-python@v5.3.0 | |
with: | |
python-version: "${{ matrix.python-version }}" | |
- name: Install uv | |
run: | | |
python -m pip install -r https://raw.githubusercontent.com/kdeldycke/workflows/v4.9.0/requirements/uv.txt | |
- name: Install project | |
run: | | |
uv --no-progress venv --python ${{ matrix.python-version }} | |
uv --no-progress sync --frozen --extra test --extra pytest | |
- name: Unittests | |
run: | | |
uv --no-progress run -- pytest | |
- name: Codecov - coverage | |
uses: codecov/codecov-action@v5.1.2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Codecov - test results | |
if: ${{ !cancelled() }} | |
uses: codecov/test-results-action@v1.0.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |