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 constraints in piplite #165

Open
5 tasks
bollwyvl opened this issue Feb 1, 2025 · 0 comments
Open
5 tasks

Support constraints in piplite #165

bollwyvl opened this issue Feb 1, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@bollwyvl
Copy link
Contributor

bollwyvl commented Feb 1, 2025

Problem

micropip 0.9.0 was just released, which support constraints (e.g. iff package x is installed it must be version y or from URL z). This will be very helpful for jupyterlite site builders as the (likely filtered) output of pip list --format=freeze would get us a step closer to reproducible envs. These won't somehow magically participate in auto-import, as top-level names would still not be available.

When a version of pyodide is released which contains this (or a user builds a custom pyodide distribution containing it), piplite and the %pip magic won't yet support them, and as a "major" version upgrade containing other significant changes (such as vendoring packaging), might just break.

Proposed Solution

  • add constraints to various wrapper signatures around micropip.install(..., constraints=[]) and set_constraints
  • add %pip install -c/--constraint
    • for pip, this is always a file, but we already support -r/--requirements, so the existing logic should work
  • add a way to set default constraints at build time
    • discussed previously, adding a pipliteInstallOptions could allow for setting all the (non-dependency) options:
      {
        "pipliteInstallOptions": {
          "constraints": [
            "ipywidgets ==8.1.2"
          ],
          "index_urls": [],
          "keep_going": true
        }
      }

Additional context

@bollwyvl bollwyvl added the enhancement New feature or request label Feb 1, 2025
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