]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
🔧 Migrate from Hatch to PDM for the internal build (#11498)
authorSebastián Ramírez <tiangolo@gmail.com>
Mon, 29 Apr 2024 23:48:42 +0000 (16:48 -0700)
committerGitHub <noreply@github.com>
Mon, 29 Apr 2024 23:48:42 +0000 (16:48 -0700)
.github/workflows/publish.yml
fastapi/__init__.py
pyproject.toml
requirements-tests.txt
requirements.txt

index a5cbf6da4200f87bc4d6f78e509d361b690bd94a..5ec81b02bdd5e14fe39719f875772ecac7e6b0d8 100644 (file)
@@ -8,6 +8,12 @@ on:
 jobs:
   publish:
     runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        package:
+          - fastapi
+    permissions:
+      id-token: write
     steps:
       - name: Dump GitHub context
         env:
@@ -21,19 +27,14 @@ jobs:
           # Issue ref: https://github.com/actions/setup-python/issues/436
           # cache: "pip"
           # cache-dependency-path: pyproject.toml
-      - uses: actions/cache@v4
-        id: cache
-        with:
-          path: ${{ env.pythonLocation }}
-          key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish
       - name: Install build dependencies
         run: pip install build
       - name: Build distribution
+        env:
+          TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
         run: python -m build
       - name: Publish
         uses: pypa/gh-action-pypi-publish@v1.8.14
-        with:
-          password: ${{ secrets.PYPI_API_TOKEN }}
       - name: Dump GitHub context
         env:
           GITHUB_CONTEXT: ${{ toJson(github) }}
index f286577121ad9e935aa44e4411d3c8c24cfac9a1..32d5c41e179eb2023bb3659c2154e9fe03ad2c12 100644 (file)
@@ -1,6 +1,6 @@
 """FastAPI framework, high performance, easy to learn, fast to code, ready for production"""
 
-__version__ = "0.110.2"
+__version__ = "0.110.3.dev2"
 
 from starlette import status as status
 
index 6c3bebf2bc46a7e85982966be292b386d284bae6..8f7e0313cced6b8fc3bf045af788ab42f964ef2e 100644 (file)
@@ -1,13 +1,13 @@
 [build-system]
-requires = ["hatchling >= 1.13.0"]
-build-backend = "hatchling.build"
+requires = ["pdm-backend"]
+build-backend = "pdm.backend"
 
 [project]
 name = "fastapi"
+dynamic = ["version"]
 description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production"
 readme = "README.md"
 requires-python = ">=3.8"
-license = "MIT"
 authors = [
     { name = "Sebastián Ramírez", email = "tiangolo@gmail.com" },
 ]
@@ -45,7 +45,6 @@ dependencies = [
     "pydantic>=1.7.4,!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0",
     "typing-extensions>=4.8.0",
 ]
-dynamic = ["version"]
 
 [project.urls]
 Homepage = "https://github.com/tiangolo/fastapi"
@@ -53,22 +52,67 @@ Documentation = "https://fastapi.tiangolo.com/"
 Repository = "https://github.com/tiangolo/fastapi"
 
 [project.optional-dependencies]
+
+# standard = [
+#     # For the test client
+#     "httpx >=0.23.0",
+#     # For templates
+#     "jinja2 >=2.11.2",
+#     # For forms and file uploads
+#     "python-multipart >=0.0.7",
+#     # For UJSONResponse
+#     "ujson >=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0",
+#     # For ORJSONResponse
+#     "orjson >=3.2.1",
+#     # To validate email fields
+#     "email_validator >=2.0.0",
+#     # Uvicorn with uvloop
+#     "uvicorn[standard] >=0.12.0",
+#     # Settings management
+#     "pydantic-settings >=2.0.0",
+#     # Extra Pydantic data types
+#     "pydantic-extra-types >=2.0.0",
+# ]
+
 all = [
+    # # For the test client
     "httpx >=0.23.0",
+    # For templates
     "jinja2 >=2.11.2",
+    # For forms and file uploads
     "python-multipart >=0.0.7",
+    # For Starlette's SessionMiddleware, not commonly used with FastAPI
     "itsdangerous >=1.1.0",
+    # For Starlette's schema generation, would not be used with FastAPI
     "pyyaml >=5.3.1",
+    # For UJSONResponse
     "ujson >=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0",
+    # For ORJSONResponse
     "orjson >=3.2.1",
+    # To validate email fields
     "email_validator >=2.0.0",
+    # Uvicorn with uvloop
     "uvicorn[standard] >=0.12.0",
+    # Settings management
     "pydantic-settings >=2.0.0",
+    # Extra Pydantic data types
     "pydantic-extra-types >=2.0.0",
 ]
 
-[tool.hatch.version]
-path = "fastapi/__init__.py"
+[tool.pdm]
+version = { source = "file", path = "fastapi/__init__.py" }
+distribution = true
+
+[tool.pdm.build]
+source-includes = [
+    "tests/",
+    "docs_src/",
+    "requirements*.txt",
+    "scripts/",
+    # For a test
+    "docs/en/docs/img/favicon.png",
+    ]
+
 
 [tool.mypy]
 strict = true
index 30762bc64ce130b5b38232c53c81db49bf983afe..88a5533308d260753f9af075da75342608c039b6 100644 (file)
@@ -1,19 +1,14 @@
--e .
+-e .[all]
 -r requirements-docs-tests.txt
-pydantic-settings >=2.0.0
 pytest >=7.1.3,<8.0.0
 coverage[toml] >= 6.5.0,< 8.0
 mypy ==1.8.0
 ruff ==0.2.0
-email_validator >=1.1.1,<3.0.0
 dirty-equals ==0.6.0
 # TODO: once removing databases from tutorial, upgrade SQLAlchemy
 # probably when including SQLModel
 sqlalchemy >=1.3.18,<1.4.43
 databases[sqlite] >=0.3.2,<0.7.0
-orjson >=3.2.1,<4.0.0
-ujson >=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,<6.0.0
-python-multipart >=0.0.7,<0.1.0
 flask >=1.1.2,<3.0.0
 anyio[trio] >=3.2.1,<4.0.0
 python-jose[cryptography] >=3.3.0,<4.0.0
index ef25ec483fccb9259fca06f6215578595c475f37..8e1fef3416e51390a93207b48511bdbe4492d90e 100644 (file)
@@ -1,7 +1,6 @@
 -e .[all]
 -r requirements-tests.txt
 -r requirements-docs.txt
-uvicorn[standard] >=0.12.0,<0.23.0
 pre-commit >=2.17.0,<4.0.0
 # For generating screenshots
 playwright