[Fix] CI: fix uv lock resolution and tiktoken test timeout

1. Cap requires-python to <3.14 — no deps ship 3.14 wheels yet, and
   uv's cross-version resolver fails on the Python 3.14 split.
2. Change exclude-newer from relative "30 days" to absolute "2026-04-10"
   so the lockfile stays reproducible. The relative date caused
   cryptography==46.0.7 (published April 8) to fall outside the window.
3. Parametrize test_eager_loading_env_var_values instead of looping —
   with xdist the 6 subprocess cases can run in parallel instead of all
   running sequentially on one worker (~13 min → ~2 min).
   Also removed redundant case variants (Yes/YES/On/ON) that test the
   same str_to_bool code path.
This commit is contained in:
Yuneng Jiang 2026-04-10 22:21:15 -07:00
parent 78c282f400
commit d9a460277a
No known key found for this signature in database
3 changed files with 142 additions and 1269 deletions

View file

@ -3,7 +3,7 @@ name = "litellm"
version = "1.83.6"
description = "Library to easily interface with LLM API providers"
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.9, <3.14"
license = "MIT"
license-files = ["LICENSE"]
authors = [
@ -211,7 +211,7 @@ build-backend = "uv_build"
[tool.uv]
default-groups = ["dev"]
required-version = "==0.10.9"
exclude-newer = "30 days"
exclude-newer = "2026-04-10"
[tool.uv.sources]
litellm-proxy-extras = { workspace = true }

View file

@ -55,23 +55,22 @@ def test_eager_loading_enabled():
assert result.returncode == 0, f"Subprocess failed:\nstdout: {result.stdout}\nstderr: {result.stderr}"
def test_eager_loading_env_var_values():
@pytest.mark.parametrize("value", ["1", "true", "True", "TRUE", "yes", "on"])
def test_eager_loading_env_var_values(value):
"""Test that various env var values enable eager loading"""
values = ["1", "true", "True", "TRUE", "yes", "Yes", "YES", "on", "On", "ON"]
for value in values:
result = _run_python(
"""
import litellm
assert hasattr(litellm, "encoding"), "Encoding should be available"
encoding = litellm.encoding
tokens = encoding.encode("test")
assert len(tokens) > 0
""",
env_override={"LITELLM_DISABLE_LAZY_LOADING": value},
)
assert result.returncode == 0, (
f"Failed for value {value!r}:\nstdout: {result.stdout}\nstderr: {result.stderr}"
)
result = _run_python(
"""
import litellm
assert hasattr(litellm, "encoding"), "Encoding should be available"
encoding = litellm.encoding
tokens = encoding.encode("test")
assert len(tokens) > 0
""",
env_override={"LITELLM_DISABLE_LAZY_LOADING": value},
)
assert result.returncode == 0, (
f"Failed for value {value!r}:\nstdout: {result.stdout}\nstderr: {result.stderr}"
)
def test_lazy_loading_default():

1376
uv.lock generated

File diff suppressed because it is too large Load diff