[go: up one dir, main page]

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

Upgrade packaging for automatic install #16

Merged
merged 5 commits into from
Mar 7, 2022
Merged

Conversation

manzt
Copy link
Collaborator
@manzt manzt commented Mar 1, 2022

Motivation:

  • JS currently must be manually built (npm install && npm run build) for the repo.
  • jupyter-scatter does not automatically install extension with pip install jupyter-scatter.

Newer versions of Jupyter and JupyterLab support automatic installation of extensions from PyPI (not local dev install with pip install -e .). This PR will make jupyter-scatter automatically install extensions with pip install jupyter-scatter.

Blocking:

- Mixed naming of jscatter/jupyter-scatter seems to cause an issue for auto install of jupyter notebook extension.

How to try out this PR?

pip install build
python -m build . # inside jupyter-scatter dir
pip install dist/jupyter-scatter-0.2.0.tar.gz
jupyter nbextension list
# Known nbextensions:
#   config dir: /Users/manzt/dev/miniconda3/envs/jsc/etc/jupyter/nbconfig
#     notebook section
#       jupyter-scatter/extension  enabled
#       - Validating: OK
jupyter labextension list
# JupyterLab v3.2.9
# Other labextensions (built into JupyterLab)
#    app dir: /Users/manzt/dev/miniconda3/envs/jsc/share/jupyter/lab
#         jupyter-scatter v0.2.0 enabled OK

How to actually uninstall jupyter-scatter:

pip uninstall jupyter-scatter # does not remove installed extensions
rm -rf $CONDA_PREFIX/share/jupyter/{nbextensions,labextensions}/jupyter-scatter # remove extensions
rm $CONDA_PREFIX/etc/jupyter/nbconfig/notebook.d/jupyter-scatter.json

NOTE: manual extension install commands will still work, and are required when developing locally.

@manzt manzt marked this pull request as ready for review March 1, 2022 17:32
@manzt manzt requested a review from flekschas March 1, 2022 17:32
@manzt manzt changed the title [WIP]: upgrade packaging for automatic install Upgrade packaging for automatic install Mar 1, 2022
Copy link
Owner
@flekschas flekschas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for putting this together. It looks great and works as expected! 🎉

One minor question: could you update the text-environment/README.md as well? I don't want to guess but I think 2. Enable the extension for Jupyter Lab and Notebook would not be not needed anymore with this PR right?

README.md Outdated Show resolved Hide resolved
manzt and others added 2 commits March 6, 2022 21:55
@manzt
Copy link
Collaborator Author
manzt commented Mar 7, 2022

One minor question: could you update the text-environment/README.md as well? I don't want to guess but I think 2. Enable the extension for Jupyter Lab and Notebook would not be not needed anymore with this PR right?

Yup! Auto-install of extensions occurs when installed from PyPI with pip

@flekschas flekschas merged commit 576068a into master Mar 7, 2022
@flekschas flekschas deleted the manzt/modern-build branch March 7, 2022 04:48
@flekschas
Copy link
Owner

Thanks for quickly updating the readme! :)

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

Successfully merging this pull request may close these issues.

2 participants