-
Notifications
You must be signed in to change notification settings - Fork 948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Widgetslabextension package #2806
Comments
I've been going back and forth on this thought too over the last year or two. This also follows on other discussions we had at the widgets dev sprint about splitting up how our dependencies work, and in particular how the widgetsnbextension package works and what pulls it in. Another factor here is that JupyterLab is improving its extension manager support, so it should be much easier to find and install an extension from within JupyterLab. Arguably that is the more theoretically correct solution, since the frontend and backend really are separate places to install things. On the other hand, having another way to distribute the js is probably not a bad thing, other than being confusing that there is one more way to install the lab extension (do I go through the lab extension manager, or through the lab command line, or this new python package?) |
From a user perspective, being able to have a working notebook just doing:
is super nice. I would love to see the same happen with JupyterLab. I know it is more complicated than that with JupyterLab because of the deduplication, but I guess we can at least allow to turn the following:
into a simpler:
Not only it is simpler, but it is also safer because there is no mismatch between the Python and JS packages version.
I guess the same kinds of discussions would rise if we make a I guess I'm in favor of usability, and have |
Right now ipywidgets depends on widgetsnbextension. The thought from @SylvainCorlay was that we break that dependency, I think? Maybe it was that we have a ipywidgets base package that just installs the kernel python package, then an ipywidgets package that installs ipywidgets base, widgetsnbextension, and a lab extension python package. |
Note that this is only simpler if JupyterLab and your kernel are in the same python environment. If you are running multiple kernels from different environments, things are more complicated again. Though probably the most common case by far is jlab and the kernel being in the same environment. |
I like the idea. An important question then is: does |
I would like Maybe the only other package should be called Also, |
Concerning the name, doesn't it bring more confusion? I think of libraries like |
This may actually align the planets, since the |
Perhaps |
it is also the xwidgets frontend 😄 |
Actually, I do like |
One important aspect of |
or |
So deprecate I still think it would be nice to have an ipywidgets_base with just the python, and ipywidgets pulls in both the kernel and the frontend packages. That's definitely more convenient. |
meh. I think that people can understand that they need to install the "frontend" (actualy more than having to install the "notebook extension"). Or we keep the dependency to the front-end, (which can be installed without harm in the kernel environment) as long as the front-end package is only static assets and does not depend on jupyer_server, notebook, or lab... |
I see what you did there... :) |
The moons? |
👍 |
I agree, or, what people use a lot is a core postfix, ipywidgets-core. So Basically ipywidgets is there to get you everything, including the kitchensink. But for those that care about setting up clean environments, they would install ipywidgets-core in the kernels, and jupyter-widgets in the jupyter-server side? |
No. If they only want notebook, we shouldn't be pulling in lab, and vice versa. Other than that, it sounds okay to me, though it would be nice if we had a better name than jupyter_widgets to convey that it is the package for frontends. |
I really don't like Keeping the |
Actually, I don't care so much how we name and, and almost nobody will care I think, or pay attention to it. It's more an internal thing to split things up right? But I'm also ok not yet splitting off a yet. I think the most important step is to get the tgz bundle in so jupyter lab picks it up. |
Now that widgets supports JLab 2, we can renew our push towards ipywidgets 8, and make this one of the features? |
For matplotlib-base, I found this very confusing. I don't know what's not in it etc... |
But as a user, I'm not so aware of it. I've been it pass by my screen when installing with a pip install, but I have no idea what it does, nor do I care or have to care right? |
Well, you tend to be super quickly because of all the size of the pyqt dependency, or because the requirement of pyqt conflicts with your own... |
I could do it. Maybe we could split it in two stages? 1:
2:
|
I think I can come up with a PR for the first stage today |
One annoying issue that will remain is that having multiple version of the frontend extension is still not easy. (e.g. some older bqplot version for python 2). so maybe the frontend version could be more strictly versioned right in the name (e.g. |
I was looking at this more today. |
Or I'm getting to like better just |
Another thought on this: right now, JupyterLab is getting more intelligent with how to install compatible extensions. For example, we just had a JupyterLab 2.0 release. This did not require any ipywidgets python package releases. Instead, How would this JupyterLab 2.0 release go if we had this jupyter_widgets package that bundled the js? Let's assume we had jupyter_widgets 1.0 that supports jlab 1. Now we release jlab 2 and people upgrade to it. Now people either need to install jupyter_widgets 2.0, or manually install the jupyter lab extension to override the js bundled in jupyter_widgets 1.0. Also, how would people with JLab 1.0 know to install jupyter_widgets 1.0 instead of the latest jupyter_widgets 2.0? And if ipywidgets depended on jupyter_widgets, that now means that ipywidgets has to bump its version number too, and which should it depend on, 1.0 or 2.0 or both? |
The manual install =
If I create such an env (env with lab 2.0,
Running
I'm not sure if all of this will be more or less intuitive than it is today, but I'm trying to say that we can at least build a set of instructions that will work.
This is trickier. I'm not entirely sure how this version linking is proposed to be done, but if we are version linking them (ipywidgets@X --> jupyter-widgets@Y.*), then that version link should ideally represent the protocol version? Hm... |
One mismatch here is that the right frontend things to be installed depends on the frontend, not on the kernel-side ipywidgets. So really it is most natural to have these two installations to be independent of each other. |
So what if the new instructions were to do |
How could we constrain the version in pip? We'd need to say somehow that if you have notebook installed, it should be in this version range, but not to explicitly install the notebook if you don't already have it installed. |
pip does have a constraints file concept: https://pip.readthedocs.io/en/stable/user_guide/#constraints-files - but that doesn't apply for installation requirements, I think. |
Two thoughts:
|
I don't think I fully grasp the nuance of the dependency resolution problems but given:
is there any possibility of Big 👍 to anything the removes the need to run
Related to the first quote is there any way to raise an error in python when the widget versions don't match or jupyterlab-manager is not present? The failure state of mismatched javascript version or equivalent can be very opaque especially if someone doesn't know about the webdev console. |
The status as of now (ipywidgets 7.6) is that ipywidgets requires widgetsnbextension (which in turn requires For ipywidgets 8, the plan is to have ipywidgets require The end result is that As such, I think the main concerns raised here are now resolved. If anyone feels otherwise, please reopen or comment below. |
Sorry in advance if an issue was already opened for this.
After a long discussion with @maartenbreddels yesterday we agreed that installing an interactive widgets library for JupyterLab is too complicated for users, and very error-prone. We think it might scare people off and result in giving up trying to use our extensions.
One of the issues we discussed was that when doing:
You might get a Python package that is incompatible with the JS package, resulting in the
Widget model not found
error in JupyterLab.@maartenbreddels @mariobuikhuizen and I think @vidartf went around this specific issue in their extensions by putting a
tgz
of the JS package undershare/jupyter/lab/extensions
, allowing JupyterLab to find the package and rebuild itself (either from the GUI or doingjupyter lab build
).This ensures having a version of the JS package compatible with the Python package. One would argue it makes the Python package dependent on the JS package, and I would agree it's not a good thing, but usability would be improved.
I would like to propose doing the same thing in ipywidgets, with a new
widgetslabextension
package (widgetsnbextension
counterpart) which installs thetgz
at the right place.The only thing I am not sure about is how this package would be installed. Should it be a JupyterLab dependency? An ipywidgets dependency? Should the user install it manually?
I can come up with a PR myself if nobody is against it.
The text was updated successfully, but these errors were encountered: