micropip
micropip copied to clipboard
Enhancement ideas from JupyterLite
As summarized in https://github.com/pyodide/pyodide/issues/3093#issuecomment-1245786852 by @bollwyvl there are a number of features in piplite/JupyterLite built on top of micropip, some of which could make sense to move upstream, now that this package is standalone,
What piplite/jupyterlite hacks are wanted? Happy to shed some stuff!
Even if all our hacks weren't desirable, it would be lovely to have a few more documented ways to customize micropip, rather than trying to solve some things Once And For All... presenting the two together:
- handling multiple package sources
- we check for a custom Warehouse (or warehouse-like file format) for custom/offline packages
- notionally, micropip.add_pypi_json_resolver(key: str, get_pypi_json: Callable[[str, dict], PackageReleases])
- disabling package sources
- for offline (but still dynamic) installations, it's nice to have some guardrails in place to avoid calling out to Big PyPI
- notionally, micropip.remove_pypi_json_resolver(key: str)
- specifying no-op packages to be considered installed
- not handled in piplite, but rather in separate build packages
- notionally, micropip.add_noop_package(package_name: str)
Some things that we hack outside of piplite, so maybe they belong in core:
- specifying patches that need to occur at import time
- we un-lazily load and patch some heavy hitters (matplotlib, oy!)
- this is really more of a loader-time thing, so maybe should be a pyodide API
- we tried to use some off-the-shelf stuff, but at some point it stopped working
- specifying mock packages
- we mock some packages