jupyter_server icon indicating copy to clipboard operation
jupyter_server copied to clipboard

Removing `nbconvert` as a required dependency

Open jamesbraza opened this issue 1 year ago • 4 comments

Problem

I have jupyterlab as a dependency, which depends on jupyter-server, which installs nbconvert.

Can we move nbconvert to an optional dependency via an extra?

The source code in https://github.com/jupyter-server/jupyter_server/tree/v2.12.5/jupyter_server/nbconvert already doesn't require it at import time, so the code is already compatible with this.

It seems https://github.com/jupyter-server/jupyter_server/issues/15 is related.

Proposed Solution

  1. Moving nbconvert to an optional extra
  2. Adding nbconvert as a test dependency

Additional context

N/a

jamesbraza avatar Jan 19 '24 22:01 jamesbraza

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Jan 19 '24 22:01 welcome[bot]

It's unlikely this is going to be accepted in jupyter-server, as it is a Jupyter server that comes with "essential" functionalities that dependencies expect, and nbconvert is one of them. Jupyverse on the other hand allows that, as it's a modular server where everything is a plugin. It's as easy as not installing fps-nbconvert.

davidbrochart avatar Jan 20 '24 09:01 davidbrochart

Seems making it a separate server extension is more reasonable. As nbconvert need more configuration when using LaTeX.

Wh1isper avatar Jan 22 '24 03:01 Wh1isper

I think making it a server extension is a reasonable ask.

We made a similar call with the terminals and mathjax APIs in Jupyter Server a few years back.

I agree that nbconvert feels more like an optional feature of Jupyter Server than a necessary requirement for a minimal Jupyter Server (there has been a lot of discussion previously about what makes a minimal Jupyter Server).

If you're really interested in separating out nbconvert, I think we could get this done without much resistance. We just need fingers at the keyboard.

Practically, the approach we took for e.g. terminals was:

  1. create a separate python package for the server extension
  2. move all of logic from that extension to this new package.
  3. merge and release the package.
  4. depend on this package in jupyter_server, at least for now. (Completely removing it would require a major release of jupyter server, since it changes our REST API surface).

By doing this, we would introduce a non-breaking change that would allow folks to at least disable nbconvert. In future (major) releases of Jupyter Server, we could drop the dependency if folks agree.

Zsailer avatar Jan 22 '24 17:01 Zsailer