- Notifications
You must be signed in to change notification settings - Fork1.5k
Published wheels JS dependencies ... what could we do about it?#2301
-
After a long discussionon our Discord channel I feel like we need to provide broader context and an easier way to discuss this forward, so here thediscussion around that topic. |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 3 comments 5 replies
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Summarizing the previous discussion:
|
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Use-caseA cross-platform library implements functionality in a cross-platform way, across Windows, Mac, Linux, and browsers. It delegating to the appropriate platform-specific APIs and dependencies. Consumers of Strawman proposalSuppose a wheel can contain 2x files:
Browser runtime environments can bootstrap themselves like this:
fordepinall_deps:ifVFS.exists(dep.path+"/browser_environment.json"):browser_env_manifest=parse_json(VFS.read(dep.path+"/browser_environment.json"))forjs_pathinbrowser_env_manifest.main_modules:load_js_into_main_thread(VFS.read(dep.path+js_path)
So when the user does |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
interesting, here my counter-arguments:
These are all issues we've solved already via our config, but while I like the direction this discussion is taking, I want to be sure all our previous discussions are taken into account too. |
BetaWas this translation helpful?Give feedback.
All reactions
-
How about we update the manifest schema to closely match the relevant parts of
Interesting, ok, we want micropip to give us an array of the installed dependency names. Then, can we use python's Or, alternatively, can we find every |
BetaWas this translation helpful?Give feedback.
All reactions
-
Looks like importmicropipimportimportlibimportpkgutildeps=micropip.list()print(deps)fordepName,depindeps.items():print(importlib.util.find_spec(depName)) |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
I thought python did not support this, that you can only have one version of each library loaded into the runtime. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
those are indirect dependencies ... if Python guarantees once a version of any package is granted and reflected all over other dependencies, then yes, we can scratch that from my list of "what if" but aboutlist, that's both good news but most complains aroundPyodide are around bootstrap time + we would like to have feature parity withmip (the MicroPython counterpart) so ... investigation and some benchmark needed, but that might be it for Pyodide at least ... let's see! |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Examples in the wild: pygletpyglet does not current support browser runtimes, but they're interested in supporting them eventually. So they might use this proposal. AudioFor example, pyglet supports multiple audio backends for different platforms. Roughly, it has a list of each backend. It iterates, attempts to load each in a I understand that pyodide/pygbag already supports some audio APIs, so maybe pyglet's existing OpenAL backend will "just work." Or perhaps pyglet will implement an additional Here are links to the relevant code: Font renderingAnother example: font loading, font rendering. Here, pyglet uses I can imagine pyglet adding another "web" platform, conditionally using the browser's |
BetaWas this translation helpful?Give feedback.