anaconda / nb_conda_kernels

Package for managing conda environment-based kernels inside of Jupyter
BSD 3-Clause "New" or "Revised" License
601 stars 70 forks source link

Include kernel name and prefix in `metadata` #261

Closed krassowski closed 7 months ago

krassowski commented 7 months ago

:wave: thanks for maintaining this project! I would like to raise a tiny enhancement request to address the following use case: while display_name can be customized, the frontends such as JupyterLab or Notebook cannot display structured or formatted information about the environment and kernel. I would propose to store the kernel name, kernel prefix, and all other arguments as passed to name_format in the kernelspec metadata. The metadata already includes the environment name and path:

https://github.com/Anaconda-Platform/nb_conda_kernels/blob/a793d252197fc9963e1802c5a6a6465d3ebc7c3a/nb_conda_kernels/manager.py#L313-L318

but the remaining bits used for display_name assembly are not stored:

https://github.com/Anaconda-Platform/nb_conda_kernels/blob/a793d252197fc9963e1802c5a6a6465d3ebc7c3a/nb_conda_kernels/manager.py#L291-L309

This would enable us - for example - to display a something like:

<b>{environment}</b>
<ul>
  <li>Kernel: {kernel}
  <li>Language: {language}
</ul>
dharhas commented 7 months ago

@AlbertDeFusco @mcg1969

This is blocking an improved launcher we are building for jupyterlab. Could we get a review/merge? Thanks.