A custom Jupyter KernelSpecManager that automatically discovers Nebi-tracked Pixi workspaces and exposes each environment as a launchable Jupyter kernel.
- Discovers locally-tracked workspaces via
nebi workspace list - Enumerates pixi environments per workspace via
pixi workspace environment list - Each (workspace, environment) pair appears as a selectable kernel in Jupyter
- Kernels launch via
pixi runin the workspace directory with full environment isolation
pip install nb-nebi-kernelsThat's it — the kernel spec manager is automatically configured when installed into your JupyterLab environment.
- Nebi CLI on your PATH
- Pixi on your PATH
- At least one tracked nebi workspace (
nebi initin a pixi project)
Once installed, any nebi-tracked pixi workspace appears as a kernel in JupyterLab or Notebook:
- A workspace
data-sciencewith environmentsdefaultandgpushows as two kernels: data-science (default) and data-science (gpu) - A workspace
web-appwith only the default environment shows as just web-app
If nebi or pixi are not installed, or no workspaces are tracked, Jupyter falls back to its default kernels — it never crashes.
# Install dev dependencies
pixi install -e dev
# Run tests
pixi run test
# Run tests with coverage
pixi run test-cov
# Run linting
pixi run lint
# Format code
pixi run format
# Run type checking
pixi run typechecksrc/nb_nebi_kernels/
├── __init__.py # Exports NebiKernelSpecManager
├── discovery.py # Subprocess calls to nebi + pixi CLIs
├── launcher.py # Kernel launcher with pixi environment isolation
└── manager.py # KernelSpecManager subclass (core logic)
- discovery.py — Parses
nebi workspace listoutput, callspixi workspace environment listper workspace. Filters out missing workspaces. Returns structured data. - launcher.py — Clears PIXI_* environment variables to prevent inheriting parent context, then exec's
pixi runin the workspace directory. - manager.py — Subclasses
KernelSpecManager, implementsfind_kernel_specs()andget_kernel_spec(). Merges parent kernels with nebi-discovered ones.
MIT