From 66ab5c9c7a425ef746725b8a8d7210d434eadac2 Mon Sep 17 00:00:00 2001 From: Xinyuan Tong <115166877+JustinTong0323@users.noreply.github.com> Date: Fri, 12 Jun 2026 07:37:29 +0100 Subject: [PATCH] fix(gateway): make sgl-model-gateway a cargo workspace so maturin 1.14 accepts the parent README (#27997) --- sgl-model-gateway/Cargo.toml | 4 +++ sgl-model-gateway/bindings/python/Cargo.toml | 7 ----- sgl-model-gateway/bindings/python/src/lib.rs | 28 +++++++++++--------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/sgl-model-gateway/Cargo.toml b/sgl-model-gateway/Cargo.toml index 648d647c1..f80276166 100644 --- a/sgl-model-gateway/Cargo.toml +++ b/sgl-model-gateway/Cargo.toml @@ -1,3 +1,7 @@ +[workspace] +members = ["bindings/python"] +exclude = ["bindings/golang", "examples"] + [package] name = "sgl-model-gateway" version = "0.3.2" diff --git a/sgl-model-gateway/bindings/python/Cargo.toml b/sgl-model-gateway/bindings/python/Cargo.toml index 18a8368bd..d4754591a 100644 --- a/sgl-model-gateway/bindings/python/Cargo.toml +++ b/sgl-model-gateway/bindings/python/Cargo.toml @@ -19,10 +19,3 @@ default-features = true [features] default = ["pyo3/extension-module"] vendored-openssl = ["sgl-model-gateway/vendored-openssl"] - -[profile.ci] -inherits = "release" -opt-level = 2 # Lighter optimization (still fast runtime, much faster compile) -lto = "thin" # Thin LTO - good balance -codegen-units = 16 # More parallelization for faster builds -strip = true diff --git a/sgl-model-gateway/bindings/python/src/lib.rs b/sgl-model-gateway/bindings/python/src/lib.rs index f0378fbcd..f18bdf4ec 100644 --- a/sgl-model-gateway/bindings/python/src/lib.rs +++ b/sgl-model-gateway/bindings/python/src/lib.rs @@ -1,7 +1,8 @@ +use std::collections::HashMap; + +use once_cell::sync::OnceCell; use pyo3::prelude::*; use smg::*; -use once_cell::sync::OnceCell; -use std::collections::HashMap; // Define the enums with PyO3 bindings #[pyclass(eq)] @@ -69,7 +70,12 @@ impl PyApiKeyEntry { #[new] #[pyo3(signature = (id, name, key, role = PyRole::User))] fn new(id: String, name: String, key: String, role: PyRole) -> Self { - PyApiKeyEntry { id, name, key, role } + PyApiKeyEntry { + id, + name, + key, + role, + } } } @@ -166,11 +172,7 @@ impl PyControlPlaneAuthConfig { api_keys = vec![], audit_enabled = true, ))] - fn new( - jwt: Option, - api_keys: Vec, - audit_enabled: bool, - ) -> Self { + fn new(jwt: Option, api_keys: Vec, audit_enabled: bool) -> Self { PyControlPlaneAuthConfig { jwt, api_keys, @@ -183,7 +185,11 @@ impl PyControlPlaneAuthConfig { pub fn to_auth_control_plane_config(&self) -> auth::ControlPlaneAuthConfig { auth::ControlPlaneAuthConfig { jwt: self.jwt.as_ref().map(|j| j.to_auth_jwt_config()), - api_keys: self.api_keys.iter().map(|k| k.to_auth_api_key_entry()).collect(), + api_keys: self + .api_keys + .iter() + .map(|k| k.to_auth_api_key_entry()) + .collect(), audit_enabled: self.audit_enabled, } } @@ -576,9 +582,7 @@ impl Router { }; let redis_config = if matches!(self.history_backend, HistoryBackendType::Redis) { - self.redis_config - .as_ref() - .map(|cfg| cfg.to_config_redis()) + self.redis_config.as_ref().map(|cfg| cfg.to_config_redis()) } else { None };