diff --git a/src/framex/driver/application.py b/src/framex/driver/application.py index 3416c04..95573c0 100644 --- a/src/framex/driver/application.py +++ b/src/framex/driver/application.py @@ -1,6 +1,7 @@ """Module containing FastAPI instance related functions and classes.""" import json +import os from collections.abc import Callable from contextlib import asynccontextmanager from datetime import UTC, datetime @@ -27,6 +28,7 @@ FRAME_START_TIME = datetime.now(tz=UTC) SHANGHAI_TZ = ZoneInfo("Asia/Shanghai") +REVERSION = settings.server.reversion or os.getenv("REVERSION") def build_openapi_description() -> str: @@ -42,7 +44,7 @@ def build_openapi_description() -> str: |--------|-------| | Started At | `{started_at}` | | Uptime | `{uptime}` | -| Service-Version | `v{settings.server.reversion}` | +| Service-Version | `v{REVERSION}` | | FrameX-Version | `v{VERSION}` | --- diff --git a/src/framex/plugin/on.py b/src/framex/plugin/on.py index 09df20c..cb874a5 100644 --- a/src/framex/plugin/on.py +++ b/src/framex/plugin/on.py @@ -37,7 +37,7 @@ def decorator(cls: type) -> type: params = extract_method_params(func) version: str = plugin.module.__plugin_meta__.version - version = f"v{version}" if version.startswith("v") else version + version = f"v{version}" if not version.startswith("v") else version plugin_apis.append( PluginApi( api=path,