From: Sofie Van Landeghem Date: Wed, 24 Sep 2025 15:58:06 +0000 (+0200) Subject: ⬆️ Add support for Python 3.14 (#14110) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Ffeature%2Fpy314;p=thirdparty%2Ffastapi%2Ffastapi.git ⬆️ Add support for Python 3.14 (#14110) * run test suite on Python 3.14 * add 3.14 classifier * allow Python pre-release for now * exclude pydantic v1 on Python 3.14 * install pydantic 1.12.0 alpha1 when testing on python 3.14 * preinstall pydantic 1.12.0 alpha1 before anything else --- diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b76afe01e..c1d645f59 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,6 +48,7 @@ jobs: strategy: matrix: python-version: + - "3.14" - "3.13" - "3.12" - "3.11" @@ -55,6 +56,9 @@ jobs: - "3.9" - "3.8" pydantic-version: ["pydantic-v1", "pydantic-v2"] + exclude: + - python-version: "3.14" + pydantic-version: "pydantic-v1" fail-fast: false steps: - name: Dump GitHub context @@ -66,6 +70,7 @@ jobs: uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true - name: Setup uv uses: astral-sh/setup-uv@v6 with: @@ -74,13 +79,16 @@ jobs: cache-dependency-glob: | requirements**.txt pyproject.toml + - name: Preinstall Pydantic 2.12.0a1 for Python 3.14 + if: matrix.python-version == '3.14' + run: uv pip install --pre "pydantic==2.12.0a1" - name: Install Dependencies run: uv pip install -r requirements-tests.txt - name: Install Pydantic v1 if: matrix.pydantic-version == 'pydantic-v1' run: uv pip install "pydantic>=1.10.0,<2.0.0" - name: Install Pydantic v2 - if: matrix.pydantic-version == 'pydantic-v2' + if: matrix.pydantic-version == 'pydantic-v2' && matrix.python-version != '3.14' run: uv pip install --upgrade "pydantic>=2.0.2,<3.0.0" # TODO: Remove this once Python 3.8 is no longer supported - name: Install older AnyIO in Python 3.8 diff --git a/pyproject.toml b/pyproject.toml index fbfdea79a..8e0ccde54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Internet :: WWW/HTTP", ]