From 5211c730177544c1b9247114d7edf3a76fe17a44 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Fri, 3 Jul 2026 19:03:14 -0700 Subject: [PATCH] build: restore maturin backend to bundle the Rust bridge in the wheel Re-apply the maturin build backend (reverting #31470, which had temporarily restored the pure-Python uv_build backend). maturin packages the Rust bridge (litellm.rust_bridge._native) into the wheel; the loader already falls back gracefully when the native module is absent, so pure-Python installs are unaffected. The earlier revert was needed because the release pipeline emitted a bare cp312 linux_x86_64 wheel that PyPI rejects. That is resolved on the pipeline side: it now branches on the build backend and, for maturin, builds proper manylinux_2_28 wheels (x86_64 + aarch64) and validates each wheel carries the native module. The [tool.maturin] include for litellm/proxy/_experimental/out/** is sdist coverage for the Admin UI bundle. maturin's include overrides .gitignore for the sdist but not the wheel; the committed bundle stays tracked and un-ignored, so it flows into both the wheel (maturin's source walk) and the sdist as-is. Coordinates with the release pipeline change that builds the Admin UI from source and gates the built wheel/sdist on the bundle being present; that should land first so the pipeline can build and verify a maturin UI wheel. --- pyproject.toml | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b5a62e550dbe..c2d8b3f7d549 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -234,8 +234,25 @@ healthcheck = [ ] [build-system] -requires = ["uv_build==0.11.8"] -build-backend = "uv_build" +requires = ["maturin==1.9.4"] +build-backend = "maturin" + +[tool.maturin] +manifest-path = "litellm-rust/crates/python-bridge/Cargo.toml" +module-name = "litellm.rust_bridge._native" +python-source = "." +bindings = "pyo3" +include = ["litellm/proxy/_experimental/out/**"] +exclude = [ + "litellm/proxy/enterprise", + "litellm/proxy/enterprise/**", + "**/__pycache__", + "**/__pycache__/**", + "**/.pytest_cache", + "**/.pytest_cache/**", + "**/.ruff_cache", + "**/.ruff_cache/**", +] [tool.uv] constraint-dependencies = [ @@ -258,18 +275,6 @@ litellm-enterprise = { workspace = true } [tool.uv.workspace] members = ["enterprise", "litellm-proxy-extras"] -[tool.uv.build-backend] -module-root = "" -source-exclude = [ - "litellm/proxy/enterprise", - "**/__pycache__", - "**/__pycache__/**", - "**/.pytest_cache", - "**/.pytest_cache/**", - "**/.ruff_cache", - "**/.ruff_cache/**", -] - [tool.isort] profile = "black"