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

Add minimal novel package discovery #29

Open
bollwyvl opened this issue Mar 13, 2023 · 2 comments
Open

Add minimal novel package discovery #29

bollwyvl opened this issue Mar 13, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@bollwyvl
Copy link
Contributor

Problem

At present, it is hard to calculate the exact package versions and URLs needed to build a reproducible site.

Proposed Solution

Given a kernel session has installed a couple packages, offer something like piplite.freeze which would:

  • call micripip.freeze
  • weed out all of the packages that weren't actually installed (not everyone needs galpy and scipy, but some will)
  • inject the packages needed to get up to pyodide-kernel
  • emit a repodata.json that can be dropped into {lite_dir}/pypi/repodata.json
  • enjoy getting import foo without having to %pip install foo

Additional context

A much-heavier-duty version of this might try to use micropip, depfinder and/or conda-lock (which bundles poetry) to do this in a browserless, nodejs-less command line setting, but interactive-first is never the wrongest way to go.

@bollwyvl bollwyvl added the enhancement New feature or request label Mar 13, 2023
@rth
Copy link

rth commented Jun 22, 2023

Yes, I confirm this functionality would be very useful to smooth the difference between notebooks with in-brower and out of browser kernels.

For instance, with the deployment of Jupyterlite in the scikit-learn example gallery (dev deployment only for now), it's a bit confusing to users why some packages can be just imported and others need to be pip installed first.

@rth
Copy link

rth commented Jun 22, 2023

inject the packages needed to get up to pyodide-kernel

Do you mean copy the packages from wherever they are into the deployed site? For reproducibility yes, that would be good.

However, there is also a use case in the other direction where you want to add more PyPI packages to the pyodide-lock.json (pointing to the remote URLs where they are) without actually copying those files locally. For instance, scikit-learn deploys docs into a Github repo (that gets then deployed via Github Pages) and they don't realistically want to push 10+MB of packages there.

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