Skip to content

Add pyodide-lock.json customization with optional pyodide-lock and uv dependencies#269

Open
bollwyvl wants to merge 43 commits intojupyterlite:0.7.xfrom
bollwyvl:gh-250-pyodide-lock
Open

Add pyodide-lock.json customization with optional pyodide-lock and uv dependencies#269
bollwyvl wants to merge 43 commits intojupyterlite:0.7.xfrom
bollwyvl:gh-250-pyodide-lock

Conversation

@bollwyvl
Copy link
Copy Markdown
Contributor

@bollwyvl bollwyvl commented Mar 9, 2026

References

Changes

  • pyproject.toml
    • add [lock] extra
  • addons/piplite.py
    • move some reusable functions to a utils.py
  • addons/pyodide.py
    • add lock_* traits
    • gate pyodide-lock behind PyodideAddon.lock_enabled
    • add tasks for configuring lock
  • tests/test_lock.py
  • .github/workflows
    • only test pyodide-lock and uv on 3.14
    • move coverage threshold here
  • packages
    • normalize some package names in places (e.g. pyodide_kernel -> pyodide-kernel)
    • add proper dependencies on IPython, comm to pyodide-kernel/pyproject.toml
  • examples
    • add specs for the latest IPython to demonstrate replacing packages added to pyodide for convenience (not ABI compatibility)
    • demonstrate the "full CDN" approach
    • remove %pip from example notebook
  • docs
    • minimal update to README with compatibility information and CLI output

User-facing changes

  • site authors will be able to:
    • more easily add custom wheels (and their dependencies) with --pyodide-wheels
    • reduce more sources of future flake with e.g. SOURCE_DATE_EPOCH now also being reflected in the runtime package set
  • site visitors should see better performance from fewer requests
  • the %pip syntax will be required in fewer scenarios, but is still available for exploring

Backwards-incompatible changes

  • n/a

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 9, 2026

lite-badge 👈 Try it on ReadTheDocs

@bollwyvl bollwyvl added the enhancement New feature or request label Mar 9, 2026
@bollwyvl bollwyvl marked this pull request as ready for review March 10, 2026 00:43
@bollwyvl bollwyvl requested a review from jtpio March 10, 2026 00:43
Copy link
Copy Markdown
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

Left a couple of comments after a first pass.

@bollwyvl
Copy link
Copy Markdown
Contributor Author

Rekicked the RTD demo, merged up to 0.7.x.

@jtpio
Copy link
Copy Markdown
Member

jtpio commented Mar 13, 2026

Looks good overall!

Since this targets the 0.7.x branch, just checking that are we not expecting anything to break or surprise users if this ends up in a patch release?

@bollwyvl
Copy link
Copy Markdown
Contributor Author

not expecting anything to break or surprise users if this ends up in a patch release?

Yep, that's the motivation behind the lock_enabled feature flag, and running the 3.10 tests without uv and pyodide-lock around. Provided this lands and we get some real-world feedback, we could evaluate whether 0.8 should:

  • add the [lock] stuff to requirements
  • stop using piplite for pyodide-kernel, etc.

After some CI insight, I'll add another test excursion that checks with [lock] against 3.10.

@bollwyvl
Copy link
Copy Markdown
Contributor Author

bollwyvl commented Mar 18, 2026

If we're really concerned, I can go back to a PyodideLockAddon in a new lock.py. This would reduce changes to pyodide.py, but would introduce some order-of-operations issues where PyodideLockAddon would need to know a fair amount about the things PyodideAddon is doing, and more boilerplate, and another key in the config file.

@jtpio
Copy link
Copy Markdown
Member

jtpio commented Mar 23, 2026

Maybe it could be worth targeting main first, test in a pre-release, and then backport to 0.7.x if everything looks good?

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

Successfully merging this pull request may close these issues.

2 participants