fastapi-reloader 1.2__tar.gz → 1.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fastapi_reloader-1.2 → fastapi_reloader-1.2.1}/PKG-INFO +1 -1
- {fastapi_reloader-1.2 → fastapi_reloader-1.2.1}/fastapi_reloader/patcher.py +7 -1
- {fastapi_reloader-1.2 → fastapi_reloader-1.2.1}/pyproject.toml +1 -1
- {fastapi_reloader-1.2 → fastapi_reloader-1.2.1}/README.md +0 -0
- {fastapi_reloader-1.2 → fastapi_reloader-1.2.1}/fastapi_reloader/__init__.py +0 -0
- {fastapi_reloader-1.2 → fastapi_reloader-1.2.1}/fastapi_reloader/core.py +0 -0
- {fastapi_reloader-1.2 → fastapi_reloader-1.2.1}/fastapi_reloader/runtime.js +0 -0
@@ -1,4 +1,5 @@
|
|
1
1
|
from collections.abc import Awaitable, Callable
|
2
|
+
from contextlib import asynccontextmanager
|
2
3
|
from math import inf
|
3
4
|
from typing import TypeGuard
|
4
5
|
|
@@ -18,7 +19,12 @@ def is_streaming_response(response: Response) -> TypeGuard[StreamingResponse]:
|
|
18
19
|
|
19
20
|
|
20
21
|
def patch_for_auto_reloading(app: ASGIApp):
|
21
|
-
|
22
|
+
@asynccontextmanager
|
23
|
+
async def lifespan(_):
|
24
|
+
async with LifespanManager(app, inf, inf):
|
25
|
+
yield
|
26
|
+
|
27
|
+
new_app = FastAPI(openapi_url=None, lifespan=lifespan)
|
22
28
|
new_app.include_router(reload_router)
|
23
29
|
new_app.mount("/", app)
|
24
30
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|