Skip to content

Unify package-install primitive (single micropip code path)#310

Merged
milanofthe merged 1 commit into
mainfrom
refactor/unified-install-primitive
Jun 2, 2026
Merged

Unify package-install primitive (single micropip code path)#310
milanofthe merged 1 commit into
mainfrom
refactor/unified-install-primitive

Conversation

@milanofthe
Copy link
Copy Markdown
Member

There were three independent micropip/pip code paths with different semantics:

  • engine install (engineInstall.ts, inline micropip.install, pre= only, raw error)
  • toolbox install (_pv_install_micropip, keep_going=True, classified PV_INCOMPATIBLE/PV_INSTALL_ERROR errors)
  • docutils (also _pv_install_micropip)

This extracts the install primitives into one shared source and routes the engine seam through it.

  • New scripts/pathview_install.py: _pv_already_installed, _pv_install_micropip(spec, pre=False, keep_going=True), _pv_install_pip — single source of truth, one error-classification scheme.
  • toolbox/python.ts: TOOLBOX_PYTHON_HELPERS now composes INTROSPECT_PY + INSTALL_PY + RUNTIME_GLUE (the three install funcs moved out of the inline glue).
  • engineInstall.ts: injects INSTALL_PY before the worker snapshots _clean_globals (so the primitive survives a simulation reset), then installs each package via _pv_install_micropip(...) instead of an inline micropip.install.

Behaviour is unchanged (same flags per package); the duplication and the divergent error handling are gone. svelte-check: 0 errors/0 warnings; production build (incl. worker bundle, which resolves the new ?raw import) succeeds.

@milanofthe milanofthe merged commit 1f5ab7c into main Jun 2, 2026
4 checks passed
@milanofthe milanofthe deleted the refactor/unified-install-primitive branch June 2, 2026 12:28
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.

1 participant