mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-25 06:42:52 +08:00
fix(sdk): gracefully handle missing proto stubs in __init__.py
Wrap the sandbox import in try/except so subpackages like openshell.prover can be imported without a full Rust build. Removes the conftest.py namespace hack that was working around this. Signed-off-by: Alexander Watson <zredlined@gmail.com>
This commit is contained in:
@@ -5,18 +5,23 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .sandbox import (
|
||||
ClusterInferenceConfig,
|
||||
ExecChunk,
|
||||
ExecResult,
|
||||
InferenceRouteClient,
|
||||
Sandbox,
|
||||
SandboxClient,
|
||||
SandboxError,
|
||||
SandboxRef,
|
||||
SandboxSession,
|
||||
TlsConfig,
|
||||
)
|
||||
try:
|
||||
from .sandbox import (
|
||||
ClusterInferenceConfig,
|
||||
ExecChunk,
|
||||
ExecResult,
|
||||
InferenceRouteClient,
|
||||
Sandbox,
|
||||
SandboxClient,
|
||||
SandboxError,
|
||||
SandboxRef,
|
||||
SandboxSession,
|
||||
TlsConfig,
|
||||
)
|
||||
except ImportError:
|
||||
# Proto stubs not yet generated (requires Rust build).
|
||||
# Subpackages like openshell.prover can still be imported.
|
||||
pass
|
||||
|
||||
try:
|
||||
from importlib.metadata import version
|
||||
|
||||
Reference in New Issue
Block a user