mamba-org / gator

Conda environment and package management extension from within Jupyter
Other
260 stars 30 forks source link

Kernel spec metadata discard existing fields #45

Closed jtpio closed 4 years ago

jtpio commented 4 years ago

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.

jtpio commented 4 years ago

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
}
fcollonval commented 4 years ago

@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?

jtpio commented 4 years ago

Thanks @fcollonval.

Yes I'll open an issue there :+1:

fcollonval commented 4 years ago

Thanks!

jtpio commented 4 years ago

Opened https://github.com/Anaconda-Platform/nb_conda_kernels/issues/160

fcollonval commented 4 years ago

A fix has been merged in the dependency package https://github.com/Anaconda-Platform/nb_conda_kernels/pull/161

jtpio commented 4 years ago

Perfect, thanks a lot @fcollonval!