fix(rust): migrate python-config GIL call and cover it in CI

This commit is contained in:
Devin AI 2026-07-13 21:35:14 +00:00
parent cada09b40e
commit 1eb86b68a4
2 changed files with 4 additions and 1 deletions

View file

@ -73,6 +73,9 @@ jobs:
- name: Run Clippy
run: cargo clippy --workspace --all-targets --locked -- -D warnings
- name: Run Clippy (python-config feature)
run: cargo clippy -p litellm-ai-gateway --all-targets --features python-config --locked -- -D warnings
- name: Run Rust tests
run: cargo test --workspace --locked

View file

@ -17,7 +17,7 @@ use crate::gil;
/// Load the router's `model_list` from `config_path` via the Python reader.
pub fn load_router_from_config(config_path: &str) -> CoreResult<Router> {
gil::record_acquisition();
Python::with_gil(|py| {
Python::attach(|py| {
let model_list = py
.import("litellm.proxy.read_model_list")
.and_then(|module| module.getattr("read_model_list"))