Skip to content

Commit 7fbd730

Browse files
committed
Fix packages to support more python Versions
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent 4a7b42c commit 7fbd730

4 files changed

Lines changed: 35 additions & 24 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ jobs:
193193
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
194194

195195
- name: Install Python
196-
run: uv python install 3.12
196+
run: uv python install 3.10 3.11 3.12 3.13
197197

198198
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
199199
with:
@@ -208,7 +208,9 @@ jobs:
208208
run: sudo apt-get update && sudo apt-get install -y clang
209209

210210
- name: Build all Python packages
211-
run: just python-dist
211+
run: |
212+
INTERPS="--interpreter $(uv python find 3.10) $(uv python find 3.11) $(uv python find 3.12) $(uv python find 3.13)"
213+
just python-dist interpreters="$INTERPS"
212214
213215
- uses: actions/upload-artifact@v4
214216
with:
@@ -230,7 +232,7 @@ jobs:
230232
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
231233

232234
- name: Install Python
233-
run: uv python install 3.12
235+
run: uv python install 3.10 3.11 3.12 3.13
234236

235237
- name: Install just
236238
run: cargo install --locked just
@@ -239,7 +241,10 @@ jobs:
239241
run: choco install llvm -y
240242

241243
- name: Build backend wheels
242-
run: just python-dist-backends
244+
shell: pwsh
245+
run: |
246+
$interps = "3.10", "3.11", "3.12", "3.13" | ForEach-Object { & uv python find $_ }
247+
just python-dist-backends interpreters="--interpreter $($interps -join ' ')"
243248
244249
- uses: actions/upload-artifact@v4
245250
with:
@@ -248,19 +253,20 @@ jobs:
248253

249254
# Download merged Linux + Windows wheels and run wheelhouse smoke tests.
250255
python-wheelhouse-test:
251-
name: Python wheelhouse test (${{ matrix.os }})
256+
name: Python wheelhouse test (${{ matrix.os }}, py${{ matrix.python }})
252257
needs: [python-wheelhouse-build-linux, python-wheelhouse-build-windows]
253258
runs-on: ${{ matrix.os }}
254259
strategy:
255260
matrix:
256261
os: [ubuntu-latest, windows-latest]
262+
python: ["3.10", "3.11", "3.12", "3.13"]
257263
steps:
258264
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
259265

260266
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
261267

262268
- name: Install Python
263-
run: uv python install 3.12
269+
run: uv python install ${{ matrix.python }}
264270

265271
- name: Install just
266272
run: cargo install --locked just
@@ -280,7 +286,7 @@ jobs:
280286
sudo chmod 666 /dev/kvm
281287
282288
- name: Run wheelhouse tests
283-
run: just python python-wheelhouse-test
289+
run: just python python-wheelhouse-test ${{ matrix.python }}
284290

285291
javascript-sandbox:
286292
name: JS Sandbox (${{ matrix.os }})

.github/workflows/publish.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
2626

2727
- name: Install Python
28-
run: uv python install 3.12
28+
run: uv python install 3.10 3.11 3.12 3.13
2929

3030
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
3131
with:
@@ -40,7 +40,9 @@ jobs:
4040
run: sudo apt-get update && sudo apt-get install -y clang
4141

4242
- name: Build all Python packages
43-
run: just python-dist
43+
run: |
44+
INTERPS="--interpreter $(uv python find 3.10) $(uv python find 3.11) $(uv python find 3.12) $(uv python find 3.13)"
45+
just python-dist interpreters="$INTERPS"
4446
4547
- uses: actions/upload-artifact@v4
4648
with:
@@ -63,7 +65,7 @@ jobs:
6365
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
6466

6567
- name: Install Python
66-
run: uv python install 3.12
68+
run: uv python install 3.10 3.11 3.12 3.13
6769

6870
- name: Install just
6971
run: cargo install --locked just
@@ -72,7 +74,10 @@ jobs:
7274
run: choco install llvm -y
7375

7476
- name: Build backend wheels
75-
run: just python-dist-backends
77+
shell: pwsh
78+
run: |
79+
$interps = "3.10", "3.11", "3.12", "3.13" | ForEach-Object { & uv python find $_ }
80+
just python-dist-backends interpreters="--interpreter $($interps -join ' ')"
7681
7782
- uses: actions/upload-artifact@v4
7883
with:

Justfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ test-rust:
4141

4242
benchmark: python::python-sandbox-benchmark
4343

44-
python-dist: (wasm::build "release") (js::build "release") python::python-dist
44+
python-dist interpreters="": (wasm::build "release") (js::build "release") (python::python-dist interpreters)
4545

46-
python-dist-backends: wasm::_clean-stale-wasm wasm::guest-compile-wit js::_clean-stale
46+
python-dist-backends interpreters="": wasm::_clean-stale-wasm wasm::guest-compile-wit js::_clean-stale
4747
cargo build --manifest-path src/wasm_sandbox/Cargo.toml --release
4848
cargo build --manifest-path src/javascript_sandbox/Cargo.toml --release
49-
just python python-dist-backends
49+
just python python-dist-backends interpreters="{{interpreters}}"
5050

5151
python-wheelhouse-test: python-dist python::python-wheelhouse-test
5252

src/sdk/python/Justfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,22 @@ build: python-build
5050

5151
#### DIST / PUBLISH ####
5252

53-
python-dist: python-sync-guest-resources
53+
python-dist interpreters="": python-sync-guest-resources
5454
-{{rmrf}} {{dist-root}}
5555
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}}
56+
cd {{repo-root}}/src/sdk/python/wasm_backend && uv run maturin build --release --out {{wasm-wheels}} {{interpreters}}
57+
cd {{repo-root}}/src/sdk/python/hyperlight_js_backend && uv run maturin build --release --out {{hyperlight-js-wheels}} {{interpreters}}
5858
cd {{repo-root}}/src/sdk/python/wasm_guests/python_guest && uv run python -m build --outdir {{python-guest-dist}}
5959
cd {{repo-root}}/src/sdk/python/wasm_guests/javascript_guest && uv run python -m build --outdir {{javascript-guest-dist}}
6060

6161
# Build only the platform-specific maturin backend wheels.
6262
# Used by CI to produce Windows wheels without needing guest binaries.
6363
# Requires sandbox-world.wasm to exist (run `just wasm guest-compile-wit` first).
64-
python-dist-backends: python-sync-env
64+
python-dist-backends interpreters="": python-sync-env
6565
-{{rmrf}} {{wasm-wheels}}
6666
-{{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}}
67+
cd {{repo-root}}/src/sdk/python/wasm_backend && uv run maturin build --release --out {{wasm-wheels}} {{interpreters}}
68+
cd {{repo-root}}/src/sdk/python/hyperlight_js_backend && uv run maturin build --release --out {{hyperlight-js-wheels}} {{interpreters}}
6969

7070
python-publish repository="pypi":
7171
uv publish {{ if repository != "pypi" { "--publish-url https://test.pypi.org/legacy/" } else { "" } }} {{wasm-wheels}}/*
@@ -77,20 +77,20 @@ python-publish repository="pypi":
7777
# Smoke-test the wheels in dist/pythonsdk/ by installing them into
7878
# isolated environments and running basic tests.
7979
# Requires `just python-dist` (root) to have been run first.
80-
python-wheelhouse-test:
81-
uv run --no-project --no-index \
80+
python-wheelhouse-test python-version="":
81+
uv run --no-project {{ if python-version != "" { "--python " + python-version } else { "" } }} --no-index \
8282
--find-links={{core-dist}} \
8383
--find-links={{wasm-wheels}} \
8484
--find-links={{python-guest-dist}} \
8585
--with "hyperlight-sandbox[wasm,python_guest]" \
8686
python {{repo-root}}/src/sdk/python/tests/wheelhouse_wasm_python.py
87-
uv run --no-project --no-index \
87+
uv run --no-project {{ if python-version != "" { "--python " + python-version } else { "" } }} --no-index \
8888
--find-links={{core-dist}} \
8989
--find-links={{wasm-wheels}} \
9090
--find-links={{javascript-guest-dist}} \
9191
--with "hyperlight-sandbox[wasm,javascript_guest]" \
9292
python {{repo-root}}/src/sdk/python/tests/wheelhouse_wasm_js.py
93-
uv run --no-project --no-index \
93+
uv run --no-project {{ if python-version != "" { "--python " + python-version } else { "" } }} --no-index \
9494
--find-links={{core-dist}} \
9595
--find-links={{hyperlight-js-wheels}} \
9696
--find-links={{javascript-guest-dist}} \

0 commit comments

Comments
 (0)