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

auto enable extension on installation for notebook >= 5.3 #896

Closed
ericpre opened this issue May 3, 2020 · 10 comments
Closed

auto enable extension on installation for notebook >= 5.3 #896

ericpre opened this issue May 3, 2020 · 10 comments

Comments

@ericpre
Copy link

ericpre commented May 3, 2020

Unlike ipywidgets, nglview doesn't auto enable notebook extension when installing with conda. It seems that this is not clearly documented, but below are a couple of examples:

PR in notebook repository for implementation details.

@hainm
Copy link
Collaborator

hainm commented May 3, 2020

thanks for your suggestion. I thought nglview already has auto-activated stuff.

cc @marscher here (from your comment(s): https://github.com/conda-forge/nglview-feedstock/pull/26/files#r269034275)

@hainm
Copy link
Collaborator

hainm commented May 3, 2020

I've tried and I think nglview works as expected.

conda create -n test-nglview python=3.8 -y
source  activate test-nglview
conda install nglview -c conda-forge -y

And that's it.

@ericpre
Copy link
Author

ericpre commented May 4, 2020

This is what I have checked before opening this issue and trying again still does not work. Only running jupyter-nbextension enable nglview --py --sys-prefix make the nglview works in the notebook. I can reproduce this behaviour on windows and linux.

Do you have the following output being displayed when you run conda install nglview -c conda-forge?

Enabling notebook extension nglview-js-widgets/extension...
      - Validating: OK

In my case, I don't have this output but I have one for the jupyter-js-widgets/extension (ipywidgets)

Below is the output of jupyter nbextension list after installing in a new environment

>>> jupyter nbextension list
Known nbextensions:
  config dir: /opt/miniconda3/envs/test-nglview/etc/jupyter/nbconfig
    notebook section
      jupyter-js-widgets/extension  enabled 
      - Validating: OK

To be compare with after enabling the nglview nbextension.

>>> jupyter-nbextension enable nglview --py --sys-prefix
Enabling notebook extension nglview-js-widgets/extension...
      - Validating: OK

>>> jupyter nbextension list
Known nbextensions:
  config dir: /opt/miniconda3/envs/test-nglview/etc/jupyter/nbconfig
    notebook section
      jupyter-js-widgets/extension  enabled 
      - Validating: OK
      nglview-js-widgets/extension  enabled 
      - Validating: OK

@ericpre
Copy link
Author

ericpre commented May 4, 2020

cc @marscher here (from your comment(s): https://github.com/conda-forge/nglview-feedstock/pull/26/files#r269034275)

I am not familiar with how extensions works and their enabling mechanism but this doesn't follow the "standard" pattern mentioned in the fist post of this issue (#896 (comment)).
The conda recipes mentioned above don't do anything (no post-link script) for enabling the nbextensions but it seems that the installation of the package is configured to enable them when there are installed.

@hainm
Copy link
Collaborator

hainm commented May 4, 2020

Do you have the following output being displayed when you run conda install nglview -c conda-forge?

No I did not see it.

I can reproduce this behaviour on windows and linux.

I see. So it's platform issue. I was using my mac.
By the way, I will make a PR to fix (or review a PR from you if you would like to make one). Cheers.

@ericpre
Copy link
Author

ericpre commented May 4, 2020

Sorry, I don't know anything about javascript (and its packaging) to make a PR. If not, I would already have done so!

@hainm
Copy link
Collaborator

hainm commented May 5, 2020

@ericpre addressed in #898. Thanks.

@hainm hainm closed this as completed May 5, 2020
@ericpre
Copy link
Author

ericpre commented May 5, 2020

I built a conda package using the master branch (with #898 included) to check and enabling the extension automatically works perfectly! pip installation works perfectly too.

Thanks @hainm!
Any idea when the next release could be?

@hainm
Copy link
Collaborator

hainm commented May 5, 2020

I am not sure since there are only commits from the latest release https://github.com/arose/nglview/releases

@ericpre
Copy link
Author

ericpre commented May 5, 2020

Fair enough! I will keep a eye on the feedstock on conda-forge - for the next release, it may be worth cleaning up the recipe.

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

No branches or pull requests

2 participants