Skip to content

Commit

Permalink
Address nits
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettgu10 committed Apr 22, 2024
1 parent 8810715 commit 0f63bb7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
13 changes: 6 additions & 7 deletions src/pyodide/internal/loadPackage.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,12 @@ export async function loadPackages(Module, requirements) {

console.log("Loading " + loading.join(", "));

await Promise.all(loadPromises).then((buffers) => {
for (const [requirement, buffer] of buffers) {
const reader = new ArrayBufferReader(buffer);
const [tarInfo, soFiles] = parseTarInfo(reader);
SITE_PACKAGES.addSmallBundle(tarInfo, soFiles, requirement);
}
});
const buffers = await Promise.all(loadPromises);
for (const [requirement, buffer] of buffers) {
const reader = new ArrayBufferReader(buffer);
const [tarInfo, soFiles] = parseTarInfo(reader);
SITE_PACKAGES.addSmallBundle(tarInfo, soFiles, requirement);
}

console.log("Loaded " + loading.join(", "));

Expand Down
1 change: 0 additions & 1 deletion src/pyodide/internal/python.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ async function prepareWasmLinearMemory(Module) {
}

export async function loadPyodide(lockfile, indexURL) {
console.log("loading pyodide");
const emscriptenSettings = getEmscriptenSettings(lockfile, indexURL);
const Module = await enterJaegerSpan("instantiate_emscripten", () =>
instantiateEmscriptenModule(emscriptenSettings),
Expand Down
4 changes: 2 additions & 2 deletions src/pyodide/internal/setupPackages.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export function buildSitePackages(requirements) {

let LOAD_WHEELS_FROM_R2 = true;
let requirementsInBigBundle = new Set([...STDLIB_PACKAGES]);
if(bigTarInfo.children.size > 10) {
if (bigTarInfo.children.size > 10) {
LOAD_WHEELS_FROM_R2 = false;
requirements.forEach(r => requirementsInBigBundle.add(r));
}
Expand All @@ -140,7 +140,7 @@ export function patchLoadPackage(pyodide) {
}

function disabledLoadPackage() {
throw new Error("pyodide.loadPackage is disabled");
throw new Error("pyodide.loadPackage is disabled because packages are encoded in the binary");
}

/**
Expand Down

0 comments on commit 0f63bb7

Please sign in to comment.