From 03e6dd051cdc2d4fc307783b3a11ab618bc70216 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 14 Sep 2026 06:59:10 +0000 Subject: [PATCH 1/3] fix(cli): drop enum.StrEnum so the CLI imports on Python 3.10 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/proxy/client/cli/commands/pi.py | 4 ++-- tests/test_litellm/proxy/client/cli/test_pi.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/client/cli/commands/pi.py b/litellm/proxy/client/cli/commands/pi.py index 9810e81ae36..5c749959638 100644 --- a/litellm/proxy/client/cli/commands/pi.py +++ b/litellm/proxy/client/cli/commands/pi.py @@ -10,7 +10,7 @@ import os import tempfile from collections.abc import Callable, Mapping from dataclasses import dataclass -from enum import StrEnum +from enum import Enum from pathlib import Path from types import MappingProxyType from typing import Annotated, Final @@ -25,7 +25,7 @@ LITELLM_PROXY_API_KEY_ENV: Final = "LITELLM_PROXY_API_KEY" _REJECTED_STATUSES: Final = frozenset((401, 403)) -class ListingFailure(StrEnum): +class ListingFailure(str, Enum): """Why a proxy could not be listed, decided once where the HTTP outcome is classified. `unreachable` means no response at all; the other kinds prove the proxy answered, so callers diff --git a/tests/test_litellm/proxy/client/cli/test_pi.py b/tests/test_litellm/proxy/client/cli/test_pi.py index 03e5d7dd197..3c343c9e268 100644 --- a/tests/test_litellm/proxy/client/cli/test_pi.py +++ b/tests/test_litellm/proxy/client/cli/test_pi.py @@ -1,3 +1,4 @@ +import inspect import json import os import stat @@ -7,6 +8,7 @@ from pathlib import Path import pytest import requests +from litellm.proxy.client.cli.commands import pi from litellm.proxy.client.cli.commands.pi import ( ListingFailure, ModelLimits, @@ -20,6 +22,18 @@ from litellm.proxy.client.cli.commands.pi import ( ) +def test_pi_module_has_no_strenum_import(): + """enum.StrEnum is Python 3.11+; pyproject allows 3.10, so pi.py must not import it.""" + assert "StrEnum" not in inspect.getsource(pi) + + +def test_listing_failure_is_str_enum(): + assert issubclass(ListingFailure, str) + assert ListingFailure.REJECTED.value == "rejected" + assert ListingFailure("rejected") is ListingFailure.REJECTED + assert str(ListingFailure.REJECTED.value) == "rejected" + + class _FakeResponse: def __init__(self, status_code, payload=None): self.status_code = status_code From 0679d799d483dabe74887a6a54b25b737676af8f Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 14 Sep 2026 07:07:06 +0000 Subject: [PATCH 2/3] ci: exercise the lite CLI on the Python 3.10 import smoke job Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .github/workflows/test-code-quality.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-code-quality.yml b/.github/workflows/test-code-quality.yml index 9c7e0db7065..987f66773f2 100644 --- a/.github/workflows/test-code-quality.yml +++ b/.github/workflows/test-code-quality.yml @@ -178,7 +178,7 @@ jobs: version: "0.10.9" - name: Install dependencies - run: uv sync --frozen --extra proxy --python 3.10 + run: uv sync --frozen --extra proxy --extra cli --python 3.10 - run: uv run --no-sync python --version @@ -187,3 +187,6 @@ jobs: - name: Check litellm CLI run: uv run --no-sync litellm --version + + - name: Check lite CLI + run: uv run --no-sync lite version From 19c43eb875944e326d3c98743f4bcd0835298761 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 14 Sep 2026 07:08:24 +0000 Subject: [PATCH 3/3] test(cli): drop structural StrEnum source check; smoke job covers the 3.10 import Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- tests/test_litellm/proxy/client/cli/test_pi.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/test_litellm/proxy/client/cli/test_pi.py b/tests/test_litellm/proxy/client/cli/test_pi.py index 3c343c9e268..6bb49566580 100644 --- a/tests/test_litellm/proxy/client/cli/test_pi.py +++ b/tests/test_litellm/proxy/client/cli/test_pi.py @@ -1,4 +1,3 @@ -import inspect import json import os import stat @@ -8,7 +7,6 @@ from pathlib import Path import pytest import requests -from litellm.proxy.client.cli.commands import pi from litellm.proxy.client.cli.commands.pi import ( ListingFailure, ModelLimits, @@ -22,11 +20,6 @@ from litellm.proxy.client.cli.commands.pi import ( ) -def test_pi_module_has_no_strenum_import(): - """enum.StrEnum is Python 3.11+; pyproject allows 3.10, so pi.py must not import it.""" - assert "StrEnum" not in inspect.getsource(pi) - - def test_listing_failure_is_str_enum(): assert issubclass(ListingFailure, str) assert ListingFailure.REJECTED.value == "rejected"