Build Rust extensions on demand in source checkouts (#34994)
This commit is contained in:
@@ -8,7 +8,7 @@ license.workspace = true
|
||||
# Consumed by python/setup.py: registers this crate as a PyO3 extension module
|
||||
# of the main sglang wheel at the given import path.
|
||||
[package.metadata.sglang]
|
||||
python-module = "sglang.srt.grpc._core"
|
||||
python-module = "sglang.srt.rust_extensions._grpc"
|
||||
# Always build optimized, even for an editable install.
|
||||
debug = false
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Standalone dev builds only (`maturin build` / `maturin develop`); the
|
||||
# extension ships to users inside the main sglang wheel via setuptools-rust
|
||||
# (python/pyproject.toml, target sglang.srt.grpc._core). Requires a repo
|
||||
# checkout (build.rs reads ../../proto), so this is not publishable as an
|
||||
# (python/pyproject.toml, target sglang.srt.rust_extensions._grpc). Requires a
|
||||
# repo checkout (build.rs reads ../../proto), so this is not publishable as an
|
||||
# sdist. protoc is not required: build.rs falls back to a vendored binary.
|
||||
[build-system]
|
||||
requires = ["maturin>=1.5,<2"]
|
||||
@@ -14,4 +14,4 @@ description = "In-process Rust gRPC server for SGLang"
|
||||
requires-python = ">=3.10"
|
||||
|
||||
[tool.maturin]
|
||||
module-name = "_core"
|
||||
module-name = "_grpc"
|
||||
|
||||
@@ -257,7 +257,7 @@ fn start_server(
|
||||
}
|
||||
|
||||
#[pymodule]
|
||||
fn _core(m: &Bound<'_, PyModule>) -> PyResult<()> {
|
||||
fn _grpc(m: &Bound<'_, PyModule>) -> PyResult<()> {
|
||||
m.add_function(wrap_pyfunction!(start_server, m)?)?;
|
||||
m.add_class::<GrpcServerHandle>()?;
|
||||
m.add_class::<ChunkSendStatus>()?;
|
||||
|
||||
Reference in New Issue
Block a user