Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute WORKERD_INDEX_URL instead of embedding from pyodide_bucket.bzl. #3400

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions src/pyodide/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@capnp-cpp//src/capnp:cc_capnp_library.bzl", "cc_capnp_library")
load("//:build/capnp_embed.bzl", "capnp_embed")
load("//:build/js_file.bzl", "js_file")
load("//:build/pyodide_bucket.bzl", "PYODIDE_PACKAGE_BUCKET_URL")
load("//:build/python_metadata.bzl", "PYTHON_LOCKFILES")
load("//:build/wd_ts_bundle.bzl", "wd_ts_bundle")

Expand Down Expand Up @@ -172,16 +171,6 @@ REPLACEMENTS = [
],
]

PYODIDE_BUCKET_MODULE = json.encode({
"PYODIDE_PACKAGE_BUCKET_URL": PYODIDE_PACKAGE_BUCKET_URL,
})

write_file(
name = "pyodide-bucket.json@rule",
out = "generated/pyodide-bucket.json",
content = [PYODIDE_BUCKET_MODULE],
)

expand_template(
name = "pyodide.asm.js@rule",
out = "generated/pyodide.asm.js",
Expand Down Expand Up @@ -255,15 +244,11 @@ wd_ts_bundle(
eslintrc_json = "eslint.config.mjs",
import_name = "pyodide",
internal_data_modules = INTERNAL_DATA_MODULES,
internal_json_modules = [
"generated/pyodide-bucket.json",
],
internal_modules = INTERNAL_MODULES,
js_deps = [
"generated/emscriptenSetup",
"pyodide.asm.wasm@rule",
"python_stdlib.zip@rule",
"pyodide-bucket.json@rule",
],
lint = False,
modules = MODULES,
Expand Down Expand Up @@ -298,7 +283,6 @@ genrule(
":pyodide-internal_generated_emscriptenSetup.js",
":pyodide-internal_generated_pyodide.asm.wasm",
":pyodide-internal_generated_python_stdlib.zip",
":pyodide-internal_generated_pyodide-bucket.json",
],
outs = ["pyodide.capnp.bin"],
cmd = " ".join([
Expand Down
8 changes: 5 additions & 3 deletions src/pyodide/internal/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { default as MetadataReader } from 'pyodide-internal:runtime-generated/metadata';
import { default as PYODIDE_BUCKET } from 'pyodide-internal:generated/pyodide-bucket.json';
import { default as ArtifactBundler } from 'pyodide-internal:artifacts';

export const IS_WORKERD = MetadataReader.isWorkerd();
export const IS_TRACING = MetadataReader.isTracing();
export const SHOULD_SNAPSHOT_TO_DISK = MetadataReader.shouldSnapshotToDisk();
export const IS_CREATING_BASELINE_SNAPSHOT =
MetadataReader.isCreatingBaselineSnapshot();
export const WORKERD_INDEX_URL = PYODIDE_BUCKET.PYODIDE_PACKAGE_BUCKET_URL;
export const PACKAGES_VERSION = MetadataReader.getPackagesVersion();
export const WORKERD_INDEX_URL =
'https://pyodide-packages.runtime-playground.workers.dev/' +
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should transition this to non-playground

PACKAGES_VERSION +
'/';
export const LOAD_WHEELS_FROM_R2: boolean = IS_WORKERD;
export const LOAD_WHEELS_FROM_ARTIFACT_BUNDLER =
MetadataReader.shouldUsePackagesInArtifactBundler();
export const PACKAGES_VERSION = MetadataReader.getPackagesVersion();
export const LOCKFILE: PackageLock = JSON.parse(
MetadataReader.getPackagesLock()
);
Expand Down
8 changes: 0 additions & 8 deletions src/pyodide/types/pyodide-bucket.d.ts

This file was deleted.

Loading