From d21b25bfbd488986bf3549fbf6cceb89b69dc97b Mon Sep 17 00:00:00 2001 From: Brendon Smith Date: Sat, 4 Jan 2025 15:26:22 -0500 Subject: [PATCH] Update to Uvicorn 0.34.0 This commit will update/upgrade Uvicorn [from 0.28.1 to 0.34.0](https://github.com/encode/uvicorn/compare/0.28.1...0.34.0). There were some notable (but undocumented) updates to signal handling introduced in Uvicorn 0.29. The updates may result in child processes that do not shut down after the Uvicorn server gracefully shuts down ([encode/uvicorn#1600](https://github.com/encode/uvicorn/pull/1600), [encode/uvicorn#2281](https://github.com/encode/uvicorn/discussions/2281), [encode/uvicorn#2289](https://github.com/encode/uvicorn/issues/2289), [encode/uvicorn#2317](https://github.com/encode/uvicorn/pull/2317)). For this reason, it may be helpful to check servers for orphaned child processes. See the GitHub references above for further info. As noted in commit 3ab51b6, Uvicorn workers were deprecated in 0.30.0. The workers are now available at `inboard.gunicorn_workers`. Other updates include an overhaul of the Uvicorn multiprocess manager (`uvicorn.supervisors.process.Multiprocess`, [encode/uvicorn#2183](https://github.com/encode/uvicorn/pull/2183)) and small updates to the `forwarded_allow_ips`/`--forwarded-allow-ips` config setting. --- inboard/types.py | 2 +- pyproject.toml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inboard/types.py b/inboard/types.py index 6dfd087..26e2fc6 100644 --- a/inboard/types.py +++ b/inboard/types.py @@ -136,7 +136,7 @@ class UvicornOptions(TypedDict, total=False): limit_max_requests: int | None timeout_keep_alive: int timeout_graceful_shutdown: int | None - ssl_keyfile: str | None + ssl_keyfile: str | PathLike[str] | None ssl_certfile: str | PathLike[str] | None ssl_keyfile_password: str | None ssl_version: int diff --git a/pyproject.toml b/pyproject.toml index 551d5f1..63f1d46 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ classifiers = [ ] dependencies = [ "gunicorn==22.0.0", - "uvicorn==0.28.1", + "uvicorn==0.34.0", ] description = "Docker images and utilities to power your Python APIs and help you ship faster." dynamic = ["version"] @@ -56,12 +56,12 @@ tests = [ "trustme>=1.2,<2", ] uvicorn-fast = [ - "httptools>=0.5.0", + "httptools>=0.6.3", "uvloop>=0.14.0,!=0.15.0,!=0.15.1; sys_platform != 'win32' and (sys_platform != 'cygwin' and platform_python_implementation != 'PyPy')", "websockets>=10.4", ] uvicorn-standard = [ - "uvicorn[standard]==0.28.1", + "uvicorn[standard]==0.34.0", ] [project.urls]