-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Jupyterlab 3.x.x support #2994
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
Comments
It will be also nice to have an option to disable version check during install. Who knows, maybe it doesn't have any breaking changes. |
I've tested locally by cloning plotly.py repo and modifying the package.json line 34 to:
So far so good, no issues. So steps to try that workaround:
mkdir EXT
cd EXT
git clone https://github.com/plotly/plotly.py.git
cd .\plotly.py\packages\javascript\jupyterlab-plotly\
"@jupyterlab/rendermime-interfaces": "^1.3.0 || ^2.0.0 || ^3.0.0",
npm instal
npm run build
jupyter labextension install
jupyter labextension list returns something like:
Ready to test v3 compat ! |
Although the workaround from @bdecato installs the plugin. |
@cvanelteren did you install Jupyter widgets extension:
Official doc say it's optional but maybe needed for widgets in ipywidgets. |
Yes I have. For the time being I downgraded jupyerlab back down.
On Sun, 3 Jan 2021 at 10:10, nabetse ***@***.***> wrote:
@cvanelteren <https://github.com/cvanelteren> did you install *Jupyter
widgets extension*:
jupyter labextension install @jupyter-widgets/jupyterlab-manager ***@***.***
Official doc say it's optional but maybe needed for widgets in ipywidgets.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2994 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEUVDV74GKQVOMHKRHVMYLLSYAX7ZANCNFSM4VJKLKEA>
.
--
- Checkout my website <https://cvanelteren.github.io/> for contact info
and current projects!
|
FYI, see the ipywidgets changelog for instructions for maintainers to upgrade widgets packages: https://ipywidgets.readthedocs.io/en/stable/changelog.html#updates-for-widget-maintainers |
CC @nicolaskruchten - see my comment above for tips to upgrade for JupyterLab 3. This hopefully should be a pretty straightforward upgrade. |
Hi @jasongrout , thanks for the tip. Unfortunately I am running the latest ipywidgets already. There is a current PR that should fix the issue. |
Nice! What PR is open? I couldn't find one. |
Thanks @jasongrout! We'll look at getting JupyterLab 3.x support in the next week or so. |
Would older versions of plotly (such as 4.8.x) get JupyterLab 3.x support? |
In general, newer versions of the extension play nicely with older versions of the Python module, so tentatively "yes". |
@jasongrout thanks for the pointer re Widgets! I found this migration guide for non-widget extensions in general https://jupyterlab.readthedocs.io/en/latest/extension/extension_migration.html but if I read it correctly, following it will mean my extensions are JLab 3 compatible but not compatible with JLab 2, is that right? |
The extension upgrade script mentioned in that guide makes a prebuilt extension, which is only supported by jlab 3. |
However, you should be able to publish the npm package in a prebuilt extension package to get a jlab2-compatible extension, if you make sure the dependencies still are compatible. |
OK, I think I'd missed that this guide was intended to make a 2-compatible source extension into a 3-compatible prebuilt extension, thanks! BTW I've opened up a thread here https://discourse.jupyter.org/t/making-extensions-work-with-versions-2-and-3/7473 which might be a more-public place to discuss this :) |
Basically at this point I want to make a minimal set of changes to our extensions to get JLab3 support (without dropping support for JLab2), but I'm not quite ready to document/deal with all the support overhead of the prebuilt extension at the same time. |
For you, I would probably try just changing
and then follow the guidelines at https://ipywidgets.readthedocs.io/en/stable/changelog.html#updates-for-widget-maintainers for updating https://github.com/plotly/plotly.py/blob/master/packages/javascript/plotlywidget/package.json |
Thanks! For I'm sure looking forward to a future a year from now where most folks are using prebuilt extensions :) |
OK, looks like this is really straightforward! Thanks again for the help @jasongrout :) |
(I'll close this issue again once the extension is actually generally available :) |
Hopefully that simple change will be introduced by the team anytime soon, though I appreciate this might be related to the fact not all the graphs seem to work. |
OK, the new extensions are on NPM. Simply uninstalling the old extensions and installing the new ones. The new version number is |
As I understand it jupyterlab 3 allows for extensions to be published as pypi packages that don't require node to be installed. That would be really useful for some of our users because they only work with python so don't have node set up by default. Any idea if it would be possible for the plotly extension? |
It is, and we'll likely do it at some point, but ideally we'd find a way to merge the two extensions first, otherwise users would end up loading the large |
Not exactly the same way, but there is deduplication. Getting deduplication for separate bundles of javascript was the main feature enabling the new "prebuilt" extensions. |
Ah, thanks @jasongrout, I hadn't quite gotten that far down this path, I was just glad to get JLab 3 support out the door quickly :) So yes, we definitely want to go this route, and we'd welcome any help from the community that anyone wants to provide in terms of how to package all this stuff up such that I can easily just turn the crank on the release process every time there's a version bump! The JS source for the existing extensions is here: https://github.com/plotly/plotly.py/tree/master/packages/javascript and in general we've kept the source trees for Python packages in the sibling here https://github.com/plotly/plotly.py/tree/master/packages/python so I guess we'd need some kind of script I can run during each release process that takes over after I've upgraded the JS bundles and builds and pushes the Python bundles up to PyPI? The release process I manually follow is described here: https://github.com/plotly/plotly.py/blob/master/release.md |
Installing an extension in JupyterLab no longer requires the package be published to npm (the js file bundle is included in the pip package). Of course, you'd still want to publish to npm if anyone is using something from the package, or if you are using it outside of jupyterlab. So one question is: do you still need or want to publish one or both packages to npm? |
I think we'll want to publish both types of extensions for a while, just to give people options and not change things too fast. |
(Unless there's a big downside to this that I don't see atm) |
No big downside - just thinking of how the release process may be simplified. I think probably a good first step might be to look at the widget-cookiecutter, which has been updated to be a prebuilt extension for jlab 3. Another design consideration - it seems the plotly python package is pretty heavy. You might make a new python package with just the jlab prebuilt extension, so people can install it separately if they wish, and make plotly depend on it. Bonus is that then you'd probably be able to use the widget cookiecutter to do almost all of your work, and upgrades could probably track the cookiecutter pretty closely. We did something similar with ipywidgets itself. ipywidgets depends on widgetsnbextension (the classic notebook extension) and jupyterlab_widgets (the jlab prebuilt extension), so you can install either extension individually, but they also come automatically with ipywidgets. |
Thanks! I need to carve out some time to look at all these options and think about them... Right now on the JupyterLab side we have two extensions: one for the Is there some obvious way to clean up all of this? We haven't merged our two extensions together, primarily because of the way we bundle the |
I'll add that I'm pretty conservative when it comes to these things, and that I like to try to find a way to do and document things that are likely to work with various older versions, so in the short run I think we'll want to keep publishing the source-only extensions and documenting how to install them (as those instructions are still valid for JupyterLab 2, and possibly even 1, given that no one has complained about 1) and then if there's a new/nicer thing for JupyterLab 3 I'd start publishing the requisite extensions to PyPI and/or conda or whatever, and document that as "an alternative for JupyterLab 3 users with the following benefits", and then once 3 is more widely adopted I'd switch the docs to "prebuilt is the way, unless you're on 2" etc :) |
The most conservative thing to do is to use the widget-cookiecutter to transform the widget extension, and the jlab extension cookiecutter to transform the renderer extension into prebuilt extensions. This would create two new python packages, each installing one of the js packages into jlab. The widget cookie cutter also generates an nbextension, etc. |
(in addition to the current publishing to NPM for JupyterLab 2 support, right? or does this approach somehow work with JLab 2 also?)
So we wouldn't need to bake |
The widget and rendermime should be published to npm and continue to work for jlab 2 (test it, of course :). |
I'm not sure exactly what you are asking here. The widget cookiecutter would keep your current behavior of having a python package that generates an nbextension, etc. |
It's not entirely clear in my mind either TBH, I'm mostly doing light updates and releases with code that @jonmmease wrote a couple of years ago and that doesn't break very often ;) I'll regroup with Jon and come up with a plan. I've created #2994 for further conversation about the prebuilt extensions, and I'll lock this issue now to prevent too many "me too" and "it's not working in my particular setup" type comments. If folks are having problems using versions of |
OK, if someone wants to kick the tires on it, pip install plotly==5.0.0rc1 should "just work" and install the prebuilt extension and it'll all just work in JLab3 regardless if you have our other extensions already installed. |
With a fresh install of Jupyterlab version 3.0.0, installing plotly with the command
jupyter labextension install [email protected]
yields an error:Obviously this is a bleeding edge issue and very much a feature request, not a bug, I just wanted to make sure it was documented. Thank you!
The text was updated successfully, but these errors were encountered: