diff --git a/packages/pyodide-kernel/src/tokens.ts b/packages/pyodide-kernel/src/tokens.ts index 13ace73f..2da75ab4 100644 --- a/packages/pyodide-kernel/src/tokens.ts +++ b/packages/pyodide-kernel/src/tokens.ts @@ -47,6 +47,11 @@ export namespace IPyodideWorkerKernel { */ indexUrl: string; + /** + * The URL from which Pyodide will load the pyodide-lock.json file + */ + pyodideLockFileURL: string; + /** * The URL of the `piplite` wheel for bootstrapping. */ diff --git a/packages/pyodide-kernel/src/worker.ts b/packages/pyodide-kernel/src/worker.ts index aaf3db49..2a33022e 100644 --- a/packages/pyodide-kernel/src/worker.ts +++ b/packages/pyodide-kernel/src/worker.ts @@ -38,7 +38,7 @@ export class PyodideRemoteKernel { } protected async initRuntime(options: IPyodideWorkerKernel.IOptions): Promise { - const { pyodideUrl, indexUrl } = options; + const { pyodideUrl, indexUrl, pyodideLockFileURL } = options; let loadPyodide: typeof Pyodide.loadPyodide; if (pyodideUrl.endsWith('.mjs')) { // note: this does not work at all in firefox @@ -50,7 +50,7 @@ export class PyodideRemoteKernel { importScripts(pyodideUrl); loadPyodide = (self as any).loadPyodide; } - this._pyodide = await loadPyodide({ indexURL: indexUrl }); + this._pyodide = await loadPyodide({ indexURL: indexUrl, lockFileURL: pyodideLockFileURL}); } protected async initPackageManager(