solari-e2b-compat 0.2.5__tar.gz → 0.2.6__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.5 → solari_e2b_compat-0.2.6}/.gitignore +1 -0
  2. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/PKG-INFO +1 -1
  3. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/pyproject.toml +1 -1
  4. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/__init__.py +1 -1
  5. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/_sandbox.py +11 -3
  6. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/COMPAT.md +0 -0
  7. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/LICENSE +0 -0
  8. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/LICENSE-E2B +0 -0
  9. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/NOTICE +0 -0
  10. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/README.md +0 -0
  11. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/_box.py +0 -0
  12. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/_commands.py +0 -0
  13. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/_config.py +0 -0
  14. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/_filesystem.py +0 -0
  15. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/_git.py +0 -0
  16. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/_loop.py +0 -0
  17. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/_redact.py +0 -0
  18. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/_request.py +0 -0
  19. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/_sync.py +0 -0
  20. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/_template.py +0 -0
  21. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/_vendor_user.py +0 -0
  22. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/_volume.py +0 -0
  23. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/code_interpreter/__init__.py +0 -0
  24. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/code_interpreter/charts.py +0 -0
  25. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/code_interpreter/client.py +0 -0
  26. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/code_interpreter/code_interpreter_async.py +0 -0
  27. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/code_interpreter/code_interpreter_sync.py +0 -0
  28. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/code_interpreter/constants.py +0 -0
  29. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/code_interpreter/exceptions.py +0 -0
  30. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/code_interpreter/models.py +0 -0
  31. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/exceptions.py +0 -0
  32. {solari_e2b_compat-0.2.5 → solari_e2b_compat-0.2.6}/solari_e2b/models.py +0 -0
@@ -2,6 +2,7 @@
2
2
  dist/
3
3
  **/dist/
4
4
  **/node_modules/
5
+ **/node_modules
5
6
  **/target/
6
7
  *.log
7
8
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: solari-e2b-compat
3
- Version: 0.2.5
3
+ Version: 0.2.6
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
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "solari-e2b-compat"
7
- version = "0.2.5"
7
+ version = "0.2.6"
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.5"
79
+ __version__ = "0.2.6"
@@ -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)