Skip to content

Support loadPyodide options#103

Merged
jtpio merged 7 commits intojupyterlite:mainfrom
bollwyvl:gh-40-load-pyodide-options
Mar 26, 2024
Merged

Support loadPyodide options#103
jtpio merged 7 commits intojupyterlite:mainfrom
bollwyvl:gh-40-load-pyodide-options

Conversation

@bollwyvl
Copy link
Contributor

references

code changes

  • adds the schema for a subset of loadPyodide(options)
    • some typing for the two initial interesting fields, lockFileURL and packages
  • only piplite.install packages that weren't preloaded by loadPyodideOptions.packages
  • update example to show use of this for e.g. ssl, matplotlib, etc.

user-facing changes

  • site owners will be able to further control the JSON-compatible parts of loadPyodide
  • it's possible preloading the packages makes things faster, as they are downloaded while the pyodide VM is starting up

@github-actions
Copy link
Contributor

lite-badge 👈 Try it on ReadTheDocs

@bollwyvl bollwyvl added the enhancement New feature or request label Mar 26, 2024
@bollwyvl bollwyvl marked this pull request as ready for review March 26, 2024 14:27
@bollwyvl
Copy link
Contributor Author

bollwyvl commented Mar 26, 2024

Up on RTD, it does indeed look like it preloads packages from the pyodide distribution e.g. matplotlib.

This leads to an (apparently) slower start of the first interactive use of the kernel, so may not desirable for heavyweight packages on general purpose sites, but probably will improve start time when we can skip micropip resolution for all of the ipython deps from a fully-locked environment provided in loadPyodideOptions.lockFileURL.

@bollwyvl bollwyvl requested a review from jtpio March 26, 2024 14:31
Copy link
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

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

Thanks!

@jtpio jtpio merged commit d9b41b8 into jupyterlite:main Mar 26, 2024
@tomjakubowski
Copy link

tomjakubowski commented Mar 26, 2024

This is awesome! Is it expected to make it in the upcoming 0.3.0 kernel release?

@jtpio
Copy link
Member

jtpio commented Mar 27, 2024

0.3.0 is now available: https://github.com/jupyterlite/pyodide-kernel/releases/tag/v0.3.0

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

Successfully merging this pull request may close these issues.

3 participants