]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
⬆️ Add support for Python 3.14 (#14110) feature/py314
authorSofie Van Landeghem <svlandeg@users.noreply.github.com>
Wed, 24 Sep 2025 15:58:06 +0000 (17:58 +0200)
committerGitHub <noreply@github.com>
Wed, 24 Sep 2025 15:58:06 +0000 (17:58 +0200)
* 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

.github/workflows/test.yml
pyproject.toml

index b76afe01e4327bf000966241d2f5b26e0a490b2a..c1d645f59129954ec7a2cddc1315aecaab62ec15 100644 (file)
@@ -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
index fbfdea79a45045d9d12eb012eadcdd43567197d3..8e0ccde5499c709ab26f2f1c07a62c854dd1b1d3 100644 (file)
@@ -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",
 ]