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 Pyodide lockFileURL option #49

Closed
wants to merge 2 commits into from
Closed

Conversation

rth
Copy link

@rth rth commented Jun 22, 2023

Related to the discussion pyodide/pyodide#3573 by @bollwyvl once we have the ability to create a custom pyodide-lock.json we need to have some way to point this kernel to use it.

Supposing this pyodide-lock.json is created alongside other JupyterLite files and deployed with those, I'm also not sure how that URL should look like: just a relative path?

@github-actions
Copy link
Contributor

lite-badge 👈 Try it on ReadTheDocs

@rth
Copy link
Author

rth commented Jun 22, 2023

Though looking at #29 @bollwyvl are you saying that {lite_dir}/pypi/repodata.json (now {lite_dir}/pypi/pyodide-lock.json) would be a hardcoded path, and that this configurability is not needed? Either way should be fine.

In which case I can close this.

**Edit:**also, do I also need to add it to packages/pyodide-kernel-extension/schema/kernel.v0.schema.json to avoid?

error TS2741: Property 'pyodideLockFileURL' is missing in type '{ baseUrl: string; pyodideUrl: string; indexUrl: string; 
pipliteWheelUrl: string; pipliteUrls: string[]; disablePyPIFallback: boolean; location: string; mountDrive: boolean; }' but required in type 'IOptions'.

This was referenced Mar 26, 2024
@bollwyvl
Copy link
Contributor

As of #103, pyodideLockURL (and JSON-compatible friends in loadPyodide(options)) are now available to be configured in jupyter-lite.json, which should ship as part of jupyterlite-pyodide-kernel 0.3.0.

Minor upstream note: moving the options typing into a named interface would make this just that much better for downstreams! I didn't fully grok the ts-in-js toolchain to make that happen, however...

Looking further down the line, these options should put enough pieces in place to support an addon that:

  • uses e.g. a browser to do a real solve of the lock from micropip.freeze
  • grabs all the wheels
  • backfills the import names with pyodide-lock

I had started them in the same PR, but it became clear that this would add rather a lot of complexity, so will probably try to land it as another installable package, but theoretically could become an [lock] extra of this package.

@bollwyvl bollwyvl closed this Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants