Skip to content

Commit dfc9f46

Browse files
fhanauhoodmane
authored andcommitted
Provide non-mangled pyodide wheels path under WORKSPACE
1 parent 4bcc18e commit dfc9f46

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

build/deps/python.MODULE.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,6 @@ use_repo(
6969
"pyodide-snapshot-package_snapshot_fastapi-a6ccb56fe.bin",
7070
"pyodide-snapshot-package_snapshot_numpy-60c9cb28e.bin",
7171
"pyodide-snapshot-snapshot_a6b652a95810783f5078b9a5dbd4a07c30718acb4ff724e82c25db7353dd7f2d.bin",
72+
"pyodide_0.26.0a2_2024-03-01_75.capnp.bin",
73+
"pyodide_0.28.2_2025-01-16_6.capnp.bin",
7274
)

build/is_pyodide_bzlmod.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# workerd uses bzlmod for pyodide (and everything else)
2+
is_pyodide_bzlmod = True

src/workerd/server/tests/python/py_wd_test.bzl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@//:build/is_pyodide_bzlmod.bzl", "is_pyodide_bzlmod")
12
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
23
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
34
load("//:build/python_metadata.bzl", "BUNDLE_VERSION_INFO")
@@ -32,7 +33,15 @@ def _py_wd_test_helper(
3233

3334
pkg_tag = BUNDLE_VERSION_INFO[python_flag]["packages"]
3435
data = data + ["@all_pyodide_wheels_%s//:whls" % pkg_tag]
35-
args = args + ["--pyodide-package-disk-cache-dir", "../all_pyodide_wheels_%s" % pkg_tag]
36+
args = args + ["--pyodide-package-disk-cache-dir"]
37+
38+
# TODO(cleanup): We support both mangled and non-mangled wheels paths for now, clean up once
39+
# downstream repo fully uses bzlmod
40+
if is_pyodide_bzlmod:
41+
# +pyodide+ is a bzlmod canonical repository name
42+
args.append("../+pyodide+all_pyodide_wheels_%s" % pkg_tag)
43+
else:
44+
args.append("../all_pyodide_wheels_%s" % pkg_tag)
3645

3746
load_snapshot = None
3847
pyodide_version = BUNDLE_VERSION_INFO[python_flag]["real_pyodide_version"]

0 commit comments

Comments
 (0)