1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
|
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "uvicorn"
dynamic = ["version"]
description = "The lightning-fast ASGI server."
readme = "README.md"
license = "BSD-3-Clause"
license-files = ["LICENSE.md"]
requires-python = ">=3.9"
authors = [
{ name = "Tom Christie", email = "tom@tomchristie.com" },
]
maintainers = [
{ name = "Marcelo Trylesinski", email = "marcelotryle@gmail.com" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"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",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: WWW/HTTP",
]
dependencies = [
"click>=7.0",
"h11>=0.8",
"typing_extensions>=4.0; python_version < '3.11'",
]
[project.optional-dependencies]
standard = [
"colorama>=0.4; sys_platform == 'win32'",
"httptools>=0.6.3",
"python-dotenv>=0.13",
"PyYAML>=5.1",
"uvloop>=0.15.1; sys_platform != 'win32' and (sys_platform != 'cygwin' and platform_python_implementation != 'PyPy')",
"watchfiles>=0.13",
"websockets>=10.4",
]
[dependency-groups]
dev = [
# We add uvicorn[standard] so `uv sync` considers the extras.
"uvicorn[standard]",
"ruff==0.11.9",
"pytest==8.3.5",
"pytest-mock==3.14.0",
"pytest-xdist[psutil]==3.6.1",
"mypy==1.15.0",
"types-click==7.1.8",
"types-pyyaml==6.0.12.20250402",
"trustme==1.2.1",
"cryptography>=44.0.3",
"coverage==7.8.0",
"coverage-conditional-plugin==0.9.0",
"coverage-enable-subprocess==1.0",
"httpx==0.28.1",
# check dist
"twine==6.1.0",
# Explicit optionals,
"a2wsgi==1.10.8",
"wsproto==1.2.0",
"websockets==13.1",
]
docs = [
"mkdocs==1.6.1",
"mkdocs-material==9.6.21",
"mkdocstrings-python==1.18.2",
"mkdocs-llmstxt==0.4.0",
]
[tool.uv]
default-groups = ["dev", "docs"]
required-version = ">=0.8.6"
[project.scripts]
uvicorn = "uvicorn.main:main"
[project.urls]
Changelog = "https://uvicorn.dev/release-notes"
Funding = "https://github.com/sponsors/encode"
Homepage = "https://uvicorn.dev/"
Source = "https://github.com/Kludex/uvicorn"
[tool.hatch.version]
path = "uvicorn/__init__.py"
[tool.hatch.build.targets.sdist]
include = ["/uvicorn", "/tests", "/requirements.txt"]
[tool.ruff]
line-length = 120
[tool.ruff.lint]
select = ["E", "F", "I", "FA", "UP"]
ignore = ["B904", "B028", "UP031"]
[tool.ruff.lint.isort]
combine-as-imports = true
[tool.mypy]
warn_unused_ignores = true
warn_redundant_casts = true
show_error_codes = true
disallow_untyped_defs = true
ignore_missing_imports = true
follow_imports = "silent"
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
check_untyped_defs = true
[tool.pytest.ini_options]
addopts = "-rxXs --strict-config --strict-markers -n 8"
xfail_strict = true
filterwarnings = [
"error",
"ignore:Uvicorn's native WSGI implementation is deprecated.*:DeprecationWarning",
"ignore: 'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning",
"ignore: remove second argument of ws_handler:DeprecationWarning:websockets",
"ignore: websockets.legacy is deprecated.*:DeprecationWarning",
"ignore: websockets.server.WebSocketServerProtocol is deprecated.*:DeprecationWarning",
"ignore: websockets.client.connect is deprecated.*:DeprecationWarning",
# httptools in Python 3.14t needs the `PYTHON_GIL=0` environment variable, or raises a RuntimeWarning.
"ignore: The global interpreter lock (GIL)*:RuntimeWarning"
]
[tool.coverage.run]
parallel = true
source_pkgs = ["uvicorn", "tests"]
plugins = ["coverage_conditional_plugin"]
omit = ["uvicorn/workers.py", "uvicorn/__main__.py", "uvicorn/_compat.py"]
[tool.coverage.report]
precision = 2
fail_under = 100
show_missing = true
skip_covered = true
exclude_lines = [
"pragma: no cover",
"pragma: nocover",
"pragma: full coverage",
"if TYPE_CHECKING:",
"if typing.TYPE_CHECKING:",
"raise NotImplementedError",
]
[tool.coverage.coverage_conditional_plugin.omit]
"sys_platform == 'win32'" = [
"uvicorn/loops/uvloop.py",
"uvicorn/supervisors/multiprocess.py",
"tests/supervisors/test_multiprocess.py",
]
"sys_platform != 'win32'" = ["uvicorn/loops/asyncio.py"]
[tool.coverage.coverage_conditional_plugin.rules]
py-win32 = "sys_platform == 'win32'"
py-not-win32 = "sys_platform != 'win32'"
py-linux = "sys_platform == 'linux'"
py-not-linux = "sys_platform != 'linux'"
py-darwin = "sys_platform == 'darwin'"
py-gte-39 = "sys_version_info >= (3, 9)"
py-lt-39 = "sys_version_info < (3, 9)"
py-gte-310 = "sys_version_info >= (3, 10)"
py-lt-310 = "sys_version_info < (3, 10)"
py-gte-311 = "sys_version_info >= (3, 11)"
py-lt-311 = "sys_version_info < (3, 11)"
|