K3D-tools / K3D-jupyter

K3D lets you create 3D plots backed by WebGL with high-level API (surfaces, isosurfaces, voxels, mesh, cloud points, vtk objects, volume renderer, colormaps, etc). The primary aim of K3D-jupyter is to be easy for use as stand alone package like matplotlib, but also to allow interoperation with existing libraries as VTK.
MIT License
921 stars 123 forks source link

jupyterlab runtime dependency #312

Closed CagtayFabry closed 2 years ago

CagtayFabry commented 2 years ago

thank you for updating the package to the jupyterlab3 extension system, it works great ! 🎉

TLDR: can we remove jupyterlab dependency from setup.py ?

one thing that is not clear to me are the exact requirements to install and run (not build) k3d Specifically: does k3d really need jupyterlab installed in the same environment to run?

to start, jupyterlab is listed as a build dependency in pyproject.toml (which I think makes sense to build the labextension) https://github.com/K3D-tools/K3D-jupyter/blob/102bdbfde6058285439b589caef6a2f936e90986/pyproject.toml#L1-L3

for pip installs, jupyterlab is also listed as an install (=runtime) dependency in setup.py, running pip install k3d will install jupyterlab https://github.com/K3D-tools/K3D-jupyter/blob/102bdbfde6058285439b589caef6a2f936e90986/setup.py#L82-L88

here are the jupyter packages that get installed if you run pip install k3d (on an empty environment)

# Name                    Version                   Build  Channel
jupyter-client            7.0.5                    pypi_0    pypi
jupyter-core              4.8.1                    pypi_0    pypi
jupyter-server            1.11.0                   pypi_0    pypi
jupyterlab                3.1.14                   pypi_0    pypi
jupyterlab-pygments       0.1.2                    pypi_0    pypi
jupyterlab-server         2.8.2                    pypi_0    pypi
jupyterlab-widgets        1.0.2                    pypi_0    pypi

for the conda package, jupyterlab is listed as a host (=build?) dependency, which is similar to the pyproject.toml configuration. however, jupyterlab is not listed as a runtime dependency https://github.com/conda-forge/k3d-feedstock/blob/79f27e439f9a784db67b4fabeeb8915ce56450c4/recipe/meta.yaml#L17-L30

and here is the output for conda install k3d

# Name                    Version                   Build  Channel
jupyter_client            7.0.5              pyhd8ed1ab_0    conda-forge
jupyter_core              4.8.1            py39hcbf5309_0    conda-forge
jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
jupyterlab_widgets        1.0.2              pyhd8ed1ab_0    conda-forge
marscher commented 2 years ago

I think you're right @CagtayFabry. It makes sense not to depend on jupyterlab, as users want to be able to separate the lab installation from different kernels. If k3d would depend on jupyterlab, one would defeat this purpose as the kernel (e.g. the client to the jupyter lab server), would require the server itself to be installed in the kernel environment.

artur-trzesiok commented 2 years ago

Thanks for spot. I will remove it!

artur-trzesiok commented 2 years ago

all tests are green. Thanks! Next release will have it

marscher commented 2 years ago

Thanks for handling this so quickly!

CagtayFabry commented 2 years ago

do you have plans to issue a new release soon @artur-trzesiok ?

if not would you consider quickly releasing a 2.11.1 patch version for this? pulling a full jupyterlab in every environment is quite heavy in some workflows