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

Investigate new micropip features #40

Open
3 of 5 tasks
bollwyvl opened this issue Mar 31, 2023 · 3 comments
Open
3 of 5 tasks

Investigate new micropip features #40

bollwyvl opened this issue Mar 31, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@bollwyvl
Copy link
Contributor

bollwyvl commented Mar 31, 2023

Problem

We still carry a lot of patches, managed as full-fat wheel builds, #27 adds more.

Proposed Solution

Investigate whether new micropip features make this more reasonable.

  • micropip.add_mock_package
    • this may allow moving heavyweight wheels to simple JSON descriptions
    • unknown whether this properly ignores packages known to need to ship with multiple versions mocks, e.g. widgetsnbextension {x|y}
      • special cases could potentially be detected and overridden
  • micropip.install(..., index_urls)
    • presumably these are still clobbered by pyodide-lock.json
    • would need to decide how any configured settings would interact with direct calling with e.g. %pip
  • loadPyodide options
    • lockFileURL
      • fully replaces the default of the default ${indexUrl}/pyodide-lock.json
      • using existing known URLs, this could be used to generate a new composite lock file a given upstream
      • theoretically could be done at runtime with a data: URI (unknown)
      • getting valid package descriptions still blocked by RFC 2: partial lockfiles  pyodide/pyodide-lock#9
    • packages
      • presumably these are the distribution names as found in the lock file
      • generally won't work for complex dependencies that do need patching as above
        • could add an advisory --pyodide-preload-packages-blocklist for kernel deps
      • for the special case of notebooks, the list of required modules could be read from metadata

Additional context

extracted from #39

@bollwyvl bollwyvl added the enhancement New feature or request label Mar 31, 2023
bollwyvl added a commit to bollwyvl/pyodide-kernel that referenced this issue Mar 26, 2024
jtpio added a commit to bollwyvl/pyodide-kernel that referenced this issue Mar 26, 2024
@bollwyvl
Copy link
Contributor Author

The micropip options were a bit too complex to solve in the otherwise-small #103. While these could still be added to piplite configuration somehow, it may be moot if we can get a closed form, build-time solution that generated a well-formed pyodide-lock.json, currently under investigation.

@bollwyvl
Copy link
Contributor Author

Ok, I've got an (unreleased) jupyterlite-pyodide-lock up to a working state. There are some temporary docs with demo up, which also includes a deployed lockfile and wheel.

Right now it works with well-known locations of firefox and chrom(e|ium) over either:

  • a naive subprocess (sadly couldn't reuse much of the cpython gubbins, as they punt to open, etc)
  • the WebDriver standard, via selenium
    • this is separate installable package in contrib

Due to the hard dependency on (alpha) pyodide-lock, and the general flakiness of browser automation, this should probably not land in pyodide-kernel itself any time soon, though likely should be mentioned in the appropriate docs.

Other techniques (nodejs, playwright, pyppetteer, an embedded qt browser) are certainly possible, and could be added via the jupyterlite_pyodide_lock.locker.v0 entrypoint, but... I personally have no interest in maintaining them.

@bollwyvl
Copy link
Contributor Author

and of course not precious about where this actually gets released from, if it makes more sense for it to be in the org.

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

1 participant