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

[Feature Request]: Split into labextension(or + serverextension) and python package #240

Closed
specter119 opened this issue Feb 16, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@specter119
Copy link

specter119 commented Feb 16, 2021

Problem

I would like the package split into lab extension and python package since I use multiple envs for different usage, then the lab extension can be installed to the master env for visualization and the python package can be installed to the slave env to offer APIs.

Then the lab extension may only depend on jupyterlab, while the python package will depend on networkx etc.

Proposed Solution

I have no experience in developing experiencing in jupyterlab, maybe https://github.com/jupyter-widgets/ipyleaflet, https://github.com/matplotlib/ipympl can be examples?

Additional context

@specter119 specter119 added the enhancement New feature or request label Feb 16, 2021
@marimeireles
Copy link
Collaborator

Hey @specter119, thanks for opening the issue.

I would like the package split into lab extension and python package

I don't really know if this is possible and I'm not sure on how to approach this, but if you figure out a way of doing this I'll happily review a PR!

Is there anything that prevents you of installing the same package on both environments?

@ianhi
Copy link
Collaborator

ianhi commented Feb 16, 2021

I would like the package split into lab extension and python package

You mean to split up the python package into two separate python packages?

Is your goal to not depend on networkx in the base env or is it avoid jupyterlab in the other envs? For the latter note that the extension doesn't actually depend on jupyterlab. For the former I think this actually already achievable by only installing the npm package (the old way of installing extensions) with jupyter labextension install jupyter-cytoscape although this will require you to build jlab again. I think we would also need to push an update to the npm package.

@specter119
Copy link
Author

My goal is avoiding jupyterlab in the other envs, it's heavy for a env offering kernel.

@ianhi
Copy link
Collaborator

ianhi commented Feb 17, 2021

oooh that's actually great, because I think that what you want is already happening. That is pip install ipycytoscape does not depend on jupyterlab. It depends on jupyterlab-widgets which is suggestive of a dependency, happily however it does actually depend on jlab. See jupyter-widgets/ipywidgets#2995 for discussion on this.

When you are installing ipycytoscape into the other envs are you getting jupyterlab pulled in as well? Because I think that that would be a bug.

For me in a fresh pip install ipycytoscape does not seem to pull in jupyterlab:

mamba create -n test python
conda activate test
pip install ipycytoscape

installs these packages:

ipython-genutils, traitlets, six, pyrsistent, attrs, wcwidth, tornado, pyzmq, python-dateutil, pyparsing, ptyprocess, parso, jupyter-core, jsonschema, webencodings, pygments, pycparser, prompt-toolkit, pickleshare, pexpect, packaging, nest-asyncio, nbformat, MarkupSafe, jupyter-client, jedi, decorator, backcall, async-generator, testpath, pandocfilters, nbclient, mistune, jupyterlab-pygments, jinja2, ipython, entrypoints, defusedxml, cffi, bleach, terminado, Send2Trash, prometheus-client, nbconvert, ipykernel, argon2-cffi, notebook, widgetsnbextension, jupyterlab-widgets, spectate, networkx, ipywidgets, ipycytoscape

@specter119
Copy link
Author

@ianhi thanks in advance. @marimeireles thanks all of you for development.
I think this issue can be close now, however, things talked here should be mentioned in the readme.

@marimeireles
Copy link
Collaborator

Hey @specter119 glad you found a solution with Ian! :)
Thanks for the kind words. Lots of ipycytoscape has Ian's contributions on it.
Please feel free to add this info to the README in a way you think it'll be useful to people.
Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants