Skip to content
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

Remove JupyterLab dependency in jupyterlab_widgets #2995

Merged
merged 1 commit into from
Oct 24, 2020

Conversation

martinRenou
Copy link
Member

@martinRenou martinRenou commented Oct 13, 2020

Even though jupyterlab_widgets is useless without JupyterLab, it is only a small Python package (that don't need JupyterLab) and some static files installed in the right path (share/jupyter/labextensions). I would then expect it to not depend on JupyterLab.

This will allow other widgets extension to depend on the jupyterlab_widget package so that those widgets extensions can work on JupyterLab out of the box (given that they install their static files as well), without them depending on JupyterLab.

cc. @ianhi

Even though jupyterlab_widgets is useless without JupyterLab, it is only
a small Python package (that don't need JupyterLab) and some static
files installed in the right path (share/jupyter/labextensions). I would
then expect it to not depend on JupyterLab.

This will allow other widgets extension to depend on the jupyterlab_widget
package so that those widgets extensions can work on JupyterLab out of
the box, without them depending on JupyterLab.

Signed-off-by: martinRenou <martin.renou@gmail.com>
@vidartf
Copy link
Member

vidartf commented Oct 13, 2020

I think we do need some system to say which version(s) of lab the JS is compatible with though...

@martinRenou
Copy link
Member Author

We might be able to do this using conda-forge's run_constrained https://conda-forge.org/docs/maintainer/adding_pkgs.html#constraining-packages-at-runtime

Concerning pip, idk.

@jasongrout
Copy link
Member

pip is introducing a new solver this year that I think will let it do things like conda's run_constrained, so this might be good timing.

I went back and forth on whether jupyterlab_widgets should depend on jlab or not. It's a continuation of our conversation from the workshop earlier this year, of where to draw the cutoff in the dependency.

@jasongrout
Copy link
Member

Sounds like the community sentiment is to not have the dependency, so let's go for it!

@jasongrout jasongrout merged commit 5bb6573 into jupyter-widgets:7.x Oct 24, 2020
@ianhi
Copy link
Contributor

ianhi commented Oct 24, 2020

:O horrraayyyy

So if I understand correctly now widgets (e.g. ipympl) can just require jupyterlab-widgets without forcibly installing jlab. This allows much simpler install instuctions which is rad. But what about:

I think we do need some system to say which version(s) of lab the JS is compatible with though...

Based on

pip is introducing a new solver this year that I think will let it do things like conda's run_constrained, so this might be good timing.

I went a fairly unproductive deep dive of pip documentation and that wasn't totally my conclusion, very happy to be wrong though.

@jasongrout
Copy link
Member

I went a fairly unproductive deep dive of pip documentation and that wasn't totally my conclusion, very happy to be wrong though.

Something similar is implemented in https://pip.pypa.io/en/stable/user_guide/#constraints-files, though not quite mirroring a setup.py runtime constraint. The new solver, IIRC, keeps track of dependencies in an environment and makes sure the environment stays consistent. So I think the underlying capability is there to have something like run_constrained, even if a similar setup.py-specified constraint is not currently implemented.

jasongrout added a commit to jasongrout/jupyterlab_widgets-feedstock that referenced this pull request Oct 24, 2020
This removes the jupyterlab dependency, but we still have a run constraint. See jupyter-widgets/ipywidgets#2995
@jasongrout
Copy link
Member

jasongrout commented Oct 24, 2020

I released this as jupyterlab_widgets 1.0.0a6 (on pypi and conda-forge), so people can test making it a dependency and see if that works out well.

@ianhi
Copy link
Contributor

ianhi commented Oct 25, 2020

I released this as jupyterlab_widgets 1.0.0a6 (on pypi and conda-forge), so people can test making it a dependency and see if that works out well.

Just tried it with ipympl, worked great! I could use it with just notebook without installing jlab, then once I installed jlab3 it worked immediately.

@martinRenou martinRenou deleted the remove_jlab_dependency branch October 27, 2020 08:14
@martinRenou
Copy link
Member Author

@jasongrout should we go further and make jupyterlab_widgets an ipywidgets dependency? So that conda install -c conda-forge ipywidgets or pip install ipywidgets is enough for having widgets working in JupyterLab.

@jasongrout
Copy link
Member

@jasongrout should we go further and make jupyterlab_widgets an ipywidgets dependency? So that conda install -c conda-forge ipywidgets or pip install ipywidgets is enough for having widgets working in JupyterLab.

I'm okay with that. That would mean that other widget packages actually don't have to depend on it - they just depend on ipywidgets.

@martinRenou
Copy link
Member Author

Yes! That would be great.

@jasongrout jasongrout added this to the 7.6.0 milestone Dec 24, 2020
@jasongrout jasongrout mentioned this pull request Feb 3, 2021
20 tasks
@github-actions github-actions bot added the resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Mar 25, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants