mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-30 01:52:18 +00:00
* ci: cut CircleCI wall time without loosening test isolation * fix(ci): parse integration split files that follow --results The CircleCI machine image ships Python 3.12.2, whose argparse leaves the files positional empty when it follows an option and another positional, so every extensions node exited with 'unrecognized arguments'. Reproduced on 3.12.2; parse_intermixed_args selects the files on 3.12.2, 3.12.13 and 3.13 * test(ci): resolve command references in the Rust toolchain guard The Windows rustup install moved into the install_windows_toolchain command, which the guard only recognized for install_rust. It now accepts any command that installs a pinned rustup and reads the Windows toolchain pin from it * ci: cache the Windows release cargo build from main windows_release_wheel rebuilt every dependency with fat LTO on each run. It now restores the release target and cargo registry saved by main's scheduled run, drops the workspace crates' fingerprints so they always rebuild from the checked-out source, and still runs the full LTO link * ci: run the Windows release wheel build on windows.xlarge The fat-LTO release build is the slowest job in the pipeline; more cores speed up the dependency compile ahead of the final link * ci: skip the Windows fingerprint cleanup when the cargo cache missed On a cold cache the release fingerprint directory does not exist, and the CircleCI PowerShell wrapper failed the step on the suppressed not-found error
58 lines
1.6 KiB
Python
58 lines
1.6 KiB
Python
import zipfile
|
|
|
|
from check_windows_wheel_install import (
|
|
MAX_PATH,
|
|
WORST_CASE_PREFIX,
|
|
main,
|
|
overlong_install_paths,
|
|
)
|
|
|
|
|
|
def _wheel(tmp_path, *entry_names):
|
|
path = tmp_path / "pkg.whl"
|
|
with zipfile.ZipFile(path, "w") as zf:
|
|
for name in entry_names:
|
|
zf.writestr(name, "{}")
|
|
return str(path)
|
|
|
|
|
|
def test_flags_entry_one_char_over_budget(tmp_path):
|
|
busts = "a" * (MAX_PATH - WORST_CASE_PREFIX + 1)
|
|
assert overlong_install_paths(_wheel(tmp_path, busts)) == [busts]
|
|
|
|
|
|
def test_allows_entry_exactly_at_budget(tmp_path):
|
|
at_limit = "a" * (MAX_PATH - WORST_CASE_PREFIX)
|
|
assert (
|
|
overlong_install_paths(_wheel(tmp_path, at_limit, "litellm/__init__.py")) == []
|
|
)
|
|
|
|
|
|
def test_orders_offenders_longest_first(tmp_path):
|
|
longer = "a" * (MAX_PATH - WORST_CASE_PREFIX + 5)
|
|
shorter = "b" * (MAX_PATH - WORST_CASE_PREFIX + 1)
|
|
assert overlong_install_paths(_wheel(tmp_path, shorter, longer)) == [
|
|
longer,
|
|
shorter,
|
|
]
|
|
|
|
|
|
def _dist_with(tmp_path, *entry_names):
|
|
dist = tmp_path / "dist"
|
|
dist.mkdir()
|
|
with zipfile.ZipFile(dist / "litellm-0-py3-none-any.whl", "w") as zf:
|
|
for name in entry_names:
|
|
zf.writestr(name, "{}")
|
|
|
|
|
|
def test_lengths_only_passes_without_installing(tmp_path, monkeypatch):
|
|
_dist_with(tmp_path, "litellm/__init__.py")
|
|
monkeypatch.chdir(tmp_path)
|
|
monkeypatch.setenv("PATH", "")
|
|
assert main(["--lengths-only"]) == 0
|
|
|
|
|
|
def test_lengths_only_fails_on_an_overlong_path(tmp_path, monkeypatch):
|
|
_dist_with(tmp_path, "a" * (MAX_PATH - WORST_CASE_PREFIX + 1))
|
|
monkeypatch.chdir(tmp_path)
|
|
assert main(["--lengths-only"]) == 1
|