From 346b12afe9dbeeabf046dc26722ade56f5e0aa8b Mon Sep 17 00:00:00 2001 From: Brendon Smith Date: Fri, 10 Jan 2025 00:01:28 -0500 Subject: [PATCH] Revert "Update to Uvicorn 0.34.0" This reverts commit 3cdf61e338306ebdc65744d915ed86931420d723. After updating from Uvicorn 0.28.1 to Uvicorn >=0.29.0, coverage.py reports that `inboard.gunicorn_workers.UvicornWorker.callback_notify` and the test ASGI app (`tests.test_gunicorn_workers.app`) are not being covered when they actually are covered by the tests. `callback_notify` runs after the Gunicorn server has started up, and the test ASGI app is obviously used (otherwise the tests couldn't pass). Possibly related to the unexpected change in test coverage, coverage.py is generating less coverage files with Uvicorn >=0.29.0. This could suggest that some of the subprocesses used in the tests aren't exiting cleanly or aren't being detected by coverage.py. Signal handling has changed substantially in Uvicorn >=0.29.0, but those changes haven't been tested with the workers because Uvicorn doesn't test its workers, as noted in 35d8d86fef91a9f27eb97932d01addb3aecc66e6. Until the changes to signal handling and test coverage are understood more clearly, Uvicorn will remain on version 0.28.1. --- 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 26e2fc6..6dfd087 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 | PathLike[str] | None + ssl_keyfile: 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 63f1d46..551d5f1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ classifiers = [ ] dependencies = [ "gunicorn==22.0.0", - "uvicorn==0.34.0", + "uvicorn==0.28.1", ] 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.6.3", + "httptools>=0.5.0", "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.34.0", + "uvicorn[standard]==0.28.1", ] [project.urls]