mamba-org / gator

Conda environment and package management extension from within Jupyter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kernel spec metadata discard existing fields

jtpio opened this issue · comments

Description

It looks like the original kernel spec metadata for a kernel is not kept when using the "conda version" of the kernel.

Reproduce

  1. Go to mybinder.org: https://mybinder.org/v2/gh/fcollonval/jupyter_conda/master?urlpath=lab
  2. Install xeus-python from the conda packages manager
  3. Do a GET /api/kernelspecs to retrieve the kernel specs (for example in the browser by entering: https://path/to/the/mybinder.org/api/kernelspecs)

Starting from version 0.8.0, xeus-python includes the debugger key in the kernel specs metadata.

However this key is not present in the metadata for xpython [conda env:notebook] *:

image

Expected behavior

The metadata for xpython [conda env:notebook] * should include debugger: true along conda_env_name and conda_env_path.

Context

Binder link on Firefox 77.

It looks like this actually comes from the underlying nb_conda_kernels?

https://github.com/Anaconda-Platform/nb_conda_kernels/blob/master/nb_conda_kernels/manager.py#L196-L199

spec['metadata'] = {
    'conda_env_name': env_name,
    'conda_env_path': env_path
}

@jtpio Indeed this is a bug in nb_conda_kernels. The metadata was not around at the beginning. And when I wrote the PR adding the conda environment info to the metadata, I did not think about propagating the one from the reference kernel.

Could you open an issue in that repository?

Thanks @fcollonval.

Yes I'll open an issue there 👍

A fix has been merged in the dependency package
anaconda/nb_conda_kernels#161

Perfect, thanks a lot @fcollonval!