Skip to content

Commit 60585dc

Browse files
authored
Update Python support through 3.14 (#125)
* Update Python support matrix Signed-off-by: James Sturtevant <jsturtevant@gmail.com> * Fix Python fuzz CI interpreter Signed-off-by: James Sturtevant <jsturtevant@gmail.com> * Fix fuzz Python environment override Signed-off-by: James Sturtevant <jsturtevant@gmail.com> * Fix Windows fuzz Python env command Signed-off-by: James Sturtevant <jsturtevant@gmail.com> * Refactor Python backend install recipe Signed-off-by: James Sturtevant <jsturtevant@gmail.com> * Simplify Python backend install recipe Signed-off-by: James Sturtevant <jsturtevant@gmail.com> * Simplify Python version Justfile args Signed-off-by: James Sturtevant <jsturtevant@gmail.com> --------- Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent ad68553 commit 60585dc

10 files changed

Lines changed: 79 additions & 32 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
6161

6262
- name: Install Python
63-
run: uv python install 3.12
63+
run: uv python install 3.14
6464

6565
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
6666
with:
@@ -121,7 +121,7 @@ jobs:
121121
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
122122

123123
- name: Install Python
124-
run: uv python install 3.12
124+
run: uv python install 3.14
125125

126126
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
127127
with:
@@ -177,6 +177,8 @@ jobs:
177177
python-sdk:
178178
name: Python SDK (${{ matrix.os }})
179179
runs-on: ${{ matrix.os }}
180+
env:
181+
UV_PYTHON: "3.14"
180182
strategy:
181183
matrix:
182184
os: [ubuntu-latest, windows-latest]
@@ -191,7 +193,7 @@ jobs:
191193
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
192194

193195
- name: Install Python
194-
run: uv python install 3.12
196+
run: uv python install 3.12 3.14
195197

196198
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
197199
with:
@@ -268,7 +270,7 @@ jobs:
268270
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
269271

270272
- name: Install Python
271-
run: uv python install 3.10 3.11 3.12 3.13
273+
run: uv python install 3.10 3.11 3.12 3.13 3.14
272274

273275
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
274276
with:
@@ -284,7 +286,7 @@ jobs:
284286

285287
- name: Build all Python packages
286288
run: |
287-
export INTERPRETERS="--interpreter $(uv python find 3.10) $(uv python find 3.11) $(uv python find 3.12) $(uv python find 3.13)"
289+
export INTERPRETERS="--interpreter $(uv python find 3.10) $(uv python find 3.11) $(uv python find 3.12) $(uv python find 3.13) $(uv python find 3.14)"
288290
just python-dist
289291
290292
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
@@ -307,7 +309,7 @@ jobs:
307309
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
308310

309311
- name: Install Python
310-
run: uv python install 3.10 3.11 3.12 3.13
312+
run: uv python install 3.10 3.11 3.12 3.13 3.14
311313

312314
- name: Install just
313315
run: cargo install --locked just
@@ -318,7 +320,7 @@ jobs:
318320
- name: Build backend wheels
319321
shell: pwsh
320322
run: |
321-
$interps = "3.10", "3.11", "3.12", "3.13" | ForEach-Object { & uv python find $_ }
323+
$interps = "3.10", "3.11", "3.12", "3.13", "3.14" | ForEach-Object { & uv python find $_ }
322324
$env:INTERPRETERS = "--interpreter $($interps -join ' ')"
323325
just python-dist-backends
324326
@@ -335,7 +337,7 @@ jobs:
335337
strategy:
336338
matrix:
337339
os: [ubuntu-latest, windows-latest]
338-
python: ["3.10", "3.11", "3.12", "3.13"]
340+
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
339341
steps:
340342
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
341343

.github/workflows/publish.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
3737

3838
- name: Install Python
39-
run: uv python install 3.10 3.11 3.12 3.13
39+
run: uv python install 3.10 3.11 3.12 3.13 3.14
4040

4141
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
4242
with:
@@ -52,7 +52,7 @@ jobs:
5252

5353
- name: Build all Python packages
5454
run: |
55-
export INTERPRETERS="--interpreter $(uv python find 3.10) $(uv python find 3.11) $(uv python find 3.12) $(uv python find 3.13)"
55+
export INTERPRETERS="--interpreter $(uv python find 3.10) $(uv python find 3.11) $(uv python find 3.12) $(uv python find 3.13) $(uv python find 3.14)"
5656
just python-dist
5757
5858
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
@@ -76,7 +76,7 @@ jobs:
7676
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
7777

7878
- name: Install Python
79-
run: uv python install 3.10 3.11 3.12 3.13
79+
run: uv python install 3.10 3.11 3.12 3.13 3.14
8080

8181
- name: Install just
8282
run: cargo install --locked just
@@ -87,7 +87,7 @@ jobs:
8787
- name: Build backend wheels
8888
shell: pwsh
8989
run: |
90-
$interps = "3.10", "3.11", "3.12", "3.13" | ForEach-Object { & uv python find $_ }
90+
$interps = "3.10", "3.11", "3.12", "3.13", "3.14" | ForEach-Object { & uv python find $_ }
9191
$env:INTERPRETERS = "--interpreter $($interps -join ' ')"
9292
just python-dist-backends
9393
@@ -140,7 +140,7 @@ jobs:
140140
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
141141

142142
- name: Install Python
143-
run: uv python install 3.12
143+
run: uv python install 3.14
144144

145145
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
146146
with:
@@ -197,7 +197,7 @@ jobs:
197197
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
198198

199199
- name: Install Python
200-
run: uv python install 3.12
200+
run: uv python install 3.14
201201

202202
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
203203
with:

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ Requires [KVM](https://help.ubuntu.com/community/KVM/Installation), [MSHV](https
5757

5858
Python SDK:
5959

60+
The Python SDK and packaged Wasm guest wheels support CPython 3.10 through 3.14.
61+
6062
```shell
6163
uv pip install "hyperlight-sandbox[wasm,python_guest]"
6264
```

src/sdk/python/Justfile

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
set windows-shell := ["pwsh", "-NoLogo", "-Command"]
22

33
repo-root := invocation_directory_native()
4+
python-root := repo-root + "/src/sdk/python"
45
export WIT_WORLD := repo-root + "/src/wasm_sandbox/wit/sandbox-world.wasm"
56
rmrf := if os() == "windows" { "Remove-Item -Recurse -Force -ErrorAction SilentlyContinue" } else { "rm -rf" }
67
mkdirp := if os() == "windows" { "New-Item -ItemType Directory -Force" } else { "mkdir -p" }
8+
uv-python-env := "UV_PYTHON"
9+
python-version-flag := "--python"
710

8-
# Set via env or CLI (e.g. `just interpreters="--interpreter python3.10 python3.13" python-dist`)
11+
# Set via env or CLI (e.g. `just interpreters="--interpreter python3.10 python3.14" python-dist`)
912
# to build wheels for multiple Python versions. Defaults to empty (maturin uses active Python).
1013
interpreters := env("INTERPRETERS", "")
14+
# Atheris currently supports fuzzing on Python <= 3.12. Keep the rest of the
15+
# SDK test/build surface on the active Python while running fuzz on 3.12.
16+
default-fuzz-python := "3.12"
17+
fuzz-python := env("FUZZ_PYTHON", default-fuzz-python)
1118

1219
dist-root := repo-root + "/dist/pythonsdk"
1320
core-dist := dist-root + "/core"
@@ -32,23 +39,28 @@ python-sync-guest-resources:
3239
# Install pure Python dependencies from the lockfile into the local venv.
3340
# Skips the two Rust backend packages — those are compiled and installed
3441
# separately by `python-install-backends` via `maturin develop`.
35-
python-sync-env:
36-
uv sync --frozen --inexact --no-install-package hyperlight-sandbox-backend-wasm --no-install-package hyperlight-sandbox-backend-hyperlight-js
42+
python-sync-env python-version="" $UV_PYTHON=(if python-version != "" { python-version } else { env(uv-python-env, "") }) python-version-arg=(if python-version != "" { python-version-flag + " " + python-version } else { "" }):
43+
uv sync {{python-version-arg}} --frozen --inexact --no-install-package hyperlight-sandbox-backend-wasm --no-install-package hyperlight-sandbox-backend-hyperlight-js
3744

3845
# Install maturin backends into the local venv for development (maturin develop).
3946
# This compiles the Rust backend crates and installs them as editable packages
4047
# in the local venv so you can `import hyperlight_sandbox` directly.
4148
# For distributable wheels, use `python-dist` (maturin build) instead.
4249
# Use `just python python-build` for debug, `just python python-build release` for release.
43-
python-install-backends profile="debug":
50+
[private]
51+
python-clean-backend-artifacts profile="debug":
4452
-{{ if profile == "release" { rmrf + " " + repo-root + "/target/release/build/hyperlight-wasm-*" } else { "" } }}
4553
-{{ if profile == "release" { rmrf + " " + repo-root + "/target/release/.fingerprint/hyperlight-wasm-*" } else { "" } }}
4654
-{{ if profile == "release" { rmrf + " " + repo-root + "/target/release/build/hyperlight-js-*" } else { "" } }}
4755
-{{ if profile == "release" { rmrf + " " + repo-root + "/target/release/.fingerprint/hyperlight-js-*" } else { "" } }}
48-
cd {{repo-root}}/src/sdk/python/wasm_backend && uv run --no-sync maturin develop {{ if profile == "release" { "--release" } else { "" } }}
49-
cd {{repo-root}}/src/sdk/python/hyperlight_js_backend && uv run --no-sync maturin develop {{ if profile == "release" { "--release" } else { "" } }}
5056

51-
python-build profile="debug": python-sync-guest-resources python-sync-env (python-install-backends profile)
57+
[private]
58+
python-develop-backend backend profile="debug" python-version="" $UV_PYTHON=(if python-version != "" { python-version } else { env(uv-python-env, "") }) python-version-arg=(if python-version != "" { python-version-flag + " " + python-version } else { "" }) profile-arg=(if profile == "release" { "--release" } else { "" }):
59+
uv run --directory {{python-root}}/{{backend}} --no-sync {{python-version-arg}} maturin develop {{profile-arg}}
60+
61+
python-install-backends profile="debug" python-version="": (python-clean-backend-artifacts profile) (python-develop-backend "wasm_backend" profile python-version) (python-develop-backend "hyperlight_js_backend" profile python-version)
62+
63+
python-build profile="debug" python-version="": python-sync-guest-resources (python-sync-env python-version) (python-install-backends profile python-version)
5264

5365
build: python-build
5466

@@ -81,20 +93,20 @@ python-publish repository="pypi":
8193
# Smoke-test the wheels in dist/pythonsdk/ by installing them into
8294
# isolated environments and running basic tests.
8395
# Requires `just python-dist` (root) to have been run first.
84-
python-wheelhouse-test python-version="":
85-
uv run --no-project {{ if python-version != "" { "--python " + python-version } else { "" } }} --no-index \
96+
python-wheelhouse-test python-version="" python-version-arg=(if python-version != "" { python-version-flag + " " + python-version } else { "" }):
97+
uv run --no-project {{python-version-arg}} --no-index \
8698
--find-links={{core-dist}} \
8799
--find-links={{wasm-wheels}} \
88100
--find-links={{python-guest-dist}} \
89101
--with "hyperlight-sandbox[wasm,python_guest]" \
90102
python {{repo-root}}/src/sdk/python/tests/wheelhouse_wasm_python.py
91-
uv run --no-project {{ if python-version != "" { "--python " + python-version } else { "" } }} --no-index \
103+
uv run --no-project {{python-version-arg}} --no-index \
92104
--find-links={{core-dist}} \
93105
--find-links={{wasm-wheels}} \
94106
--find-links={{javascript-guest-dist}} \
95107
--with "hyperlight-sandbox[wasm,javascript_guest]" \
96108
python {{repo-root}}/src/sdk/python/tests/wheelhouse_wasm_js.py
97-
uv run --no-project {{ if python-version != "" { "--python " + python-version } else { "" } }} --no-index \
109+
uv run --no-project {{python-version-arg}} --no-index \
98110
--find-links={{core-dist}} \
99111
--find-links={{hyperlight-js-wheels}} \
100112
--find-links={{javascript-guest-dist}} \
@@ -141,5 +153,5 @@ fmt-check:
141153
python-test: python-build
142154
uv run python -m unittest discover -s {{repo-root}}/src/sdk/python/core/tests -p 'test_*.py' -v
143155

144-
python-fuzz seconds="60": python-build
145-
{{ if os() == "windows" { "echo 'Skipping python fuzz (atheris not available on Windows)'" } else { "uv run --package hyperlight-sandbox --extra dev python " + repo-root + "/src/sdk/python/core/tests/fuzz_tool_dispatch.py -max_total_time=" + seconds } }}
156+
python-fuzz seconds="60": (python-build "debug" fuzz-python)
157+
{{ if os() == "windows" { "echo 'Skipping python fuzz (atheris not available on Windows)'" } else { "UV_PYTHON=" + fuzz-python + " uv run --python " + fuzz-python + " --package hyperlight-sandbox --extra dev python " + repo-root + "/src/sdk/python/core/tests/fuzz_tool_dispatch.py -max_total_time=" + seconds } }}

src/sdk/python/core/pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ readme = "README.md"
1010
license = "Apache-2.0"
1111
requires-python = ">=3.10"
1212
dependencies = []
13-
optional-dependencies = { wasm = ["hyperlight-sandbox-backend-wasm>=0.4.0"], hyperlight_js = ["hyperlight-sandbox-backend-hyperlight-js>=0.4.0"], python_guest = ["hyperlight-sandbox-python-guest>=0.4.0"], javascript_guest = ["hyperlight-sandbox-javascript-guest>=0.4.0"], dev = ["atheris>=2.3.0"] }
13+
optional-dependencies = { wasm = ["hyperlight-sandbox-backend-wasm>=0.4.0"], hyperlight_js = ["hyperlight-sandbox-backend-hyperlight-js>=0.4.0"], python_guest = ["hyperlight-sandbox-python-guest>=0.4.0"], javascript_guest = ["hyperlight-sandbox-javascript-guest>=0.4.0"], dev = ["atheris>=2.3.0; python_version < '3.13'"] }
1414
classifiers = [
1515
"Development Status :: 3 - Alpha",
1616
"Intended Audience :: Developers",
1717
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.10",
19+
"Programming Language :: Python :: 3.11",
20+
"Programming Language :: Python :: 3.12",
21+
"Programming Language :: Python :: 3.13",
22+
"Programming Language :: Python :: 3.14",
1823
"Programming Language :: Rust",
1924
"Operating System :: POSIX :: Linux",
2025
"Operating System :: Microsoft :: Windows",

src/sdk/python/hyperlight_js_backend/pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["maturin>=1.7,<2.0"]
2+
requires = ["maturin>=1.13.3,<2.0"]
33
build-backend = "maturin"
44

55
[project]
@@ -13,6 +13,11 @@ classifiers = [
1313
"Development Status :: 3 - Alpha",
1414
"Intended Audience :: Developers",
1515
"Programming Language :: Python :: 3",
16+
"Programming Language :: Python :: 3.10",
17+
"Programming Language :: Python :: 3.11",
18+
"Programming Language :: Python :: 3.12",
19+
"Programming Language :: Python :: 3.13",
20+
"Programming Language :: Python :: 3.14",
1621
"Programming Language :: Rust",
1722
"Operating System :: POSIX :: Linux",
1823
"Operating System :: Microsoft :: Windows",

src/sdk/python/wasm_backend/pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["maturin>=1.7,<2.0"]
2+
requires = ["maturin>=1.13.3,<2.0"]
33
build-backend = "maturin"
44

55
[project]
@@ -13,6 +13,11 @@ classifiers = [
1313
"Development Status :: 3 - Alpha",
1414
"Intended Audience :: Developers",
1515
"Programming Language :: Python :: 3",
16+
"Programming Language :: Python :: 3.10",
17+
"Programming Language :: Python :: 3.11",
18+
"Programming Language :: Python :: 3.12",
19+
"Programming Language :: Python :: 3.13",
20+
"Programming Language :: Python :: 3.14",
1621
"Programming Language :: Rust",
1722
"Operating System :: POSIX :: Linux",
1823
"Operating System :: Microsoft :: Windows",

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ description = "Packaged Hyperlight Wasm JavaScript guest exposed as javascript_g
99
readme = "README.md"
1010
license = "Apache-2.0"
1111
requires-python = ">=3.10"
12+
classifiers = [
13+
"Programming Language :: Python :: 3",
14+
"Programming Language :: Python :: 3.10",
15+
"Programming Language :: Python :: 3.11",
16+
"Programming Language :: Python :: 3.12",
17+
"Programming Language :: Python :: 3.13",
18+
"Programming Language :: Python :: 3.14",
19+
]
1220

1321
[tool.setuptools]
1422
packages = ["javascript_guest", "javascript_guest.resources"]

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ description = "Packaged Hyperlight Wasm Python guest exposed as python_guest.pat
99
readme = "README.md"
1010
license = "Apache-2.0"
1111
requires-python = ">=3.10"
12+
classifiers = [
13+
"Programming Language :: Python :: 3",
14+
"Programming Language :: Python :: 3.10",
15+
"Programming Language :: Python :: 3.11",
16+
"Programming Language :: Python :: 3.12",
17+
"Programming Language :: Python :: 3.13",
18+
"Programming Language :: Python :: 3.14",
19+
]
1220

1321
[tool.setuptools]
1422
packages = ["python_guest", "python_guest.resources"]

uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)