Skip to content

Commit 41fcbc7

Browse files
authored
🔧 Migrate from Hatch to PDM for the internal build (fastapi#11498)
1 parent bec2ec7 commit 41fcbc7

File tree

5 files changed

+60
-21
lines changed

5 files changed

+60
-21
lines changed

.github/workflows/publish.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ on:
88
jobs:
99
publish:
1010
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
package:
14+
- fastapi
15+
permissions:
16+
id-token: write
1117
steps:
1218
- name: Dump GitHub context
1319
env:
@@ -21,19 +27,14 @@ jobs:
2127
# Issue ref: https://github.com/actions/setup-python/issues/436
2228
# cache: "pip"
2329
# cache-dependency-path: pyproject.toml
24-
- uses: actions/cache@v4
25-
id: cache
26-
with:
27-
path: ${{ env.pythonLocation }}
28-
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish
2930
- name: Install build dependencies
3031
run: pip install build
3132
- name: Build distribution
33+
env:
34+
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
3235
run: python -m build
3336
- name: Publish
3437
uses: pypa/[email protected]
35-
with:
36-
password: ${{ secrets.PYPI_API_TOKEN }}
3738
- name: Dump GitHub context
3839
env:
3940
GITHUB_CONTEXT: ${{ toJson(github) }}

fastapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""FastAPI framework, high performance, easy to learn, fast to code, ready for production"""
22

3-
__version__ = "0.110.2"
3+
__version__ = "0.110.3.dev2"
44

55
from starlette import status as status
66

pyproject.toml

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[build-system]
2-
requires = ["hatchling >= 1.13.0"]
3-
build-backend = "hatchling.build"
2+
requires = ["pdm-backend"]
3+
build-backend = "pdm.backend"
44

55
[project]
66
name = "fastapi"
7+
dynamic = ["version"]
78
description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production"
89
readme = "README.md"
910
requires-python = ">=3.8"
10-
license = "MIT"
1111
authors = [
1212
{ name = "Sebastián Ramírez", email = "[email protected]" },
1313
]
@@ -45,30 +45,74 @@ dependencies = [
4545
"pydantic>=1.7.4,!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0",
4646
"typing-extensions>=4.8.0",
4747
]
48-
dynamic = ["version"]
4948

5049
[project.urls]
5150
Homepage = "https://github.com/tiangolo/fastapi"
5251
Documentation = "https://fastapi.tiangolo.com/"
5352
Repository = "https://github.com/tiangolo/fastapi"
5453

5554
[project.optional-dependencies]
55+
56+
# standard = [
57+
# # For the test client
58+
# "httpx >=0.23.0",
59+
# # For templates
60+
# "jinja2 >=2.11.2",
61+
# # For forms and file uploads
62+
# "python-multipart >=0.0.7",
63+
# # For UJSONResponse
64+
# "ujson >=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0",
65+
# # For ORJSONResponse
66+
# "orjson >=3.2.1",
67+
# # To validate email fields
68+
# "email_validator >=2.0.0",
69+
# # Uvicorn with uvloop
70+
# "uvicorn[standard] >=0.12.0",
71+
# # Settings management
72+
# "pydantic-settings >=2.0.0",
73+
# # Extra Pydantic data types
74+
# "pydantic-extra-types >=2.0.0",
75+
# ]
76+
5677
all = [
78+
# # For the test client
5779
"httpx >=0.23.0",
80+
# For templates
5881
"jinja2 >=2.11.2",
82+
# For forms and file uploads
5983
"python-multipart >=0.0.7",
84+
# For Starlette's SessionMiddleware, not commonly used with FastAPI
6085
"itsdangerous >=1.1.0",
86+
# For Starlette's schema generation, would not be used with FastAPI
6187
"pyyaml >=5.3.1",
88+
# For UJSONResponse
6289
"ujson >=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0",
90+
# For ORJSONResponse
6391
"orjson >=3.2.1",
92+
# To validate email fields
6493
"email_validator >=2.0.0",
94+
# Uvicorn with uvloop
6595
"uvicorn[standard] >=0.12.0",
96+
# Settings management
6697
"pydantic-settings >=2.0.0",
98+
# Extra Pydantic data types
6799
"pydantic-extra-types >=2.0.0",
68100
]
69101

70-
[tool.hatch.version]
71-
path = "fastapi/__init__.py"
102+
[tool.pdm]
103+
version = { source = "file", path = "fastapi/__init__.py" }
104+
distribution = true
105+
106+
[tool.pdm.build]
107+
source-includes = [
108+
"tests/",
109+
"docs_src/",
110+
"requirements*.txt",
111+
"scripts/",
112+
# For a test
113+
"docs/en/docs/img/favicon.png",
114+
]
115+
72116

73117
[tool.mypy]
74118
strict = true

requirements-tests.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
-e .
1+
-e .[all]
22
-r requirements-docs-tests.txt
3-
pydantic-settings >=2.0.0
43
pytest >=7.1.3,<8.0.0
54
coverage[toml] >= 6.5.0,< 8.0
65
mypy ==1.8.0
76
ruff ==0.2.0
8-
email_validator >=1.1.1,<3.0.0
97
dirty-equals ==0.6.0
108
# TODO: once removing databases from tutorial, upgrade SQLAlchemy
119
# probably when including SQLModel
1210
sqlalchemy >=1.3.18,<1.4.43
1311
databases[sqlite] >=0.3.2,<0.7.0
14-
orjson >=3.2.1,<4.0.0
15-
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
16-
python-multipart >=0.0.7,<0.1.0
1712
flask >=1.1.2,<3.0.0
1813
anyio[trio] >=3.2.1,<4.0.0
1914
python-jose[cryptography] >=3.3.0,<4.0.0

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
-e .[all]
22
-r requirements-tests.txt
33
-r requirements-docs.txt
4-
uvicorn[standard] >=0.12.0,<0.23.0
54
pre-commit >=2.17.0,<4.0.0
65
# For generating screenshots
76
playwright

0 commit comments

Comments
 (0)