chore(release): v2.0.0 —— Python 版版本号与 README 对齐
- pyproject/app.__init__/OpenAPI 统一 2.0.0(main.py 改为读取 __version__) - README 切换为 v2.0(Python)说明:uv 快速开始、app/ 结构、音源加载未移植、已知限制更新
This commit is contained in:
1 parent
dfc06bf4de
commit
e168f43b81
5 files changed
+64
-71
No files matched your search
+3
-3
@@ -22,7 +22,7 @@ from fastapi.exceptions import RequestValidationError
|
||||
from fastapi.responses import HTMLResponse, JSONResponse, RedirectResponse
|
||||
from starlette.exceptions import HTTPException as StarletteHTTPException
|
||||
|
||||
from app import config
|
||||
from app import __version__, config
|
||||
from app.http.api_error import ApiError
|
||||
from app.http.auth_gate import auth_gate
|
||||
from app.http.rate_limit import make_rate_limiter
|
||||
@@ -71,7 +71,7 @@ def create_app() -> FastAPI:
|
||||
app = FastAPI(
|
||||
title=API_TITLE,
|
||||
description=API_DESCRIPTION,
|
||||
version="1.0.0",
|
||||
version=__version__,
|
||||
lifespan=_lifespan,
|
||||
openapi_url="/openapi.json",
|
||||
docs_url="/docs",
|
||||
@@ -186,7 +186,7 @@ def _install_openapi(app: FastAPI) -> None:
|
||||
def custom_openapi():
|
||||
if app.openapi_schema:
|
||||
return app.openapi_schema
|
||||
schema = get_openapi(title=API_TITLE, version="1.0.0", description=API_DESCRIPTION, routes=app.routes)
|
||||
schema = get_openapi(title=API_TITLE, version=__version__, description=API_DESCRIPTION, routes=app.routes)
|
||||
components = schema.setdefault("components", {}).setdefault("schemas", {})
|
||||
for name, definition in COMPONENT_SCHEMAS.items():
|
||||
components.setdefault(name, definition)
|
||||
|
||||
Reference in new issue
Block a user