solari-e2b-compat 0.2.5__tar.gz → 0.2.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/.gitignore +1 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/COMPAT.md +5 -2
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/PKG-INFO +2 -2
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/README.md +1 -1
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/pyproject.toml +1 -1
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/__init__.py +1 -1
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/_sandbox.py +11 -3
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/code_interpreter/__init__.py +2 -2
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/LICENSE +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/LICENSE-E2B +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/NOTICE +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/_box.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/_commands.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/_config.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/_filesystem.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/_git.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/_loop.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/_redact.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/_request.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/_sync.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/_template.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/_vendor_user.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/_volume.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/code_interpreter/charts.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/code_interpreter/client.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/code_interpreter/code_interpreter_async.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/code_interpreter/code_interpreter_sync.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/code_interpreter/constants.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/code_interpreter/exceptions.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/code_interpreter/models.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/exceptions.py +0 -0
- {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/models.py +0 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
# COMPAT.md: E2B Python SDK compatibility (
|
|
1
|
+
# COMPAT.md: E2B Python SDK compatibility (API shapes follow e2b 2.59 and e2b-code-interpreter 2.11)
|
|
2
|
+
|
|
3
|
+
Checked against the current releases (e2b 2.63.0, e2b-code-interpreter 2.11.9) on 2026-11-07: the only public name this package lacks is the `GuestUnresponsiveException` class (and the `WriteData` type alias).
|
|
2
4
|
|
|
3
5
|
Legend: **OK** works and is tested; **DIFF** works with a behaviour difference (explained); **NO** raises
|
|
4
6
|
`SolariCompatUnsupported` naming the feature. "Live" means `tests/test_live_staging.py` runs it against staging.
|
|
@@ -78,6 +80,7 @@ and the differences that are specific to Python.
|
|
|
78
80
|
| `exists`, `make_dir`, `rename`, `remove` | OK, live | |
|
|
79
81
|
| `watch_dir(path, on_event, recursive=)` | DIFF, live | `FilesystemEvent.name` is relative to the watched path. Solari reports creates as `write`. `include_entry=True` adds the entry (best effort: none when the path is already gone). `allow_network_mounts` has no effect (Solari's watcher has no such limit). A watch ends after `timeout` seconds (default 60; 0 disables); `on_exit(None)` is called once, whether it timed out or you called `stop()`. |
|
|
80
82
|
| `user=` on any filesystem call | NO | |
|
|
83
|
+
| Which paths `files.*` can reach | OK, live | Every filesystem call runs as the sandbox user (`user`, or the Daytona/Runloop name), as in E2B: relative paths resolve against `/home/user`, `files.read('/etc/shadow')` and `files.write('/etc/x', ...)` are refused with the guest's `permission denied`, and what you write is owned by `user:user`. This needs a guest image that carries the fix (images built before it keep the old behaviour: `files.*` then ran as root and reached any path); `whoami` and `files.read('/etc/shadow')` tell you which you have. The `user` option on a filesystem call is still NO. |
|
|
81
84
|
|
|
82
85
|
## Code interpreter (`solari_e2b.code_interpreter`)
|
|
83
86
|
| Call | Status | Notes |
|
|
@@ -92,7 +95,7 @@ and the differences that are specific to Python.
|
|
|
92
95
|
| `timeout=` | DIFF | Stops waiting and raises `TimeoutException`; the kernel keeps running the code. No default timeout (E2B's is 300 s). |
|
|
93
96
|
| `create_code_context(cwd, language)` | OK, live | Python only. |
|
|
94
97
|
| `list_code_contexts`, `remove_code_context`, `restart_code_context` | DIFF, live | Solari cannot list or destroy kernels. `list` returns contexts created by this process; `remove` forgets the context (the kernel stays until the sandbox ends); `restart` clears the context's variables and working directory without restarting the process. |
|
|
95
|
-
| Default template | DIFF | `code-interpreter-v2` is built into your org on first `Sandbox.create()` without a template: about
|
|
98
|
+
| Default template | DIFF | `code-interpreter-v2` is built into your org on first `Sandbox.create()` without a template: about 90 seconds (two timed builds on 2026-11-07 took 92 s and 95 s), billed as a template build, and two processes that both find it missing each start a build. `build_code_interpreter_template()` (async) / `build_code_interpreter_template_sync()` prebuild it. |
|
|
96
99
|
|
|
97
100
|
## Templates
|
|
98
101
|
| Call | Status | Notes |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: solari-e2b-compat
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.7
|
|
4
4
|
Summary: E2B-compatible Python interface (sandboxes and code interpreter) over Solari Sandboxes. Not affiliated with E2B.
|
|
5
5
|
Project-URL: Homepage, https://getsolari.com
|
|
6
6
|
Author: Solari
|
|
@@ -66,7 +66,7 @@ An E2B key does not work here: use a Solari API key.
|
|
|
66
66
|
|
|
67
67
|
`e2b_code_interpreter` runs in a template with a data-analysis stack (pandas, numpy, scipy, scikit-learn, seaborn,
|
|
68
68
|
plotly, ...). Solari builds the equivalent, `code-interpreter-v2`, into your org the first time `Sandbox.create()` is
|
|
69
|
-
called without a template (about
|
|
69
|
+
called without a template (about 90 seconds, once). To do it ahead of time:
|
|
70
70
|
|
|
71
71
|
```python
|
|
72
72
|
from solari_e2b.code_interpreter import build_code_interpreter_template_sync
|
|
@@ -47,7 +47,7 @@ An E2B key does not work here: use a Solari API key.
|
|
|
47
47
|
|
|
48
48
|
`e2b_code_interpreter` runs in a template with a data-analysis stack (pandas, numpy, scipy, scikit-learn, seaborn,
|
|
49
49
|
plotly, ...). Solari builds the equivalent, `code-interpreter-v2`, into your org the first time `Sandbox.create()` is
|
|
50
|
-
called without a template (about
|
|
50
|
+
called without a template (about 90 seconds, once). To do it ahead of time:
|
|
51
51
|
|
|
52
52
|
```python
|
|
53
53
|
from solari_e2b.code_interpreter import build_code_interpreter_template_sync
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "solari-e2b-compat"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.7"
|
|
8
8
|
description = "E2B-compatible Python interface (sandboxes and code interpreter) over Solari Sandboxes. Not affiliated with E2B."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -640,11 +640,19 @@ class AsyncSandbox:
|
|
|
640
640
|
raise t from e
|
|
641
641
|
|
|
642
642
|
@_hybrid
|
|
643
|
-
async def fork(self, timeout: Optional[int] = None, count: Optional[int] = None, *, logger: Any = None, **opts: Any) -> List[Any]:
|
|
644
|
-
"""Copy a running sandbox: checkpoint it, then boot ``count`` new sandboxes from the checkpoint.
|
|
643
|
+
async def fork(self, timeout: Optional[int] = None, count: Optional[int] = None, *, metadata: Optional[Dict[str, str]] = None, logger: Any = None, **opts: Any) -> List[Any]:
|
|
644
|
+
"""Copy a running sandbox: checkpoint it, then boot ``count`` new sandboxes from the checkpoint.
|
|
645
|
+
|
|
646
|
+
``metadata`` is added to each copy's metadata (over what it inherits from the sandbox it was copied from)."""
|
|
645
647
|
rt = self._prep(opts)
|
|
646
648
|
if logger is not None:
|
|
647
649
|
raise SolariCompatUnsupported("logger", "the Solari client does not log requests through a logger")
|
|
650
|
+
if metadata is not None and (not isinstance(metadata, dict) or not all(isinstance(k, str) and isinstance(v, str) for k, v in metadata.items())):
|
|
651
|
+
raise InvalidArgumentException("metadata must be a dict of str to str")
|
|
652
|
+
# Same rule as create(): a caller could otherwise name another sandbox's checkpoint here.
|
|
653
|
+
for key in metadata or {}:
|
|
654
|
+
if key in _RESERVED or _is_info_key(key):
|
|
655
|
+
raise SolariCompatUnsupported(f"metadata key {key!r}", "this key is reserved by the compatibility layer")
|
|
648
656
|
n = 1 if count is None else count
|
|
649
657
|
if not isinstance(n, int) or isinstance(n, bool) or n < 1:
|
|
650
658
|
raise InvalidArgumentException("count must be a positive integer")
|
|
@@ -660,7 +668,7 @@ class AsyncSandbox:
|
|
|
660
668
|
|
|
661
669
|
async def one() -> Any:
|
|
662
670
|
try:
|
|
663
|
-
core = await bounded(conn.solari.create(from_snapshot=snap, timeout_ms=int((timeout if timeout is not None else DEFAULT_TIMEOUT) * 1000), metadata={**parent_md, FORK_KEY: snap}), rt)
|
|
671
|
+
core = await bounded(conn.solari.create(from_snapshot=snap, timeout_ms=int((timeout if timeout is not None else DEFAULT_TIMEOUT) * 1000), metadata={**parent_md, **(metadata or {}), FORK_KEY: snap}), rt)
|
|
664
672
|
return cls(conn, core.sandboxId, core)
|
|
665
673
|
except Exception as e: # noqa: BLE001
|
|
666
674
|
t = translate(e)
|
|
@@ -384,7 +384,7 @@ _building: Dict[Any, "asyncio.Future[str]"] = {}
|
|
|
384
384
|
|
|
385
385
|
|
|
386
386
|
async def build_code_interpreter_template(on_log: Optional[Callable[[str], None]] = None, **opts: Any) -> str:
|
|
387
|
-
"""Build ``code-interpreter-v2`` into your org (about
|
|
387
|
+
"""Build ``code-interpreter-v2`` into your org (about 90 seconds, once). ``Sandbox.create()`` calls this when it is missing."""
|
|
388
388
|
conn = resolve_conn(**api_opts(opts))
|
|
389
389
|
key = (conn.api_key, conn.base_url)
|
|
390
390
|
fut = _building.get(key)
|
|
@@ -417,7 +417,7 @@ async def _ensure_template(conn: Conn) -> str:
|
|
|
417
417
|
except SandboxException as e:
|
|
418
418
|
if "not found" not in str(e):
|
|
419
419
|
raise
|
|
420
|
-
log.warning('Building the "%s" template into your Solari org (one time,
|
|
420
|
+
log.warning('Building the "%s" template into your Solari org (one time, about 90 seconds). To prebuild, call build_code_interpreter_template().', CODE_INTERPRETER_TEMPLATE)
|
|
421
421
|
return await build_code_interpreter_template(api_key=conn.api_key, api_url=conn.base_url)
|
|
422
422
|
|
|
423
423
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/code_interpreter/constants.py
RENAMED
|
File without changes
|
{solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.7}/solari_e2b/code_interpreter/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|