From e4de5c5ad1db03fb7077ae3c58c17d0fc23d9f7a Mon Sep 17 00:00:00 2001 From: Shamil Date: Tue, 24 Mar 2026 23:41:26 +0300 Subject: [PATCH] refac (#22987) --- backend/open_webui/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/open_webui/__init__.py b/backend/open_webui/__init__.py index acb70e17e2..be25227d36 100644 --- a/backend/open_webui/__init__.py +++ b/backend/open_webui/__init__.py @@ -2,18 +2,17 @@ import base64 import os import random from pathlib import Path +from typing import Annotated import typer import uvicorn -from typing import Optional -from typing_extensions import Annotated app = typer.Typer() KEY_FILE = Path.cwd() / '.webui_secret_key' -def version_callback(value: bool): +def version_callback(value: bool) -> None: if value: from open_webui.env import VERSION @@ -23,7 +22,7 @@ def version_callback(value: bool): @app.command() def main( - version: Annotated[Optional[bool], typer.Option('--version', callback=version_callback)] = None, + version: Annotated[bool | None, typer.Option('--version', callback=version_callback)] = None, ): pass @@ -66,7 +65,7 @@ def serve( os.environ['USE_CUDA_DOCKER'] = 'false' os.environ['LD_LIBRARY_PATH'] = ':'.join(LD_LIBRARY_PATH) - import open_webui.main # we need set environment variables before importing main + import open_webui.main # noqa: F401 from open_webui.env import UVICORN_WORKERS # Import the workers setting uvicorn.run(