Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move to piplite
Browse files Browse the repository at this point in the history
Carreau committed Jan 10, 2025
1 parent 8bceffa commit ed23289
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion packages/pyodide-kernel-extension/src/index.ts
Original file line number Diff line number Diff line change
@@ -59,7 +59,6 @@ const kernel: JupyterLiteServerPlugin<void> = {
const disablePyPIFallback = !!config.disablePyPIFallback;
const loadPyodideOptions = config.loadPyodideOptions || {};
const extraPackagesAndIndexes = config.extraPackagesAndIndexes || [];
console.log('extraPackagesAndIndexes', extraPackagesAndIndexes, config);

for (const [key, value] of Object.entries(loadPyodideOptions)) {
if (key.endsWith('URL') && typeof value === 'string') {
2 changes: 0 additions & 2 deletions packages/pyodide-kernel/src/_pypi.ts
Original file line number Diff line number Diff line change
@@ -2,8 +2,6 @@
export * as allJSONUrl from '../pypi/all.json';
export * as ipykernelWheelUrl from '../pypi/ipykernel-6.9.2-py3-none-any.whl';
export * as pipliteWheelUrl from '../pypi/piplite-0.5.0-py3-none-any.whl';
export * as pipliteWheelUrl1 from '../pypi/piplite-0.5.0b0-py3-none-any.whl';
export * as pyodide_kernelWheelUrl from '../pypi/pyodide_kernel-0.5.0-py3-none-any.whl';
export * as pyodide_kernelWheelUrl1 from '../pypi/pyodide_kernel-0.5.0b0-py3-none-any.whl';
export * as widgetsnbextensionWheelUrl from '../pypi/widgetsnbextension-3.6.999-py3-none-any.whl';
export * as widgetsnbextensionWheelUrl1 from '../pypi/widgetsnbextension-4.0.999-py3-none-any.whl';
8 changes: 4 additions & 4 deletions packages/pyodide-kernel/src/worker.ts
Original file line number Diff line number Diff line change
@@ -105,14 +105,14 @@ export class PyodideRemoteKernel {
const { extraPackagesAndIndexes } = this._options as IPyodideWorkerKernel.IOptions;
if (extraPackagesAndIndexes.length > 0) {
// note that here pkg can be a package name or a wheel url
for (let { packages: pkgs, indexes } of extraPackagesAndIndexes) {
for (const { packages: pkgs, indexes } of extraPackagesAndIndexes) {
let installCmd: string;
if (indexes === null) {
installCmd = `import micropip\nawait micropip.install(${JSON.stringify(pkgs)}, keep_going=True)`;
installCmd = `await piplite.install(${JSON.stringify(pkgs)}, keep_going=True)`;
} else {
installCmd = `import micropip\nawait micropip.install(${JSON.stringify(pkgs)}, index_urls=${JSON.stringify(indexes)}, keep_going=True)`;
installCmd = `await piplite.install(${JSON.stringify(pkgs)}, index_urls=${JSON.stringify(indexes)}, keep_going=True)`;
}
console.info('installCmd', installCmd);
console.info('installing via cmd:', installCmd);
try {
await this._pyodide.runPythonAsync(installCmd);
console.info(`Package ${pkgs} Installed successfully`);

0 comments on commit ed23289

Please sign in to comment.