Open
Description
Original comment: #213 (comment)
Micropip has a compatibility layer, which defines a few functions or attributes that come from the Pyodide runtime.
In prod environment, the compat layer is imported from Pyodide, and for unit testing, the dummy compat layer is used (code pointer)
For now, this compat layer is imported everywhere in micropip, but now we have a global singleton class for micropip (#141), I would like to make this compat layer a dependency of this class, using the dependency injection technique.
By doing this, we can
- Remove
_compat_not_in_pyodide.py
from the production environment. ysing it only in unittest. - Users can modify the compatibility layer if needed. For example, if someone want to replace
fetch
with their custom method (downloading package from cache, indexDB, etc), it is possible by replacing the fetch method in compat layer.
I already made a few PRs to remove the importing compat layer globally, will continue working on it.
Metadata
Metadata
Assignees
Labels
No labels