mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
fix(lint): document PLC0415 suppressions on new mcp_server_manager imports
The local imports added in #32302 to invalidate the per-user OAuth token cache were suppressed with a bare `# noqa: PLC0415`, no reason. That tripped LIT003 in scripts/check_type_discipline.py and put the total at 295 vs the budget of 292, so 'promote internal staging to main' PRs fail the type-discipline gate. Annotate each of the three imports with why the local import is required (breaking the circular import between mcp_server_manager and its callers) so the gate returns to 292. Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
This commit is contained in:
parent
1d9a86eac4
commit
468b54fc67
2 changed files with 3 additions and 3 deletions
|
|
@ -448,7 +448,7 @@ async def _store_per_user_token_server_side(
|
|||
)
|
||||
return # Don't warm Redis if DB write failed
|
||||
|
||||
from litellm.proxy._experimental.mcp_server.mcp_server_manager import ( # noqa: PLC0415
|
||||
from litellm.proxy._experimental.mcp_server.mcp_server_manager import ( # noqa: PLC0415 # local import to break mcp_server_manager <-> discoverable_endpoints cycle
|
||||
global_mcp_server_manager,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1913,7 +1913,7 @@ if MCP_AVAILABLE:
|
|||
expires_in=payload.expires_in,
|
||||
scopes=payload.scopes,
|
||||
)
|
||||
from litellm.proxy._experimental.mcp_server.mcp_server_manager import ( # noqa: PLC0415
|
||||
from litellm.proxy._experimental.mcp_server.mcp_server_manager import ( # noqa: PLC0415 # local import to break mcp_server_manager <-> management endpoints cycle
|
||||
global_mcp_server_manager,
|
||||
)
|
||||
|
||||
|
|
@ -1958,7 +1958,7 @@ if MCP_AVAILABLE:
|
|||
await delete_user_credential(prisma_client, user_id, server_id)
|
||||
except RecordNotFoundError:
|
||||
pass # Already gone — treat as a successful delete
|
||||
from litellm.proxy._experimental.mcp_server.mcp_server_manager import ( # noqa: PLC0415
|
||||
from litellm.proxy._experimental.mcp_server.mcp_server_manager import ( # noqa: PLC0415 # local import to break mcp_server_manager <-> management endpoints cycle
|
||||
global_mcp_server_manager,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue