[build-system]
requires = [
    "pdm-backend",
]
build-backend = "pdm.backend"

[project]
name = "fastapi"
dynamic = []
description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production"
readme = "README.md"
license = "MIT"
license-files = [
    "LICENSE",
]
requires-python = ">=3.10"
authors = [
    { name = "Sebastián Ramírez", email = "tiangolo@gmail.com" },
]
classifiers = [
    "Intended Audience :: Information Technology",
    "Intended Audience :: System Administrators",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python",
    "Topic :: Internet",
    "Topic :: Software Development :: Libraries :: Application Frameworks",
    "Topic :: Software Development :: Libraries :: Python Modules",
    "Topic :: Software Development :: Libraries",
    "Topic :: Software Development",
    "Typing :: Typed",
    "Development Status :: 4 - Beta",
    "Environment :: Web Environment",
    "Framework :: AsyncIO",
    "Framework :: FastAPI",
    "Framework :: Pydantic",
    "Framework :: Pydantic :: 2",
    "Intended Audience :: Developers",
    "Programming Language :: Python :: 3 :: Only",
    "Programming Language :: Python :: 3.10",
    "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",
]
dependencies = [
    "starlette>=0.46.0",
    "pydantic>=2.9.0",
    "typing-extensions>=4.8.0",
    "typing-inspection>=0.4.2",
    "annotated-doc>=0.0.2",
]
version = "0.140.13"

[project.urls]
Homepage = "https://github.com/fastapi/fastapi"
Documentation = "https://fastapi.tiangolo.com/"
Repository = "https://github.com/fastapi/fastapi"
Issues = "https://github.com/fastapi/fastapi/issues"
Changelog = "https://fastapi.tiangolo.com/release-notes/"

[project.optional-dependencies]
standard = [
    "fastapi-cli[standard] >=0.0.8",
    "fastar >= 0.9.0",
    "httpx >=0.23.0,<1.0.0",
    "jinja2 >=3.1.5",
    "python-multipart >=0.0.18",
    "email-validator >=2.0.0",
    "uvicorn[standard] >=0.12.0",
    "pydantic-settings >=2.0.0",
    "pydantic-extra-types >=2.0.0",
]
standard-no-fastapi-cloud-cli = [
    "fastapi-cli[standard-no-fastapi-cloud-cli] >=0.0.8",
    "httpx >=0.23.0,<1.0.0",
    "jinja2 >=3.1.5",
    "python-multipart >=0.0.18",
    "email-validator >=2.0.0",
    "uvicorn[standard] >=0.12.0",
    "pydantic-settings >=2.0.0",
    "pydantic-extra-types >=2.0.0",
]
all = [
    "fastapi-cli[standard] >=0.0.8",
    "httpx >=0.23.0,<1.0.0",
    "jinja2 >=3.1.5",
    "python-multipart >=0.0.18",
    "itsdangerous >=1.1.0",
    "pyyaml >=5.3.1",
    "email-validator >=2.0.0",
    "uvicorn[standard] >=0.12.0",
    "pydantic-settings >=2.0.0",
    "pydantic-extra-types >=2.0.0",
]

[project.scripts]
fastapi = "fastapi.cli:main"

[dependency-groups]
dev = [
    { include-group = "tests" },
    { include-group = "docs" },
    { include-group = "translations" },
    "playwright >=1.57.0",
    "prek >=0.2.22",
    "zizmor >=1.23.1",
]
docs = [
    { include-group = "docs-tests" },
    "black >=25.1.0",
    "cairosvg >=2.8.2",
    "griffe-typingdoc >=0.3.0",
    "griffe-warnings-deprecated >=1.1.0",
    "jieba >=0.42.1",
    "markdown-include-variants >=0.0.8",
    "mdx-include >=1.4.1,<2.0.0",
    "mkdocstrings[python] >=1.0.3",
    "pillow >=11.3.0",
    "python-slugify >=8.0.4",
    "pyyaml >=5.3.1,<7.0.0",
    "typer >=0.21.1",
    "zensical >=0.0.42",
]
docs-tests = [
    "httpx >=0.23.0,<1.0.0",
    "httpx2>=2.0.0",
    "ruff >=0.14.14",
]
github-actions = [
    "httpx >=0.27.0,<1.0.0",
    "pydantic >=2.9.0,<3.0.0",
    "pydantic-settings >=2.1.0,<3.0.0",
    "pygithub >=2.3.0,<3.0.0",
    "pyyaml >=5.3.1,<7.0.0",
    "smokeshow >=0.5.0",
]
tests = [
    { include-group = "docs-tests" },
    "anyio[trio] >=3.2.1,<5.0.0",
    "coverage[toml] >=7.13,<8.0",
    "dirty-equals >=0.9.0",
    "flask >=3.0.0,<4.0.0",
    "inline-snapshot >=0.21.1",
    "mypy >=1.14.1",
    "pwdlib[argon2] >=0.2.1",
    "pyjwt >=2.9.0",
    "pytest >=9.0.0",
    "pytest-codspeed >=4.3.0",
    "pyyaml >=5.3.1,<7.0.0",
    "sqlmodel >=0.0.31",
    "strawberry-graphql >=0.200.0,<1.0.0",
    "ty>=0.0.25",
    "typer >=0.24.1",
    "a2wsgi >=1.9.0,<=2.0.0",
    "pytest-xdist[psutil]>=2.5.0",
    "pytest-cov>=4.0.0",
    "pytest-sugar>=1.0.0",
    "pytest-timeout>=2.4.0",
]
translations = [
    "gitpython >=3.1.46",
    "pydantic-ai >=0.4.10",
    "pygithub >=2.8.1",
]

[tool.pdm]
distribution = true

[tool.pdm.version]
source = "file"
path = "fastapi/__init__.py"

[tool.pdm.build]
source-includes = [
    "tests/",
    "docs_src/",
    "scripts/",
    "docs/en/docs/img/favicon.png",
]

[tool.mypy]
plugins = [
    "pydantic.mypy",
]
strict = true

[[tool.mypy.overrides]]
module = "fastapi.concurrency"
warn_unused_ignores = false
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "fastapi.tests.*"
ignore_missing_imports = true
check_untyped_defs = true

[[tool.mypy.overrides]]
module = "docs_src.*"
disallow_incomplete_defs = false
disallow_untyped_defs = false
disallow_untyped_calls = false

[tool.pytest]
minversion = "9.0"
addopts = [
    "--strict-config",
    "--strict-markers",
    "--ignore=docs_src",
]
strict_xfail = true
filterwarnings = [
    "error",
]
timeout = "20"

[tool.coverage.run]
parallel = true
data_file = "coverage/.coverage"
source = [
    "docs_src",
    "tests",
    "fastapi",
]
relative_files = true
context = "${CONTEXT}"
omit = [
    "tests/benchmarks/*",
    "tests/memory_benchmarks/*",
    "docs_src/response_model/tutorial003_04_py310.py",
    "docs_src/dependencies/tutorial013_an_py310.py",
    "docs_src/dependencies/tutorial014_an_py310.py",
    "docs_src/pydantic_v1_in_v2/tutorial001_an_py310.py",
    "docs_src/pydantic_v1_in_v2/tutorial002_an_py310.py",
    "docs_src/pydantic_v1_in_v2/tutorial003_an_py310.py",
    "docs_src/pydantic_v1_in_v2/tutorial004_an_py310.py",
]

[tool.coverage.report]
show_missing = true
sort = "-Cover"

[tool.coverage.html]
show_contexts = true

[tool.ruff.lint]
select = [
    "E",
    "W",
    "F",
    "I",
    "B",
    "C4",
    "UP",
]
ignore = [
    "E501",
    "B008",
    "C901",
]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
    "F401",
]
"docs_src/custom_request_and_route/tutorial002_an_py310.py" = [
    "B904",
]
"docs_src/custom_request_and_route/tutorial002_py310.py" = [
    "B904",
]
"docs_src/custom_response/tutorial007_py310.py" = [
    "B007",
]
"docs_src/dependencies/tutorial007_py310.py" = [
    "F821",
]
"docs_src/dependencies/tutorial008_an_py310.py" = [
    "F821",
]
"docs_src/dependencies/tutorial008_py310.py" = [
    "F821",
]
"docs_src/dependencies/tutorial008b_an_py310.py" = [
    "B904",
]
"docs_src/dependencies/tutorial008b_py310.py" = [
    "B904",
]
"docs_src/dependencies/tutorial010_py310.py" = [
    "F821",
]
"docs_src/path_operation_advanced_configuration/tutorial007_py310.py" = [
    "B904",
]
"docs_src/query_params_str_validations/tutorial012_an_py310.py" = [
    "B006",
]
"docs_src/query_params_str_validations/tutorial013_an_py310.py" = [
    "B006",
]
"docs_src/security/tutorial004_an_py310.py" = [
    "B904",
]
"docs_src/security/tutorial004_py310.py" = [
    "B904",
]
"docs_src/security/tutorial005_an_py310.py" = [
    "B904",
]
"docs_src/security/tutorial005_py310.py" = [
    "B904",
]
"docs_src/json_base64_bytes/tutorial001_py310.py" = [
    "UP012",
]
"docs_src/stream_json_lines/tutorial001_py310.py" = [
    "UP028",
]
"docs_src/stream_data/tutorial001_py310.py" = [
    "UP028",
]
"docs_src/stream_data/tutorial002_py310.py" = [
    "UP028",
]
"docs_src/server_sent_events/tutorial001_py310.py" = [
    "UP028",
]

[tool.ruff.lint.isort]
known-third-party = [
    "fastapi",
    "pydantic",
    "starlette",
]

[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true

[tool.inline-snapshot]

[tool.typos.files]
extend-exclude = [
    "coverage/",
    "dist/",
    "docs/de/",
    "docs/en/data/",
    "docs/en/docs/img/",
    "docs/es/",
    "docs/fr/",
    "docs/ja/",
    "docs/ko/",
    "docs/language_names.yml",
    "docs/pt/",
    "docs/ru/",
    "docs/tr/",
    "docs/uk/",
    "docs/zh/",
    "docs/zh-hant/",
    "docs/hi/",
    "htmlcov/",
    "scripts/general-llm-prompt.md",
    "scripts/tests/test_translation_fixer/test_complex_doc/",
    "site/",
    "site_build/",
    "uv.lock",
]

[tool.typos.default]
extend-ignore-re = [
    "@[a-zA-Z0-9](?:-?[a-zA-Z0-9])*",
    "'wll' to 'will'",
    "FastAPI Modul.",
]

[tool.typos.default.extend-identifiers]
alls = "alls"

[tool.typos.default.extend-words]
ba = "ba"
fo = "fo"
havin = "havin"
Ines = "Ines"
ser = "ser"

[tool.ty.src]
exclude = [
    "docs_src/additional_status_codes/",
    "docs_src/app_testing/tutorial003_py310.py",
    "docs_src/body_multiple_params/",
    "docs_src/body_updates/tutorial002_py310.py",
    "docs_src/custom_docs_ui/",
    "docs_src/custom_response/tutorial001_py310.py",
    "docs_src/custom_response/tutorial001b_py310.py",
    "docs_src/custom_response/tutorial009c_py310.py",
    "docs_src/dependencies/tutorial007_py310.py",
    "docs_src/dependencies/tutorial008_an_py310.py",
    "docs_src/dependencies/tutorial008_py310.py",
    "docs_src/dependencies/tutorial010_py310.py",
    "docs_src/events/",
    "docs_src/extending_openapi/tutorial001_py310.py",
    "docs_src/path_params_numeric_validations/",
    "docs_src/pydantic_v1_in_v2/tutorial004_an_py310.py",
    "docs_src/python_types/tutorial003_py310.py",
    "docs_src/python_types/tutorial011_py310.py",
    "docs_src/query_params_str_validations/",
    "docs_src/response_model/tutorial006_py310.py",
    "docs_src/security/tutorial003_an_py310.py",
    "docs_src/security/tutorial003_py310.py",
    "docs_src/security/tutorial004_an_py310.py",
    "docs_src/security/tutorial004_py310.py",
    "docs_src/security/tutorial005_an_py310.py",
    "docs_src/security/tutorial005_py310.py",
    "docs_src/settings/",
    "docs_src/sql_databases/",
    "docs_src/using_request_directly/tutorial001_py310.py",
    "docs_src/wsgi/tutorial001_py310.py",
]

[tool.ty.terminal]
error-on-warning = true
