jupyterlite / pyodide-kernel

Python kernel for JupyterLite powered by Pyodide
https://jupyterlite-pyodide-kernel.readthedocs.io/en/latest/_static/
BSD 3-Clause "New" or "Revised" License
46 stars 23 forks source link

Support multiple `pyodide` kernelspecs #83

Open bollwyvl opened 7 months ago

bollwyvl commented 7 months ago

Problem

At present, the server extension registers a single kernelspec, and each kernel session is started with exactly that configuration.

In looking at supporting pyodide-lock (a la #49), a number of techniques currently in use, such as maintaining multiple versions of patched upstreams in the Warehouse all.json, will no longer work for the general case.

As a single pyodide-lock.json can only include one (or zero) version of each named package. The "interactive" solver will have less opportunity to load the "correct" package for corner cases, especially for a general purpose interactive site (as opposed to a well-engineered environment to complement some learning goals). Consider:

Open two notebooks, side-by-side, with two versions of the same package installed via notebook 1 notebook 2
%pip install some-package=x.y %pip install some-package=x.z
import some_package import some_package
%timeit some_package.some_func() %timeit some_package.some_func()

Compare the run times.

Proposed Solution

Offer a way to more deeply configure the default python kernlspec, and create extra named kernelspecs which could have separate:

Additional context

For site users

For site owners

Out of scope