hyperlight-sandbox-python-guest 0.0.1__tar.gz → 0.2.0__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.
@@ -0,0 +1,14 @@
1
+ Metadata-Version: 2.4
2
+ Name: hyperlight-sandbox-python-guest
3
+ Version: 0.2.0
4
+ Summary: Packaged Hyperlight Wasm Python guest exposed as python_guest.path
5
+ License-Expression: Apache-2.0
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+
9
+ # hyperlight-sandbox-python-guest
10
+
11
+ Packaged Python guest for the `hyperlight-sandbox` Wasm backend.
12
+
13
+ After installation, use `module="python_guest.path"` or
14
+ `module_path="python_guest.path"` in the public API package.
@@ -0,0 +1,6 @@
1
+ # hyperlight-sandbox-python-guest
2
+
3
+ Packaged Python guest for the `hyperlight-sandbox` Wasm backend.
4
+
5
+ After installation, use `module="python_guest.path"` or
6
+ `module_path="python_guest.path"` in the public API package.
@@ -0,0 +1,14 @@
1
+ Metadata-Version: 2.4
2
+ Name: hyperlight-sandbox-python-guest
3
+ Version: 0.2.0
4
+ Summary: Packaged Hyperlight Wasm Python guest exposed as python_guest.path
5
+ License-Expression: Apache-2.0
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+
9
+ # hyperlight-sandbox-python-guest
10
+
11
+ Packaged Python guest for the `hyperlight-sandbox` Wasm backend.
12
+
13
+ After installation, use `module="python_guest.path"` or
14
+ `module_path="python_guest.path"` in the public API package.
@@ -0,0 +1,11 @@
1
+ README.md
2
+ pyproject.toml
3
+ hyperlight_sandbox_python_guest.egg-info/PKG-INFO
4
+ hyperlight_sandbox_python_guest.egg-info/SOURCES.txt
5
+ hyperlight_sandbox_python_guest.egg-info/dependency_links.txt
6
+ hyperlight_sandbox_python_guest.egg-info/top_level.txt
7
+ python_guest/__init__.py
8
+ python_guest/path.py
9
+ python_guest/resources/__init__.py
10
+ python_guest/resources/python-sandbox.aot
11
+ python_guest/resources/python-sandbox.wasm
@@ -0,0 +1,17 @@
1
+ [build-system]
2
+ requires = ["setuptools>=69", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "hyperlight-sandbox-python-guest"
7
+ version = "0.2.0"
8
+ description = "Packaged Hyperlight Wasm Python guest exposed as python_guest.path"
9
+ readme = "README.md"
10
+ license = "Apache-2.0"
11
+ requires-python = ">=3.10"
12
+
13
+ [tool.setuptools]
14
+ packages = ["python_guest", "python_guest.resources"]
15
+
16
+ [tool.setuptools.package-data]
17
+ python_guest = ["resources/*.aot", "resources/*.wasm"]
@@ -0,0 +1,3 @@
1
+ from python_guest.path import MODULE_PATH, get_module_path, get_wasm_path
2
+
3
+ __all__ = ["MODULE_PATH", "get_module_path", "get_wasm_path"]
@@ -0,0 +1,56 @@
1
+ from __future__ import annotations
2
+
3
+ import contextlib
4
+ import os
5
+ import sys
6
+ import tempfile
7
+ from importlib import resources
8
+ from pathlib import Path
9
+
10
+
11
+ def _default_cache_root() -> Path:
12
+ env = os.environ.get("XDG_CACHE_HOME")
13
+ if env:
14
+ return Path(env)
15
+ if sys.platform == "win32":
16
+ local = os.environ.get("LOCALAPPDATA")
17
+ if local:
18
+ return Path(local)
19
+ elif sys.platform == "darwin":
20
+ return Path.home() / "Library" / "Caches"
21
+ return Path.home() / ".cache"
22
+
23
+
24
+ _CACHE_DIR = _default_cache_root() / "hyperlight_sandbox_guests" / "python_guest"
25
+
26
+
27
+ def _materialize(filename: str) -> str:
28
+ resource = resources.files("python_guest").joinpath("resources", filename)
29
+ target = _CACHE_DIR / filename
30
+ _CACHE_DIR.mkdir(parents=True, exist_ok=True, mode=0o700)
31
+ data = resource.read_bytes()
32
+ if not target.exists() or target.read_bytes() != data:
33
+ fd, tmp = tempfile.mkstemp(dir=_CACHE_DIR)
34
+ try:
35
+ os.write(fd, data)
36
+ os.close(fd)
37
+ fd = -1
38
+ os.replace(tmp, target) # atomic on same filesystem
39
+ except BaseException:
40
+ if fd >= 0:
41
+ os.close(fd)
42
+ with contextlib.suppress(OSError):
43
+ os.unlink(tmp)
44
+ raise
45
+ return str(target)
46
+
47
+
48
+ def get_module_path() -> str:
49
+ return _materialize("python-sandbox.aot")
50
+
51
+
52
+ def get_wasm_path() -> str:
53
+ return _materialize("python-sandbox.wasm")
54
+
55
+
56
+ MODULE_PATH = get_module_path()
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -1,9 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: hyperlight-sandbox-python-guest
3
- Version: 0.0.1
4
- Summary: Packaged Hyperlight Wasm Python guest exposed as python_guest.path
5
- Author: Hyperlight Team
6
- License-Expression: Apache-2.0
7
- Classifier: Development Status :: 1 - Planning
8
- Classifier: Programming Language :: Python :: 3
9
- Requires-Python: >=3.10
@@ -1,3 +0,0 @@
1
- # hyperlight-sandbox-python-guest
2
-
3
- Packaged Hyperlight Wasm Python guest exposed as python_guest.path
@@ -1,3 +0,0 @@
1
- """Placeholder package – the real implementation is coming soon."""
2
-
3
- __version__ = "0.0.1"
@@ -1,20 +0,0 @@
1
- [build-system]
2
- requires = ["hatchling"]
3
- build-backend = "hatchling.build"
4
-
5
- [project]
6
- name = "hyperlight-sandbox-python-guest"
7
- version = "0.0.1"
8
- description = "Packaged Hyperlight Wasm Python guest exposed as python_guest.path"
9
- requires-python = ">=3.10"
10
- license = "Apache-2.0"
11
- authors = [
12
- { name = "Hyperlight Team" },
13
- ]
14
- classifiers = [
15
- "Development Status :: 1 - Planning",
16
- "Programming Language :: Python :: 3",
17
- ]
18
-
19
- [tool.hatch.build.targets.wheel]
20
- packages = ["hyperlight_sandbox_python_guest"]