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

Support loadPyodide options #103

Merged
merged 7 commits into from
Mar 26, 2024

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

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
10 checks passed
@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.

None yet

3 participants