Debian Codegraph @

pyproject.toml

raw
1 [build-system]
2 requires = ["pdm-backend"]
3 build-backend = "pdm.backend"
4
5 [project]
6 name = "fastapi"
7 dynamic = ["version"]
8 description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production"
9 readme = "README.md"
10 license = "MIT"
11 license-files = ["LICENSE"]
12 requires-python = ">=3.10"
13 authors = [
14 { name = "Sebastián Ramírez", email = "[email protected]" },
15 ]
16 classifiers = [
17 "Intended Audience :: Information Technology",
18 "Intended Audience :: System Administrators",
19 "Operating System :: OS Independent",
20 "Programming Language :: Python :: 3",
21 "Programming Language :: Python",
22 "Topic :: Internet",
23 "Topic :: Software Development :: Libraries :: Application Frameworks",
24 "Topic :: Software Development :: Libraries :: Python Modules",
25 "Topic :: Software Development :: Libraries",
26 "Topic :: Software Development",
27 "Typing :: Typed",
28 "Development Status :: 4 - Beta",
29 "Environment :: Web Environment",
30 "Framework :: AsyncIO",
31 "Framework :: FastAPI",
32 "Framework :: Pydantic",
33 "Framework :: Pydantic :: 2",
34 "Intended Audience :: Developers",
35 "Programming Language :: Python :: 3 :: Only",
36 "Programming Language :: Python :: 3.10",
37 "Programming Language :: Python :: 3.11",
38 "Programming Language :: Python :: 3.12",
39 "Programming Language :: Python :: 3.13",
40 "Programming Language :: Python :: 3.14",
41 "Topic :: Internet :: WWW/HTTP :: HTTP Servers",
42 "Topic :: Internet :: WWW/HTTP",
43 ]
44 dependencies = [
45 "starlette>=0.46.0",
46 "pydantic>=2.9.0",
47 "typing-extensions>=4.8.0",
48 "typing-inspection>=0.4.2",
49 "annotated-doc>=0.0.2",
50 ]
51
52 [project.urls]
53 Homepage = "https://github.com/fastapi/fastapi"
54 Documentation = "https://fastapi.tiangolo.com/"
55 Repository = "https://github.com/fastapi/fastapi"
56 Issues = "https://github.com/fastapi/fastapi/issues"
57 Changelog = "https://fastapi.tiangolo.com/release-notes/"
58
59 [project.optional-dependencies]
60 standard = [
61 "fastapi-cli[standard] >=0.0.32",
62 "fastar >= 0.9.0",
63 # For the test client
64 "httpx >=0.23.0,<1.0.0",
65 # For templates
66 "jinja2 >=3.1.5",
67 # For forms and file uploads
68 "python-multipart >=0.0.18",
69 # To validate email fields
70 "email-validator >=2.0.0",
71 # Uvicorn with uvloop
72 "uvicorn[standard] >=0.12.0",
73 # # Settings management
74 "pydantic-settings >=2.0.0",
75 # # Extra Pydantic data types
76 "pydantic-extra-types >=2.0.0",
77 ]
78
79 standard-no-fastapi-cloud-cli = [
80 "fastapi-cli[standard-no-fastapi-cloud-cli] >=0.0.32",
81 # For the test client
82 "httpx >=0.23.0,<1.0.0",
83 # For templates
84 "jinja2 >=3.1.5",
85 # For forms and file uploads
86 "python-multipart >=0.0.18",
87 # To validate email fields
88 "email-validator >=2.0.0",
89 # Uvicorn with uvloop
90 "uvicorn[standard] >=0.12.0",
91 # # Settings management
92 "pydantic-settings >=2.0.0",
93 # # Extra Pydantic data types
94 "pydantic-extra-types >=2.0.0",
95 ]
96
97 all = [
98 "fastapi-cli[standard] >=0.0.32",
99 # # For the test client
100 "httpx >=0.23.0,<1.0.0",
101 # For templates
102 "jinja2 >=3.1.5",
103 # For forms and file uploads
104 "python-multipart >=0.0.18",
105 # For Starlette's SessionMiddleware, not commonly used with FastAPI
106 "itsdangerous >=1.1.0",
107 # For Starlette's schema generation, would not be used with FastAPI
108 "pyyaml >=5.3.1",
109 # To validate email fields
110 "email-validator >=2.0.0",
111 # Uvicorn with uvloop
112 "uvicorn[standard] >=0.12.0",
113 # Settings management
114 "pydantic-settings >=2.0.0",
115 # Extra Pydantic data types
116 "pydantic-extra-types >=2.0.0",
117 ]
118
119 [project.scripts]
120 fastapi = "fastapi.cli:main"
121
122 [dependency-groups]
123 dev = [
124 { include-group = "tests" },
125 { include-group = "docs" },
126 { include-group = "translations" },
127 "playwright >=1.57.0",
128 "prek >=0.2.22",
129 "zizmor >=1.23.1",
130 ]
131 docs = [
132 { include-group = "docs-tests" },
133 "black >=25.1.0",
134 "cairosvg >=2.8.2",
135 "griffe-typingdoc >=0.3.0",
136 "griffe-warnings-deprecated >=1.1.0",
137 "jieba >=0.42.1",
138 "markdown-include-variants >=0.0.8",
139 "mdx-include >=1.4.1,<2.0.0",
140 "mkdocstrings[python] >=1.0.3",
141 "pillow >=11.3.0",
142 "python-slugify >=8.0.4",
143 "pyyaml >=5.3.1,<7.0.0",
144 "typer >=0.21.1",
145 "zensical >=0.0.42",
146 ]
147 docs-tests = [
148 "httpx >=0.23.0,<1.0.0",
149 "httpx2>=2.0.0",
150 "ruff >=0.14.14",
151 ]
152 github-actions = [
153 "httpx >=0.27.0,<1.0.0",
154 "pydantic >=2.9.0,<3.0.0",
155 "pydantic-settings >=2.1.0,<3.0.0",
156 "pygithub >=2.3.0,<3.0.0",
157 "pyyaml >=5.3.1,<7.0.0",
158 "smokeshow >=0.5.0",
159 ]
160 tests = [
161 { include-group = "docs-tests" },
162 "anyio[trio] >=3.2.1,<5.0.0",
163 "coverage[toml] >=7.13,<8.0",
164 "dirty-equals >=0.9.0",
165 "flask >=3.0.0,<4.0.0",
166 "inline-snapshot >=0.21.1",
167 "mypy >=1.14.1",
168 "pwdlib[argon2] >=0.2.1",
169 "pyjwt >=2.9.0",
170 "pytest >=9.0.0",
171 "pytest-codspeed >=4.3.0",
172 "pyyaml >=5.3.1,<7.0.0",
173 "sqlmodel >=0.0.31",
174 "strawberry-graphql >=0.200.0,<1.0.0",
175 "ty>=0.0.25",
176 "typer >=0.24.1",
177 "a2wsgi >=1.9.0,<=2.0.0",
178 "pytest-xdist[psutil]>=2.5.0",
179 "pytest-cov>=4.0.0",
180 "pytest-sugar>=1.0.0",
181 "pytest-timeout>=2.4.0",
182 ]
183 translations = [
184 "gitpython >=3.1.46",
185 "pydantic-ai >=0.4.10",
186 "pygithub >=2.8.1",
187 ]
188
189 [tool.pdm]
190 version = { source = "file", path = "fastapi/__init__.py" }
191 distribution = true
192
193 [tool.pdm.build]
194 source-includes = [
195 "tests/",
196 "docs_src/",
197 "scripts/",
198 # For a test
199 "docs/en/docs/img/favicon.png",
200 ]
201
202 [tool.mypy]
203 plugins = ["pydantic.mypy"]
204 strict = true
205
206 [[tool.mypy.overrides]]
207 module = "fastapi.concurrency"
208 warn_unused_ignores = false
209 ignore_missing_imports = true
210
211 [[tool.mypy.overrides]]
212 module = "fastapi.tests.*"
213 ignore_missing_imports = true
214 check_untyped_defs = true
215
216 [[tool.mypy.overrides]]
217 module = "docs_src.*"
218 disallow_incomplete_defs = false
219 disallow_untyped_defs = false
220 disallow_untyped_calls = false
221
222 [tool.pytest]
223 minversion = "9.0"
224 addopts = [
225 "--strict-config",
226 "--strict-markers",
227 "--ignore=docs_src",
228 ]
229 strict_xfail = true
230 filterwarnings = [
231 "error",
232 ]
233 timeout = "20"
234
235 [tool.coverage.run]
236 parallel = true
237 data_file = "coverage/.coverage"
238 source = [
239 "docs_src",
240 "tests",
241 "fastapi"
242 ]
243 relative_files = true
244 context = '${CONTEXT}'
245 omit = [
246 "tests/benchmarks/*",
247 "tests/memory_benchmarks/*",
248 "docs_src/response_model/tutorial003_04_py310.py",
249 "docs_src/dependencies/tutorial013_an_py310.py", # temporary code example?
250 "docs_src/dependencies/tutorial014_an_py310.py", # temporary code example?
251 # Pydantic v1 migration, no longer tested
252 "docs_src/pydantic_v1_in_v2/tutorial001_an_py310.py",
253 "docs_src/pydantic_v1_in_v2/tutorial002_an_py310.py",
254 "docs_src/pydantic_v1_in_v2/tutorial003_an_py310.py",
255 "docs_src/pydantic_v1_in_v2/tutorial004_an_py310.py",
256 ]
257
258 [tool.coverage.report]
259 show_missing = true
260 sort = "-Cover"
261
262 [tool.coverage.html]
263 show_contexts = true
264
265 [tool.ruff.lint]
266 select = [
267 "E", # pycodestyle errors
268 "W", # pycodestyle warnings
269 "F", # pyflakes
270 "I", # isort
271 "B", # flake8-bugbear
272 "C4", # flake8-comprehensions
273 "UP", # pyupgrade
274 ]
275 ignore = [
276 "E501", # line too long, handled by black
277 "B008", # do not perform function calls in argument defaults
278 "C901", # too complex
279 ]
280
281 [tool.ruff.lint.per-file-ignores]
282 "__init__.py" = ["F401"]
283 "docs_src/custom_request_and_route/tutorial002_an_py310.py" = ["B904"]
284 "docs_src/custom_request_and_route/tutorial002_py310.py" = ["B904"]
285 "docs_src/custom_response/tutorial007_py310.py" = ["B007"]
286 "docs_src/dependencies/tutorial007_py310.py" = ["F821"]
287 "docs_src/dependencies/tutorial008_an_py310.py" = ["F821"]
288 "docs_src/dependencies/tutorial008_py310.py" = ["F821"]
289 "docs_src/dependencies/tutorial008b_an_py310.py" = ["B904"]
290 "docs_src/dependencies/tutorial008b_py310.py" = ["B904"]
291 "docs_src/dependencies/tutorial010_py310.py" = ["F821"]
292 "docs_src/path_operation_advanced_configuration/tutorial007_py310.py" = ["B904"]
293 "docs_src/query_params_str_validations/tutorial012_an_py310.py" = ["B006"]
294 "docs_src/query_params_str_validations/tutorial013_an_py310.py" = ["B006"]
295 "docs_src/security/tutorial004_an_py310.py" = ["B904"]
296 "docs_src/security/tutorial004_py310.py" = ["B904"]
297 "docs_src/security/tutorial005_an_py310.py" = ["B904"]
298 "docs_src/security/tutorial005_py310.py" = ["B904"]
299 "docs_src/json_base64_bytes/tutorial001_py310.py" = ["UP012"]
300 "docs_src/stream_json_lines/tutorial001_py310.py" = ["UP028"]
301 "docs_src/stream_data/tutorial001_py310.py" = ["UP028"]
302 "docs_src/stream_data/tutorial002_py310.py" = ["UP028"]
303 "docs_src/server_sent_events/tutorial001_py310.py" = ["UP028"]
304
305 [tool.ruff.lint.isort]
306 known-third-party = ["fastapi", "pydantic", "starlette"]
307
308 [tool.ruff.lint.pyupgrade]
309 # Preserve types, even if a file imports `from __future__ import annotations`.
310 keep-runtime-typing = true
311
312 [tool.inline-snapshot]
313 # default-flags=["fix"]
314 # default-flags=["create"]
315
316 [tool.typos.files]
317 extend-exclude = [
318 "coverage/",
319 "dist/",
320 "docs/de/",
321 "docs/en/data/",
322 "docs/en/docs/img/",
323 "docs/es/",
324 "docs/fr/",
325 "docs/ja/",
326 "docs/ko/",
327 "docs/language_names.yml",
328 "docs/pt/",
329 "docs/ru/",
330 "docs/tr/",
331 "docs/uk/",
332 "docs/zh/",
333 "docs/zh-hant/",
334 "docs/hi/",
335 "htmlcov/",
336 "scripts/general-llm-prompt.md",
337 "scripts/tests/test_translation_fixer/test_complex_doc/",
338 "site/",
339 "site_build/",
340 "uv.lock",
341 ]
342
343 [tool.typos.default]
344 extend-ignore-re = [
345 # GitHub usernames in @mentions
346 "@[a-zA-Z0-9](?:-?[a-zA-Z0-9])*",
347 # Quoted typo documented in a release note
348 "'wll' to 'will'",
349 # German article title in a release note
350 "FastAPI Modul.",
351 ]
352
353 [tool.typos.default.extend-identifiers]
354 alls = "alls"
355
356 [tool.typos.default.extend-words]
357 ba = "ba"
358 fo = "fo"
359 havin = "havin"
360 Ines = "Ines"
361 ser = "ser"
362
363 [tool.ty.src]
364 exclude = [
365 # These docs examples are intentionally partial, dynamic, environment-driven,
366 # deprecated, or currently require broader tutorial rewrites to satisfy ty.
367 "docs_src/additional_status_codes/",
368 "docs_src/app_testing/tutorial003_py310.py",
369 "docs_src/body_multiple_params/",
370 "docs_src/body_updates/tutorial002_py310.py",
371 "docs_src/custom_docs_ui/",
372 "docs_src/custom_response/tutorial001_py310.py",
373 "docs_src/custom_response/tutorial001b_py310.py",
374 "docs_src/custom_response/tutorial009c_py310.py",
375 "docs_src/dependencies/tutorial007_py310.py",
376 "docs_src/dependencies/tutorial008_an_py310.py",
377 "docs_src/dependencies/tutorial008_py310.py",
378 "docs_src/dependencies/tutorial010_py310.py",
379 "docs_src/events/",
380 "docs_src/extending_openapi/tutorial001_py310.py",
381 "docs_src/path_params_numeric_validations/",
382 "docs_src/pydantic_v1_in_v2/tutorial004_an_py310.py",
383 "docs_src/python_types/tutorial003_py310.py",
384 "docs_src/python_types/tutorial011_py310.py",
385 "docs_src/query_params_str_validations/",
386 "docs_src/response_model/tutorial006_py310.py",
387 "docs_src/security/tutorial003_an_py310.py",
388 "docs_src/security/tutorial003_py310.py",
389 "docs_src/security/tutorial004_an_py310.py",
390 "docs_src/security/tutorial004_py310.py",
391 "docs_src/security/tutorial005_an_py310.py",
392 "docs_src/security/tutorial005_py310.py",
393 "docs_src/settings/",
394 "docs_src/sql_databases/",
395 "docs_src/using_request_directly/tutorial001_py310.py",
396 "docs_src/wsgi/tutorial001_py310.py",
397 ]
398
399 [tool.ty.terminal]
400 error-on-warning = true