Skip to content

Commit 2d4707b

Browse files
authored
Fix publishing steps (#17)
Always build wheels to same location and fix some warnings in CI logs Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent 2f69498 commit 2d4707b

9 files changed

Lines changed: 30 additions & 24 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ flowchart TD
5353

5454
Python SDK:
5555

56+
```shell
57+
uv pip install "hyperlight-sandbox[wasm,python_guest]"
58+
```
59+
60+
And to use it:
61+
5662
```python
5763
from hyperlight_sandbox import Sandbox
5864

@@ -183,6 +189,11 @@ fn main() {
183189

184190
## Building
185191

192+
Tool requirements:
193+
194+
- just
195+
- uv
196+
- npm
186197

187198
```bash
188199
# Build everything (Rust backends, Wasm guests, Python SDK)

src/sdk/python/Justfile

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
repo-root := invocation_directory()
22
wit-world := if os() == "windows" { "$env:WIT_WORLD=\"" + repo-root + "/src/wasm_sandbox/wit/sandbox-world.wasm\";" } else { "WIT_WORLD=" + repo-root + "/src/wasm_sandbox/wit/sandbox-world.wasm" }
33

4-
core-dist := repo-root + "/src/sdk/python/core/dist"
5-
wasm-wheels := repo-root + "/src/sdk/python/wasm_backend/target/wheels"
6-
hyperlight-js-wheels := repo-root + "/src/sdk/python/hyperlight_js_backend/target/wheels"
7-
python-guest-dist := repo-root + "/src/sdk/python/wasm_guests/python_guest/dist"
8-
javascript-guest-dist := repo-root + "/src/sdk/python/wasm_guests/javascript_guest/dist"
4+
dist-root := repo-root + "/dist/pythonsdk"
5+
core-dist := dist-root + "/core"
6+
wasm-wheels := dist-root + "/wasm_backend"
7+
hyperlight-js-wheels := dist-root + "/hyperlight_js_backend"
8+
python-guest-dist := dist-root + "/python_guest"
9+
javascript-guest-dist := dist-root + "/javascript_guest"
910

1011
#### BUILD ####
1112

@@ -50,12 +51,12 @@ build: python-build
5051
#### DIST / PUBLISH ####
5152

5253
python-dist: python-sync-guest-resources
53-
rm -rf {{core-dist}} {{wasm-wheels}} {{hyperlight-js-wheels}} {{python-guest-dist}} {{javascript-guest-dist}}
54-
cd {{repo-root}}/src/sdk/python/core && uv run python -m build
55-
cd {{repo-root}}/src/sdk/python/wasm_backend && {{ wit-world }} uv run maturin build --release
56-
cd {{repo-root}}/src/sdk/python/hyperlight_js_backend && uv run maturin build --release
57-
cd {{repo-root}}/src/sdk/python/wasm_guests/python_guest && uv run python -m build
58-
cd {{repo-root}}/src/sdk/python/wasm_guests/javascript_guest && uv run python -m build
54+
rm -rf {{dist-root}}
55+
cd {{repo-root}}/src/sdk/python/core && uv run python -m build --outdir {{core-dist}}
56+
cd {{repo-root}}/src/sdk/python/wasm_backend && {{ wit-world }} uv run maturin build --release --out {{wasm-wheels}}
57+
cd {{repo-root}}/src/sdk/python/hyperlight_js_backend && uv run maturin build --release --out {{hyperlight-js-wheels}}
58+
cd {{repo-root}}/src/sdk/python/wasm_guests/python_guest && uv run python -m build --outdir {{python-guest-dist}}
59+
cd {{repo-root}}/src/sdk/python/wasm_guests/javascript_guest && uv run python -m build --outdir {{javascript-guest-dist}}
5960

6061
python-publish repository="pypi": python-dist
6162
#!/usr/bin/env bash

src/sdk/python/core/pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,14 @@ name = "hyperlight-sandbox"
77
version = "0.1.0"
88
description = "Python API for running code in isolated Hyperlight sandboxes with swappable backends"
99
readme = "README.md"
10-
license = { text = "Apache-2.0" }
10+
license = "Apache-2.0"
1111
requires-python = ">=3.10"
1212
dependencies = []
1313
optional-dependencies = { wasm = ["hyperlight-sandbox-backend-wasm>=0.1.0"], hyperlight_js = ["hyperlight-sandbox-backend-hyperlight-js>=0.1.0"], python_guest = ["hyperlight-sandbox-python-guest>=0.1.0"], javascript_guest = ["hyperlight-sandbox-javascript-guest>=0.1.0"], dev = ["atheris>=2.3.0"] }
1414
classifiers = [
1515
"Development Status :: 3 - Alpha",
1616
"Intended Audience :: Developers",
17-
"License :: OSI Approved :: Apache Software License",
1817
"Programming Language :: Python :: 3",
19-
"Programming Language :: Python :: 3.10",
20-
"Programming Language :: Python :: 3.11",
21-
"Programming Language :: Python :: 3.12",
2218
"Programming Language :: Rust",
2319
"Operating System :: POSIX :: Linux",
2420
]

src/sdk/python/hyperlight_js_backend/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ name = "hyperlight-sandbox-backend-hyperlight-js"
77
version = "0.1.0"
88
description = "HyperlightJS backend implementation for hyperlight-sandbox"
99
readme = "README.md"
10-
license = { text = "Apache-2.0" }
10+
license = "Apache-2.0"
1111
requires-python = ">=3.10"
1212
classifiers = [
1313
"Development Status :: 3 - Alpha",
1414
"Intended Audience :: Developers",
15-
"License :: OSI Approved :: Apache Software License",
1615
"Programming Language :: Python :: 3",
1716
"Programming Language :: Rust",
1817
"Operating System :: POSIX :: Linux",

src/sdk/python/wasm_backend/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ name = "hyperlight-sandbox-backend-wasm"
77
version = "0.1.0"
88
description = "Wasm backend implementation for hyperlight-sandbox"
99
readme = "README.md"
10-
license = { text = "Apache-2.0" }
10+
license = "Apache-2.0"
1111
requires-python = ">=3.10"
1212
classifiers = [
1313
"Development Status :: 3 - Alpha",
1414
"Intended Audience :: Developers",
15-
"License :: OSI Approved :: Apache Software License",
1615
"Programming Language :: Python :: 3",
1716
"Programming Language :: Rust",
1817
"Operating System :: POSIX :: Linux",

src/sdk/python/wasm_guests/javascript_guest/javascript_guest/resources/__init__.py

Whitespace-only changes.

src/sdk/python/wasm_guests/javascript_guest/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ name = "hyperlight-sandbox-javascript-guest"
77
version = "0.1.0"
88
description = "Packaged Hyperlight Wasm JavaScript guest exposed as javascript_guest.path"
99
readme = "README.md"
10-
license = { text = "Apache-2.0" }
10+
license = "Apache-2.0"
1111
requires-python = ">=3.10"
1212

1313
[tool.setuptools]
14-
packages = ["javascript_guest"]
14+
packages = ["javascript_guest", "javascript_guest.resources"]
1515

1616
[tool.setuptools.package-data]
1717
javascript_guest = ["resources/*.aot", "resources/*.wasm"]

src/sdk/python/wasm_guests/python_guest/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ name = "hyperlight-sandbox-python-guest"
77
version = "0.1.0"
88
description = "Packaged Hyperlight Wasm Python guest exposed as python_guest.path"
99
readme = "README.md"
10-
license = { text = "Apache-2.0" }
10+
license = "Apache-2.0"
1111
requires-python = ">=3.10"
1212

1313
[tool.setuptools]
14-
packages = ["python_guest"]
14+
packages = ["python_guest", "python_guest.resources"]
1515

1616
[tool.setuptools.package-data]
1717
python_guest = ["resources/*.aot", "resources/*.wasm"]

src/sdk/python/wasm_guests/python_guest/python_guest/resources/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)