hyperlight-sandbox-javascript-guest 0.0.1__tar.gz → 0.1.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.
- hyperlight_sandbox_javascript_guest-0.1.0/PKG-INFO +14 -0
- hyperlight_sandbox_javascript_guest-0.1.0/README.md +6 -0
- hyperlight_sandbox_javascript_guest-0.1.0/hyperlight_sandbox_javascript_guest.egg-info/PKG-INFO +14 -0
- hyperlight_sandbox_javascript_guest-0.1.0/hyperlight_sandbox_javascript_guest.egg-info/SOURCES.txt +11 -0
- hyperlight_sandbox_javascript_guest-0.1.0/hyperlight_sandbox_javascript_guest.egg-info/dependency_links.txt +1 -0
- hyperlight_sandbox_javascript_guest-0.1.0/hyperlight_sandbox_javascript_guest.egg-info/top_level.txt +1 -0
- hyperlight_sandbox_javascript_guest-0.1.0/javascript_guest/__init__.py +3 -0
- hyperlight_sandbox_javascript_guest-0.1.0/javascript_guest/path.py +56 -0
- hyperlight_sandbox_javascript_guest-0.1.0/javascript_guest/resources/__init__.py +0 -0
- hyperlight_sandbox_javascript_guest-0.1.0/javascript_guest/resources/js-sandbox.aot +0 -0
- hyperlight_sandbox_javascript_guest-0.1.0/javascript_guest/resources/js-sandbox.wasm +0 -0
- hyperlight_sandbox_javascript_guest-0.1.0/pyproject.toml +17 -0
- hyperlight_sandbox_javascript_guest-0.1.0/setup.cfg +4 -0
- hyperlight_sandbox_javascript_guest-0.0.1/PKG-INFO +0 -9
- hyperlight_sandbox_javascript_guest-0.0.1/README.md +0 -3
- hyperlight_sandbox_javascript_guest-0.0.1/hyperlight_sandbox_javascript_guest/__init__.py +0 -3
- hyperlight_sandbox_javascript_guest-0.0.1/pyproject.toml +0 -20
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hyperlight-sandbox-javascript-guest
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Packaged Hyperlight Wasm JavaScript guest exposed as javascript_guest.path
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
|
|
9
|
+
# hyperlight-sandbox-javascript-guest
|
|
10
|
+
|
|
11
|
+
Packaged JavaScript guest for the `hyperlight-sandbox` Wasm backend.
|
|
12
|
+
|
|
13
|
+
After installation, use `module="javascript_guest.path"`,
|
|
14
|
+
or `module_path="javascript_guest.path"` in the public API package.
|
hyperlight_sandbox_javascript_guest-0.1.0/hyperlight_sandbox_javascript_guest.egg-info/PKG-INFO
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hyperlight-sandbox-javascript-guest
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Packaged Hyperlight Wasm JavaScript guest exposed as javascript_guest.path
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
|
|
9
|
+
# hyperlight-sandbox-javascript-guest
|
|
10
|
+
|
|
11
|
+
Packaged JavaScript guest for the `hyperlight-sandbox` Wasm backend.
|
|
12
|
+
|
|
13
|
+
After installation, use `module="javascript_guest.path"`,
|
|
14
|
+
or `module_path="javascript_guest.path"` in the public API package.
|
hyperlight_sandbox_javascript_guest-0.1.0/hyperlight_sandbox_javascript_guest.egg-info/SOURCES.txt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
hyperlight_sandbox_javascript_guest.egg-info/PKG-INFO
|
|
4
|
+
hyperlight_sandbox_javascript_guest.egg-info/SOURCES.txt
|
|
5
|
+
hyperlight_sandbox_javascript_guest.egg-info/dependency_links.txt
|
|
6
|
+
hyperlight_sandbox_javascript_guest.egg-info/top_level.txt
|
|
7
|
+
javascript_guest/__init__.py
|
|
8
|
+
javascript_guest/path.py
|
|
9
|
+
javascript_guest/resources/__init__.py
|
|
10
|
+
javascript_guest/resources/js-sandbox.aot
|
|
11
|
+
javascript_guest/resources/js-sandbox.wasm
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
hyperlight_sandbox_javascript_guest-0.1.0/hyperlight_sandbox_javascript_guest.egg-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
javascript_guest
|
|
@@ -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" / "javascript_guest"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _materialize(filename: str) -> str:
|
|
28
|
+
resource = resources.files("javascript_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("js-sandbox.aot")
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def get_wasm_path() -> str:
|
|
53
|
+
return _materialize("js-sandbox.wasm")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
MODULE_PATH = get_module_path()
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
@@ -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-javascript-guest"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Packaged Hyperlight Wasm JavaScript guest exposed as javascript_guest.path"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "Apache-2.0"
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
|
|
13
|
+
[tool.setuptools]
|
|
14
|
+
packages = ["javascript_guest", "javascript_guest.resources"]
|
|
15
|
+
|
|
16
|
+
[tool.setuptools.package-data]
|
|
17
|
+
javascript_guest = ["resources/*.aot", "resources/*.wasm"]
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: hyperlight-sandbox-javascript-guest
|
|
3
|
-
Version: 0.0.1
|
|
4
|
-
Summary: Packaged Hyperlight Wasm JavaScript guest exposed as javascript_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,20 +0,0 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["hatchling"]
|
|
3
|
-
build-backend = "hatchling.build"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "hyperlight-sandbox-javascript-guest"
|
|
7
|
-
version = "0.0.1"
|
|
8
|
-
description = "Packaged Hyperlight Wasm JavaScript guest exposed as javascript_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_javascript_guest"]
|