From 656e1084e20a528950c71f52c469cd106f66afb9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 17 May 2024 16:47:21 +0000 Subject: [PATCH] Chore: pre-commit autoupdate --- .gitignore | 1 - src/middleware.py | 13 ++++++++----- src/server.py | 2 -- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index e3e01f2..de68e60 100644 --- a/.gitignore +++ b/.gitignore @@ -230,4 +230,3 @@ test/.DS_Store # Cython debug symbols cython_debug/ - diff --git a/src/middleware.py b/src/middleware.py index 8792e2b..4305086 100644 --- a/src/middleware.py +++ b/src/middleware.py @@ -1,8 +1,9 @@ -import logging -from fastapi import Request, Response, Depends import base64 +import logging + +from fastapi import Depends, Request, Response from starlette.middleware.base import BaseHTTPMiddleware -from starlette.responses import JSONResponse, StreamingResponse, PlainTextResponse +from starlette.responses import JSONResponse, PlainTextResponse, StreamingResponse import state @@ -66,9 +67,11 @@ async def dispatch(self, request: Request, call_next): return response -from starlette.types import Send, Message import asyncio +from starlette.types import Message, Send + + class LoggingStreamingResponse(StreamingResponse): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -91,4 +94,4 @@ async def stream_response(self, send: Send): @property def body(self): - return b"".join(self.body_chunks).decode("utf-8") \ No newline at end of file + return b"".join(self.body_chunks).decode("utf-8") diff --git a/src/server.py b/src/server.py index eb8e6d9..79433a6 100644 --- a/src/server.py +++ b/src/server.py @@ -19,10 +19,8 @@ # Project imports import utilities -import state from middleware import LoggingMiddleware - # Set up logging LOGGING_FORMAT = \ "%(asctime)s - %(module)s:%(funcName)s %(levelname)s - %(message)s"