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

Provide example of how to add your own extension to the distribution #67

Open
psychemedia opened this issue Apr 13, 2022 · 7 comments
Open
Labels
enhancement New feature or request

Comments

@psychemedia
Copy link
Contributor

The JupyterLite demo currently shows how to add custom content to the site, as well as additional app config settings.

It would be useful for a documented demo of how to add a custom extension, eg from a pre-built wheel.

@psychemedia psychemedia added the enhancement New feature or request label Apr 13, 2022
@psychemedia
Copy link
Contributor Author

psychemedia commented Apr 14, 2022

A good example extension for this might be https://github.com/jupyterlab-contrib/jupyterlab-filesystem-access eg in context of jupyterlite/jupyterlite#603 .

@jtpio
Copy link
Member

jtpio commented Apr 14, 2022

Looks like it's already documented in the README?

https://github.com/jupyterlite/demo#deploy-a-new-version-of-jupyterlite

image

@psychemedia
Copy link
Contributor Author

I tried that locally, adding jupyterlab_filesystem_access to my requirements.txt and running jupyter lite build --contents content, then eg jupyter lite serve --port 8002 but I don't see the extension working in JupyterLite? So I figured there's maybe a step I'm missing?

@psychemedia
Copy link
Contributor Author

psychemedia commented Apr 14, 2022

I also note the README for the jupyterlab_filesystem_access suggests "[t]he main motivation for this extension is to give access to local files in JupyterLite" so it might be appropriate to give a Github Pages / JupyterLite demo there, along with minimum docs for what folk need to do to enable the extension in their own JupyterLite distribution?

@psychemedia
Copy link
Contributor Author

Hmm... so when I add the files to requirements in a demo Github repo site, it works. Does the JupyterLite builder pick up extensions that are installed in a base JupyterLab environment? Could it be looking to the wrong path on my local install for what extensions to include?

@jtpio
Copy link
Member

jtpio commented Apr 15, 2022

I tried that locally, adding jupyterlab_filesystem_access to my requirements.txt and running jupyter lite build --contents content, then eg jupyter lite serve --port 8002 but I don't see the extension working in JupyterLite? So I figured there's maybe a step I'm missing?

You need to reinstall the dependencies so they are part of the environment.

JupyterLite picks them up from the env prefix by default, see the docs: https://jupyterlite.readthedocs.io/en/latest/configuring.html#environment-extensions

it might be appropriate to give a Github Pages / JupyterLite demo there

There is one: https://jupyterlab-filesystem-access.readthedocs.io/en/latest/#try-it-online

Does the JupyterLite builder pick up extensions that are installed in a base JupyterLab environment?

Yes they need to be installed, see the docs: https://jupyterlite.readthedocs.io/en/latest/configuring.html#environment-extensions
Or you use direct links to the tarballs / wheels with ignore_sys_prefix, like in https://github.com/jupyterlite/jupyterlite/tree/main/examples

@psychemedia
Copy link
Contributor Author

JupyterLite picks them up from the env prefix by default, see the docs:

yes, that's what I'm having the issue with locally. My local JupyterLab install is running with extensions and they are not being picked up by JupyterLab. I think there are several paths that extension can sit on and JupyterLite build does not seem to inspect them all?

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

2 participants