jupyterlite / jupyterlite/pyodide-kernel

Improve the wrapper kernel experience for downstreams

Open
#28 6 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
90
Forks
47
Avg merge
3d 13h
Merged PRs (30d)
11

Description

### Problem

Today, it's possible to reuse the kernel labextension to get up to something that runs on top of all of the pyodide machinery, but it's still pretty non-trivial.

Upstream, `ipykernel` provides `KernelBase`, which makes it quite easy to depend on `ipykernel`, and create another, separately-branded kernel which only has to override the parts you want (or the full `IPyKernel`).

### Proposed Solution

In this repo, or a new one, add, document, and test a [cookiecutter](https://cookiecutter.readthedocs.io/en/stable/) or [copier](https://copier.readthedocs.io/en/stable/) that makes it easier to build new, PyPI- and npm-distributable kernels that depend on `jupyterlite-pyodide-kernel`.

### Additional context

The two in-the-wild downstream kernels I've worked on are
- [pidgy](https://github.com/deathbeds/pidgy/tree/main/lite/jupyterlite-pidgy) (lead by @tonyfast)
- [robotkernel](https://github.com/robots-from-jupyter/robotkernel/tree/master/lite) (lead by @datakurre)

Today, they still pretty much need to be hard forks, but with the split from `jupyterlite(_core)`, it should be much easier to do this _simply_ now.

If in a new repo, it might be a bit simpler, but runs the risk of getting out-of-date.

If this was included in-tree, it could be tested (up to CI, which is tricky without `act`-in-GHA, which is kinda nasty). `copier` makes it a good deal easier to properly package these things, and could be made to extend the as-shipped CLI (behind an `[extra]`, i guess).

#### A Future Family Tree of Kernels

```mermaid
flowchart LR

classDef abstract stroke-dasharray:4px

kernel:::abstract --> worker:::abstract --> js --> pyodide

js --> p5
worker --> xeus-*
kernel --> webr
pyodide --> pidgy
pyodide --> robot
pyodide --> lite-builder[#33: lite-in-pyodide]
kernel --> remote:::abstract
remote --> binder

subgraph third-party
pidgy
robot
webr
remote
binder
end

subgraph legend
abstract[abstract\nimplementation]:::abstract
end
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.