Bundle extension examples in PyPI installs#105
Bundle extension examples in PyPI installs#105MUFFANUJ wants to merge 12 commits intojupyterlab:mainfrom
Conversation
|
Hmm, I like how it makes the examples "just work". I see two potential issues here:
We could consider publishing If we keep the approach proposed by this PR as-is, can we also drop submodule checkout step from binder/lite and centralize that in one place? |
|
Not completely. The new packaged-install path solves the PyPI case, but Binder and Lite are still source-checkout workflows. In particular, Lite needs the examples during the docs build so |
|
I posted on Zulip to check for dissent and ideas #jupyterlab > plugin playground to ship extension-examples in wheel |
|
It now removes hidden files ( |
|
Should we merge this? I have excluded the images/gifs/vids and as per discussed i will update the compression workflow in the |
krassowski
left a comment
There was a problem hiding this comment.
Do you know what is responsible for the majority of the size? It looks like this till yields 30+ MB:
https://github.com/jupyterlab/plugin-playground/actions/runs/23755660059?pr=105
There was a problem hiding this comment.
If we end up with more scripts like that it would be worthwhile to put it under /scripts directory but since it is only one I think that's ok to keep as-is
|
Ok, it looks like we are not getting that much gain from compression... What if we removed |
|
This is assuming that the answer to my earlier question:
is that it is the gif files. |
Yes |
There was a problem hiding this comment.
Pull request overview
This PR bundles the extension-examples content into the Python distribution so that installs from built artifacts (including PyPI wheels) can surface examples immediately, without requiring users to manually clone the examples repository.
Changes:
- Add a Hatch build hook to generate a trimmed, packaged copy of
extension-examplesduring builds. - Enable a Jupyter Server extension that populates
extension-examples/into the server root on startup if missing. - Reuse the new syncing logic for building the docs Lite contents, and ensure release checks fetch submodules.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Adds build artifact/config wiring, registers the custom build hook, and installs server config for auto-enabling the server extension. |
jupyterlab_plugin_playground/__init__.py |
Implements the server extension entrypoints and startup-time copy of bundled examples into the Jupyter server root. |
jupyter-config/jupyter_server_config.d/jupyterlab_plugin_playground.json |
Auto-enables the server extension via jpserver_extensions. |
extension_examples_bundle.py |
New build hook + sync utilities to trim/copy example directories and rewrite README media references. |
docs/conf.py |
Switches docs Lite sync to reuse sync_extension_examples() from the new module. |
.github/workflows/check-release.yml |
Checks out git submodules in the release-check workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.



closes #88
This PR makes the bundled extension-examples available when jupyterlab-plugin-playground is installed from a built package, including the PyPI path. Instead of asking users to manually clone the examples repository after install, the package now includes the examples and populates them automatically when JupyterLab starts, so the examples are visible in the UI immediately.
This might be a better fit than “1-click fetch” for the installed-package case because it removes the extra user step entirely and does not depend on a post-install network fetch or additional setup from inside the UI. It keeps the experience simpler and more reliable for users who just install the package and expect the examples to already be there.
I tested this locally ina virtual environment.