Remove debugpy as dependency?
debugpy is quite a heavy dependency, before it was a build dependency, but now it's standard:
It shows up as 28MB on disk
28M /Users/maartenbreddels/venvs/solara-size1/lib/python3.9/site-packages/debugpy
On pypi https://pypi.org/project/debugpy/#files it's ~5mb.
I'm not sure everyone needs a debugger, and in times of pyodide/pyscript, size matters :)
I think the code is already prepared for it (try block around the import).
IIRC debugpy (or ptvsd back in the days ;)) has been added as a dependency because users complained about it not being installed while they wanted to use the debugger. There was a discussion about making ipykernel able to work without debugpy, which led to the changes you mentioned. But the idea was to keep it by default as most people who use the debugger expect it to work out of the box, and give the possibility to packages managers to remove it.
I think the number of developers using jupyter is small (mostly non-devs I think), and the number of developers using debuggers also small. That makes the number of jupyter users using a debugger very small I think.
Also, with modern jupyter lab, we now have a place to put warnings/error messages, if we can give a user a proper message on what to do to install/enable it, would it be an option to remove it as a dependency?
if we can give a user a proper message on what to do to install/enable it, would it be an option to remove it as a dependency?
I thought about that too, but I see two problems with this approach:
- Users would have to install
debugpyon all environments they'd like to do some debugging on. - VSCode relies on
debugpyfor debugging and can easily start notebooks/consoles in different envs. So, I think this would be a serious regression for their users.
An alternative would be to create a new package called jupyter-kernel (for lack of a better name) that depends on ipykernel and debugpy. So, packages that prefer it could depend on ipykernel for a lighter set of dependencies.
As a side note, we don't rely on debugpy in Spyder-kernels (our own kernel on top of ipykernel), so we're very interested on this topic too.