[Fix] Proxy: resolve CI fallout from projects migration

- workflow proxy-config matrix: drop test_project*.py glob now that the
  test lives under tests/enterprise/
- update uv.lock to match bumped litellm version
- fix mypy: loosen FieldInfo annotation on register_extra_ui_setting
  (pydantic.Field stubs report the default's type) and silence
  create_model overload resolution when passing **tuple_dict
- fix inline imports in moved test_project_endpoints_prisma.py to
  target litellm_enterprise.proxy.management_endpoints.project_endpoints
This commit is contained in:
Yuneng Jiang 2026-04-13 21:49:30 -07:00
parent d3a1f63af2
commit 084dc710b5
No known key found for this signature in database
4 changed files with 19 additions and 14 deletions

View file

@ -24,7 +24,7 @@ jobs:
- name: "key-generation"
path: "tests/proxy_unit_tests/test_[k-o]*.py"
- name: "proxy-config"
path: "tests/proxy_unit_tests/test_prisma*.py tests/proxy_unit_tests/test_project*.py tests/proxy_unit_tests/test_prompt*.py tests/proxy_unit_tests/test_proxy_[c-r]*.py"
path: "tests/proxy_unit_tests/test_prisma*.py tests/proxy_unit_tests/test_prompt*.py tests/proxy_unit_tests/test_proxy_[c-r]*.py"
- name: "proxy-server"
path: "tests/proxy_unit_tests/test_proxy_server.py"
- name: "proxy-server-extras"

View file

@ -180,8 +180,13 @@ _EXTRA_UI_SETTINGS_FIELDS: Dict[str, tuple] = {}
_ENTERPRISE_ONLY_UI_SETTINGS: set[str] = {"enable_projects_ui"}
def register_extra_ui_setting(name: str, type_: Any, field: FieldInfo) -> None:
"""Register an additional UI settings field contributed by an extension package."""
def register_extra_ui_setting(name: str, type_: Any, field: Any) -> None:
"""Register an additional UI settings field contributed by an extension package.
``field`` should be a pydantic ``Field(...)`` result (``FieldInfo`` at
runtime); typed as ``Any`` because pydantic's ``Field`` stub reports the
default value's type instead of ``FieldInfo``.
"""
_EXTRA_UI_SETTINGS_FIELDS[name] = (type_, field)
ALLOWED_UI_SETTINGS_FIELDS.add(name)
@ -190,7 +195,7 @@ def _get_effective_ui_settings_class() -> type:
"""Return UISettings with any extension-registered fields merged in."""
if not _EXTRA_UI_SETTINGS_FIELDS:
return UISettings
return create_model(
return create_model( # type: ignore[call-overload]
"EffectiveUISettings",
__base__=UISettings,
**_EXTRA_UI_SETTINGS_FIELDS,

View file

@ -432,7 +432,7 @@ def test_check_team_project_limits_models_not_in_team():
"""
Test that creating a project with models not in the team raises an error.
"""
from litellm.proxy.management_endpoints.project_endpoints import (
from litellm_enterprise.proxy.management_endpoints.project_endpoints import (
_check_team_project_limits,
)
from litellm.proxy._types import LiteLLM_TeamTable
@ -458,7 +458,7 @@ def test_check_team_project_limits_budget_exceeds_team():
"""
Test that creating a project with budget > team budget raises an error.
"""
from litellm.proxy.management_endpoints.project_endpoints import (
from litellm_enterprise.proxy.management_endpoints.project_endpoints import (
_check_team_project_limits,
)
from litellm.proxy._types import LiteLLM_TeamTable
@ -485,7 +485,7 @@ def test_check_team_project_limits_valid_subset():
"""
Test that a valid project (models subset, budget within limit) passes.
"""
from litellm.proxy.management_endpoints.project_endpoints import (
from litellm_enterprise.proxy.management_endpoints.project_endpoints import (
_check_team_project_limits,
)
from litellm.proxy._types import LiteLLM_TeamTable
@ -510,7 +510,7 @@ def test_check_team_project_limits_all_proxy_models():
"""
Test that team with 'all-proxy-models' allows any project models.
"""
from litellm.proxy.management_endpoints.project_endpoints import (
from litellm_enterprise.proxy.management_endpoints.project_endpoints import (
_check_team_project_limits,
)
from litellm.proxy._types import LiteLLM_TeamTable
@ -533,7 +533,7 @@ def test_check_team_project_limits_tpm_exceeds_team():
"""
Test that project tpm_limit exceeding team tpm_limit raises an error.
"""
from litellm.proxy.management_endpoints.project_endpoints import (
from litellm_enterprise.proxy.management_endpoints.project_endpoints import (
_check_team_project_limits,
)
from litellm.proxy._types import LiteLLM_TeamTable
@ -560,7 +560,7 @@ def test_check_team_project_limits_negative_budget():
"""
Test that negative budget values raise an error.
"""
from litellm.proxy.management_endpoints.project_endpoints import (
from litellm_enterprise.proxy.management_endpoints.project_endpoints import (
_check_team_project_limits,
)
from litellm.proxy._types import LiteLLM_TeamTable
@ -586,7 +586,7 @@ def test_check_team_project_limits_soft_budget_gte_max():
"""
Test that soft_budget >= max_budget raises an error.
"""
from litellm.proxy.management_endpoints.project_endpoints import (
from litellm_enterprise.proxy.management_endpoints.project_endpoints import (
_check_team_project_limits,
)
from litellm.proxy._types import LiteLLM_TeamTable
@ -801,7 +801,7 @@ async def test_list_projects_returns_timestamps():
from datetime import datetime, timezone
from unittest.mock import AsyncMock, MagicMock, patch
from litellm.proxy.management_endpoints.project_endpoints import list_projects
from litellm_enterprise.proxy.management_endpoints.project_endpoints import list_projects
from litellm.proxy._types import LiteLLM_ProjectTable
now = datetime(2024, 1, 15, 12, 0, 0, tzinfo=timezone.utc)

4
uv.lock generated
View file

@ -11,7 +11,7 @@ resolution-markers = [
]
[options]
exclude-newer = "2026-04-08T16:01:27.663665Z"
exclude-newer = "2026-04-11T04:48:04.282864Z"
exclude-newer-span = "P3D"
[manifest]
@ -3602,7 +3602,7 @@ wheels = [
[[package]]
name = "litellm"
version = "1.83.6"
version = "1.83.7"
source = { editable = "." }
dependencies = [
{ name = "aiohttp" },