@@ -5,6 +5,10 @@ export WIT_WORLD := repo-root + "/src/wasm_sandbox/wit/sandbox-world.wasm"
55rmrf := if os () == " windows" { " Remove-Item -Recurse -Force -ErrorAction SilentlyContinue" } else { " rm -rf" }
66mkdirp := if os () == " windows" { " New-Item -ItemType Directory -Force" } else { " mkdir -p" }
77
8+ # Set via env or CLI (e.g. `just interpreters="--interpreter python3.10 python3.13" python-dist`)
9+ # to build wheels for multiple Python versions. Defaults to empty (maturin uses active Python).
10+ interpreters := env (" INTERPRETERS" , " " )
11+
812dist-root := repo-root + " /dist/pythonsdk"
913core-dist := dist-root + " /core"
1014wasm-wheels := dist-root + " /wasm_backend"
@@ -53,8 +57,8 @@ build: python-build
5357python-dist : python-sync-guest-resources
5458 - {{ rmrf}} {{ dist-root}}
5559 cd {{ repo-root}} / src/ sdk/ python/ core && uv run python -m build --outdir {{ core-dist}}
56- cd {{ repo-root}} / src/ sdk/ python/ wasm_backend && 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}}
60+ cd {{ repo-root}} / src/ sdk/ python/ wasm_backend && uv run maturin build --release --out {{ wasm-wheels}} {{ interpreters }}
61+ cd {{ repo-root}} / src/ sdk/ python/ hyperlight_js_backend && uv run maturin build --release --out {{ hyperlight-js-wheels}} {{ interpreters }}
5862 cd {{ repo-root}} / src/ sdk/ python/ wasm_guests/ python_guest && uv run python -m build --outdir {{ python-guest-dist}}
5963 cd {{ repo-root}} / src/ sdk/ python/ wasm_guests/ javascript_guest && uv run python -m build --outdir {{ javascript-guest-dist}}
6064
@@ -64,8 +68,8 @@ python-dist: python-sync-guest-resources
6468python-dist-backends : python-sync-env
6569 - {{ rmrf}} {{ wasm-wheels}}
6670 - {{ rmrf}} {{ hyperlight-js-wheels}}
67- cd {{ repo-root}} / src/ sdk/ python/ wasm_backend && uv run maturin build --release --out {{ wasm-wheels}}
68- cd {{ repo-root}} / src/ sdk/ python/ hyperlight_js_backend && uv run maturin build --release --out {{ hyperlight-js-wheels}}
71+ cd {{ repo-root}} / src/ sdk/ python/ wasm_backend && uv run maturin build --release --out {{ wasm-wheels}} {{ interpreters }}
72+ cd {{ repo-root}} / src/ sdk/ python/ hyperlight_js_backend && uv run maturin build --release --out {{ hyperlight-js-wheels}} {{ interpreters }}
6973
7074python-publish repository = " pypi":
7175 uv publish {{ if repository != " pypi" { " --publish-url https://test.pypi.org/legacy/" } else { " " } }} {{ wasm-wheels}} / *
@@ -77,20 +81,20 @@ python-publish repository="pypi":
7781# Smoke-test the wheels in dist/pythonsdk/ by installing them into
7882# isolated environments and running basic tests.
7983# Requires `just python-dist` (root) to have been run first.
80- python-wheelhouse-test :
81- uv run --no-project --no-index \
84+ python-wheelhouse-test python - version = " " :
85+ uv run --no-project {{ if python-version != " " { " --python " + python-version } else { " " } }} --no-index \
8286 - -find-links={{ core-dist}} \
8387 - -find-links={{ wasm-wheels}} \
8488 - -find-links={{ python-guest-dist}} \
8589 - -with " hyperlight-sandbox[wasm,python_guest]" \
8690 python {{ repo-root}} / src/ sdk/ python/ tests/ wheelhouse_wasm_python.py
87- uv run --no-project --no-index \
91+ uv run --no-project {{ if python-version != " " { " --python " + python-version } else { " " } }} --no-index \
8892 - -find-links={{ core-dist}} \
8993 - -find-links={{ wasm-wheels}} \
9094 - -find-links={{ javascript-guest-dist}} \
9195 - -with " hyperlight-sandbox[wasm,javascript_guest]" \
9296 python {{ repo-root}} / src/ sdk/ python/ tests/ wheelhouse_wasm_js.py
93- uv run --no-project --no-index \
97+ uv run --no-project {{ if python-version != " " { " --python " + python-version } else { " " } }} --no-index \
9498 - -find-links={{ core-dist}} \
9599 - -find-links={{ hyperlight-js-wheels}} \
96100 - -find-links={{ javascript-guest-dist}} \
0 commit comments