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:
Alexander Watson
2026-03-31 08:58:08 -07:00
parent 68715f9033
commit 560365cc3b
2 changed files with 17 additions and 32 deletions
+17 -12
View File
@@ -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