Skip to content

Commit 2abb6bb

Browse files
committed
Simplify Python version Justfile args
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent a164097 commit 2abb6bb

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/sdk/python/Justfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ python-sync-guest-resources:
3939
# Install pure Python dependencies from the lockfile into the local venv.
4040
# Skips the two Rust backend packages — those are compiled and installed
4141
# separately by `python-install-backends` via `maturin develop`.
42-
python-sync-env python-version="":
43-
{{ if python-version != "" { if os() == "windows" { "$env:UV_PYTHON = '" + python-version + "'; " } else { "UV_PYTHON=" + python-version + " " } } else { "" } }}uv sync {{ if python-version != "" { "--python " + python-version } else { "" } }} --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
4444

4545
# Install maturin backends into the local venv for development (maturin develop).
4646
# This compiles the Rust backend crates and installs them as editable packages
@@ -55,8 +55,8 @@ python-clean-backend-artifacts profile="debug":
5555
-{{ if profile == "release" { rmrf + " " + repo-root + "/target/release/.fingerprint/hyperlight-js-*" } else { "" } }}
5656

5757
[private]
58-
python-develop-backend backend profile="debug" python-version="" $UV_PYTHON=(if python-version != "" { python-version } else { env(uv-python-env, "") }):
59-
uv run --directory {{python-root}}/{{backend}} --no-sync {{ if python-version != "" { python-version-flag + " " + python-version } else { "" } }} maturin develop {{ if profile == "release" { "--release" } else { "" } }}
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}}
6060

6161
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)
6262

@@ -93,20 +93,20 @@ python-publish repository="pypi":
9393
# Smoke-test the wheels in dist/pythonsdk/ by installing them into
9494
# isolated environments and running basic tests.
9595
# Requires `just python-dist` (root) to have been run first.
96-
python-wheelhouse-test python-version="":
97-
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 \
9898
--find-links={{core-dist}} \
9999
--find-links={{wasm-wheels}} \
100100
--find-links={{python-guest-dist}} \
101101
--with "hyperlight-sandbox[wasm,python_guest]" \
102102
python {{repo-root}}/src/sdk/python/tests/wheelhouse_wasm_python.py
103-
uv run --no-project {{ if python-version != "" { "--python " + python-version } else { "" } }} --no-index \
103+
uv run --no-project {{python-version-arg}} --no-index \
104104
--find-links={{core-dist}} \
105105
--find-links={{wasm-wheels}} \
106106
--find-links={{javascript-guest-dist}} \
107107
--with "hyperlight-sandbox[wasm,javascript_guest]" \
108108
python {{repo-root}}/src/sdk/python/tests/wheelhouse_wasm_js.py
109-
uv run --no-project {{ if python-version != "" { "--python " + python-version } else { "" } }} --no-index \
109+
uv run --no-project {{python-version-arg}} --no-index \
110110
--find-links={{core-dist}} \
111111
--find-links={{hyperlight-js-wheels}} \
112112
--find-links={{javascript-guest-dist}} \

0 commit comments

Comments
 (0)