Skip to content

First-class SQLModel & FastAPI support (v2.6.0) #317

First-class SQLModel & FastAPI support (v2.6.0)

First-class SQLModel & FastAPI support (v2.6.0) #317

Workflow file for this run

# Install dependencies with uv, then run tests across supported Python and
# SQLAlchemy versions.
# See: https://docs.astral.sh/uv/guides/integration/github/
name: Python package
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: py${{ matrix.python-version }} / ${{ matrix.os }}
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"]
steps:
- uses: actions/checkout@v5
- name: Install uv and set up Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Run tests (latest dependencies)
run: uv run pytest
test-min-deps:
# Exercise the lowest supported dependency versions on the lowest supported
# Python. (Pinning the oldest deps against the newest Python is not a real
# combination, so this only runs on the floor interpreter.)
name: min deps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install uv and set up Python 3.10
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: "3.10"
enable-cache: true
# --resolution lowest-direct pins every direct dependency to its lowest
# allowed version, which exercises the SQLAlchemy>=2.0 floor. The
# sqlmodel group is excluded because sqlmodel's own SQLAlchemy pin would
# lift the resolved SQLAlchemy above 2.0.0, defeating the floor check;
# the sqlmodel compat tests skip themselves when sqlmodel is absent.
- name: Run tests (lowest supported dependencies)
run: uv run --resolution lowest-direct --no-group sqlmodel pytest