Skip to content

Commit 1821adb

Browse files
committed
maybe fix
1 parent 0ab66cc commit 1821adb

File tree

2 files changed

+65
-43
lines changed

2 files changed

+65
-43
lines changed

build/deps/dep_pyodide.bzl

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -44,38 +44,6 @@ filegroup(
4444

4545
SNAPSHOT_R2 = "https://pyodide-capnp-bin.edgeworker.net/"
4646

47-
def _snapshot_http_file(bundle_name, folder, snapshot, integrity, hash, r2_base = SNAPSHOT_R2):
48-
if not snapshot:
49-
return
50-
if not integrity:
51-
fail("Snapshot %s from bundle %s has missing integrity" % (snapshot, bundle_name))
52-
if folder == "baseline-snapshot/":
53-
key = hash
54-
else:
55-
key = snapshot
56-
http_file(
57-
name = "pyodide-snapshot-" + snapshot,
58-
integrity = integrity,
59-
url = r2_base + folder + key,
60-
)
61-
62-
def _snapshot_http_files(
63-
name,
64-
baseline_snapshot = None,
65-
baseline_snapshot_hash = None,
66-
baseline_snapshot_integrity = None,
67-
numpy_snapshot = None,
68-
numpy_snapshot_integrity = None,
69-
fastapi_snapshot = None,
70-
fastapi_snapshot_integrity = None,
71-
dedicated_fastapi_snapshot = None,
72-
dedicated_fastapi_snapshot_integrity = None,
73-
**_kwds):
74-
_snapshot_http_file(name, "baseline-snapshot/", baseline_snapshot, baseline_snapshot_integrity, baseline_snapshot_hash)
75-
_snapshot_http_file(name, "test-snapshot/", numpy_snapshot, numpy_snapshot_integrity, None)
76-
_snapshot_http_file(name, "test-snapshot/", fastapi_snapshot, fastapi_snapshot_integrity, None)
77-
_snapshot_http_file(name, "", dedicated_fastapi_snapshot, dedicated_fastapi_snapshot_integrity, None, VENDOR_R2)
78-
7947
def dep_pyodide():
8048
for info in PYODIDE_VERSIONS:
8149
_pyodide_core(**info)
@@ -87,10 +55,48 @@ def dep_pyodide():
8755
for info in PYTHON_LOCKFILES:
8856
_pyodide_packages(**info)
8957

58+
# Accumulator to de-duplicate generated http_file rules.
59+
gen_http_file = {}
60+
61+
def _snapshot_http_files(
62+
name,
63+
baseline_snapshot = None,
64+
baseline_snapshot_hash = None,
65+
baseline_snapshot_integrity = None,
66+
numpy_snapshot = None,
67+
numpy_snapshot_integrity = None,
68+
fastapi_snapshot = None,
69+
fastapi_snapshot_integrity = None,
70+
dedicated_fastapi_snapshot = None,
71+
dedicated_fastapi_snapshot_integrity = None,
72+
**_kwds):
73+
def _snapshot_http_file(bundle_name, folder, snapshot, integrity, hash, r2_base = SNAPSHOT_R2):
74+
if not snapshot:
75+
return
76+
if not integrity:
77+
fail("Snapshot %s from bundle %s has missing integrity" % (snapshot, bundle_name))
78+
if folder == "baseline-snapshot/":
79+
key = hash
80+
else:
81+
key = snapshot
82+
gen_http_file[snapshot] = struct(
83+
integrity = integrity,
84+
url = r2_base + folder + key,
85+
)
86+
87+
_snapshot_http_file(name, "baseline-snapshot/", baseline_snapshot, baseline_snapshot_integrity, baseline_snapshot_hash)
88+
_snapshot_http_file(name, "test-snapshot/", numpy_snapshot, numpy_snapshot_integrity, None)
89+
_snapshot_http_file(name, "test-snapshot/", fastapi_snapshot, fastapi_snapshot_integrity, None)
90+
_snapshot_http_file(name, "", dedicated_fastapi_snapshot, dedicated_fastapi_snapshot_integrity, None, VENDOR_R2)
91+
9092
for ver in BUNDLE_VERSION_INFO.values():
91-
if ver["name"] == "development" or ver["name"] == "0.26.0a2":
92-
continue # development is a copy of earlier bundle snapshots
9393
_snapshot_http_files(**ver)
94+
for snapshot, info in gen_http_file.items():
95+
http_file(
96+
name = "pyodide-snapshot-" + snapshot,
97+
integrity = info.integrity,
98+
url = info.url,
99+
)
94100

95101
def _impl(module_ctx):
96102
dep_pyodide()

build/deps/python.MODULE.bazel

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,26 @@ pip.parse(
2020
use_repo(pip, "py_deps", "v8_python_deps")
2121

2222
pyodide = use_extension("//build/deps:dep_pyodide.bzl", "pyodide")
23+
24+
[
25+
use_repo(
26+
pyodide,
27+
"{}_src_{}".format(library, version),
28+
)
29+
for version in [
30+
"0.26.0a2",
31+
"0.28.2",
32+
"development",
33+
]
34+
for library in [
35+
"beautifulsoup4",
36+
"fastapi",
37+
"python-workers-runtime-sdk",
38+
]
39+
]
40+
2341
use_repo(
2442
pyodide,
25-
"beautifulsoup4_src_0.26.0a2",
26-
"beautifulsoup4_src_0.28.2",
27-
"beautifulsoup4_src_development",
28-
"fastapi_src_0.26.0a2",
29-
"fastapi_src_0.28.2",
30-
"fastapi_src_development",
3143
"pyodide-0.26.0a2",
3244
"pyodide-0.28.2",
3345
"pyodide-lock_20240829.4.json",
@@ -38,10 +50,14 @@ use_repo(
3850
# "pyodide-snapshot-ew-py-package-snapshot_numpy-v2.bin",
3951
"pyodide-snapshot-package_snapshot_fastapi-a6ccb56fe.bin",
4052
"pyodide-snapshot-package_snapshot_numpy-60c9cb28e.bin",
41-
"python-workers-runtime-sdk_src_0.26.0a2",
42-
"python-workers-runtime-sdk_src_0.28.2",
43-
"python-workers-runtime-sdk_src_development",
4453
# "scipy_src_0.26.0a2",
4554
# "scipy_src_0.28.2",
4655
# "scipy_src_development",
56+
"all_pyodide_wheels_20240829.4",
57+
"all_pyodide_wheels_20250808",
58+
"pyodide-snapshot-baseline-61eedf943.bin",
59+
"pyodide-snapshot-ew-py-package-snapshot_fastapi-v2.bin",
60+
"pyodide-snapshot-ew-py-package-snapshot_numpy-v2.bin",
61+
"pyodide-snapshot-snapshot_a6b652a95810783f5078b9a5dbd4a07c30718acb4ff724e82c25db7353dd7f2d.bin",
62+
"shapely_src_0.28.2",
4763
)

0 commit comments

Comments
 (0)