mirror of https://github.com/tiangolo/fastapi.git
👷 Make Pydantic versions customizable in CI (#14535)
This commit is contained in:
parent
75ad0a0f8c
commit
6281f8721a
|
|
@ -31,15 +31,11 @@ jobs:
|
||||||
- name: Setup uv
|
- name: Setup uv
|
||||||
uses: astral-sh/setup-uv@v7
|
uses: astral-sh/setup-uv@v7
|
||||||
with:
|
with:
|
||||||
version: "0.4.15"
|
|
||||||
enable-cache: true
|
|
||||||
cache-dependency-glob: |
|
cache-dependency-glob: |
|
||||||
requirements**.txt
|
requirements**.txt
|
||||||
pyproject.toml
|
pyproject.toml
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: uv pip install -r requirements-tests.txt
|
run: uv pip install -r requirements-tests.txt
|
||||||
- name: Install Pydantic v2
|
|
||||||
run: uv pip install --upgrade "pydantic>=2.0.2,<3.0.0"
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: bash scripts/lint.sh
|
run: bash scripts/lint.sh
|
||||||
|
|
||||||
|
|
@ -48,38 +44,42 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ windows-latest, macos-latest ]
|
os: [ windows-latest, macos-latest ]
|
||||||
python-version: [ "3.14" ]
|
python-version: [ "3.14" ]
|
||||||
pydantic-version: [ "pydantic-v2" ]
|
pydantic-version: [ "pydantic>=2.0.2,<3.0.0" ]
|
||||||
include:
|
include:
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
python-version: "3.8"
|
python-version: "3.8"
|
||||||
pydantic-version: "pydantic-v1"
|
pydantic-version: "pydantic>=1.10.0,<2.0.0"
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: "3.8"
|
python-version: "3.8"
|
||||||
pydantic-version: "pydantic-v2"
|
pydantic-version: "pydantic>=2.0.2,<3.0.0"
|
||||||
coverage: coverage
|
coverage: coverage
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
python-version: "3.9"
|
python-version: "3.9"
|
||||||
pydantic-version: "pydantic-v1"
|
pydantic-version: "pydantic>=1.10.0,<2.0.0"
|
||||||
coverage: coverage
|
coverage: coverage
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
python-version: "3.10"
|
python-version: "3.10"
|
||||||
pydantic-version: "pydantic-v2"
|
pydantic-version: "pydantic>=2.0.2,<3.0.0"
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
pydantic-version: "pydantic-v1"
|
pydantic-version: "pydantic>=1.10.0,<2.0.0"
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
pydantic-version: "pydantic-v2"
|
pydantic-version: "pydantic>=2.0.2,<3.0.0"
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
python-version: "3.13"
|
python-version: "3.13"
|
||||||
pydantic-version: "pydantic-v1"
|
pydantic-version: "pydantic>=1.10.0,<2.0.0"
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: "3.13"
|
python-version: "3.13"
|
||||||
pydantic-version: "pydantic-v2"
|
pydantic-version: "pydantic>=2.0.2,<3.0.0"
|
||||||
coverage: coverage
|
coverage: coverage
|
||||||
|
# - os: ubuntu-latest
|
||||||
|
# python-version: "3.13"
|
||||||
|
# pydantic-version: "pydantic>=2.0.2,<2.7.0"
|
||||||
|
# coverage: coverage
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
python-version: "3.14"
|
python-version: "3.14"
|
||||||
pydantic-version: "pydantic-v2"
|
pydantic-version: "pydantic>=2.0.2,<3.0.0"
|
||||||
coverage: coverage
|
coverage: coverage
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
@ -103,12 +103,8 @@ jobs:
|
||||||
pyproject.toml
|
pyproject.toml
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: uv pip install -r requirements-tests.txt
|
run: uv pip install -r requirements-tests.txt
|
||||||
- name: Install Pydantic v1
|
- name: Install Pydantic
|
||||||
if: matrix.pydantic-version == 'pydantic-v1'
|
run: uv pip install "${{ matrix.pydantic-version }}"
|
||||||
run: uv pip install "pydantic>=1.10.0,<2.0.0"
|
|
||||||
- name: Install Pydantic v2
|
|
||||||
if: matrix.pydantic-version == 'pydantic-v2'
|
|
||||||
run: uv pip install --upgrade "pydantic>=2.0.2,<3.0.0"
|
|
||||||
# TODO: Remove this once Python 3.8 is no longer supported
|
# TODO: Remove this once Python 3.8 is no longer supported
|
||||||
- name: Install older AnyIO in Python 3.8
|
- name: Install older AnyIO in Python 3.8
|
||||||
if: matrix.python-version == '3.8'
|
if: matrix.python-version == '3.8'
|
||||||
|
|
@ -124,7 +120,7 @@ jobs:
|
||||||
if: matrix.coverage == 'coverage'
|
if: matrix.coverage == 'coverage'
|
||||||
uses: actions/upload-artifact@v5
|
uses: actions/upload-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: coverage-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pydantic-version }}
|
name: coverage-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/coverage/.coverage.*') }}
|
||||||
path: coverage
|
path: coverage
|
||||||
include-hidden-files: true
|
include-hidden-files: true
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue