fix(gateway): make sgl-model-gateway a cargo workspace so maturin 1.14 accepts the parent README (#27997)

This commit is contained in:
Xinyuan Tong
2026-06-11 23:37:29 -07:00
committed by GitHub
parent fe887e6935
commit 66ab5c9c7a
3 changed files with 20 additions and 19 deletions
+4
View File
@@ -1,3 +1,7 @@
[workspace]
members = ["bindings/python"]
exclude = ["bindings/golang", "examples"]
[package]
name = "sgl-model-gateway"
version = "0.3.2"
@@ -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
+16 -12
View File
@@ -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<PyJwtConfig>,
api_keys: Vec<PyApiKeyEntry>,
audit_enabled: bool,
) -> Self {
fn new(jwt: Option<PyJwtConfig>, api_keys: Vec<PyApiKeyEntry>, 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
};