solari-e2b-compat 0.2.6__tar.gz → 0.2.8__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.
Files changed (32) hide show
  1. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/COMPAT.md +5 -2
  2. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/PKG-INFO +2 -2
  3. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/README.md +1 -1
  4. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/pyproject.toml +1 -1
  5. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/__init__.py +1 -1
  6. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/_sandbox.py +3 -1
  7. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/code_interpreter/__init__.py +2 -2
  8. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/.gitignore +0 -0
  9. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/LICENSE +0 -0
  10. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/LICENSE-E2B +0 -0
  11. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/NOTICE +0 -0
  12. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/_box.py +0 -0
  13. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/_commands.py +0 -0
  14. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/_config.py +0 -0
  15. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/_filesystem.py +0 -0
  16. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/_git.py +0 -0
  17. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/_loop.py +0 -0
  18. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/_redact.py +0 -0
  19. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/_request.py +0 -0
  20. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/_sync.py +0 -0
  21. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/_template.py +0 -0
  22. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/_vendor_user.py +0 -0
  23. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/_volume.py +0 -0
  24. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/code_interpreter/charts.py +0 -0
  25. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/code_interpreter/client.py +0 -0
  26. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/code_interpreter/code_interpreter_async.py +0 -0
  27. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/code_interpreter/code_interpreter_sync.py +0 -0
  28. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/code_interpreter/constants.py +0 -0
  29. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/code_interpreter/exceptions.py +0 -0
  30. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/code_interpreter/models.py +0 -0
  31. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/exceptions.py +0 -0
  32. {solari_e2b_compat-0.2.6 → solari_e2b_compat-0.2.8}/solari_e2b/models.py +0 -0
@@ -1,4 +1,6 @@
1
- # COMPAT.md: E2B Python SDK compatibility (target: e2b 2.59 and e2b-code-interpreter 2.11)
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 80 seconds, 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. |
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.6
3
+ Version: 0.2.8
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 80 seconds, once). To do it ahead of time:
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 80 seconds, once). To do it ahead of time:
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.6"
7
+ version = "0.2.8"
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"
@@ -76,4 +76,4 @@ class _UnsupportedModule:
76
76
 
77
77
  client = _UnsupportedModule()
78
78
 
79
- __version__ = "0.2.6"
79
+ __version__ = "0.2.8"
@@ -463,7 +463,9 @@ class AsyncSandbox:
463
463
  metadata=stored_md or None,
464
464
  # E2B's timeout is a lifetime; Solari's is a rolling idle window (COMPAT.md).
465
465
  timeout_ms=int((timeout if timeout is not None else DEFAULT_TIMEOUT) * 1000),
466
- lifecycle=lifecycle_of(lifecycle),
466
+ # E2B's default when a sandbox times out is to KILL it; Solari's own default is to pause. The gateway applies its
467
+ # default only when no lifecycle is sent, so send E2B's (audit retest R3).
468
+ lifecycle=lifecycle_of(lifecycle) or {"onTimeout": "kill"},
467
469
  volumes=volumes,
468
470
  isolation="hardened" if hardened else None,
469
471
  ),
@@ -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 80 seconds, once). ``Sandbox.create()`` calls this when it is missing."""
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, several minutes). To prebuild, call build_code_interpreter_template().', CODE_INTERPRETER_TEMPLATE)
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