-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
Web / Add Support for "Pyodide Packages" #1104
Comments
Agreed we should definitely support these wheels (and binary wheels in general) on the web backend. The error about unsupported wheel formats should be relatively straightforward; we either need to pass in a A second approach would be to pre-process the requirements list, looking for the names that are known to be available as binaries, and handle them differently during the creation process. We do a version of this for local source packages on AppImage; we'd need to do different processing for web, but at first glance, it seems like it shouldn't be too complicated (other than the complication of knowing the list of packages pyodide provides). Of course, the long term approach is for wasm packages to be made available on PyPI. However, as a short term solution,. we could provide those packages on a private PyPI repository (again, mirroring what we do on iOS). Ideally, we wouldn't have to take ownership of that task; I might chase this down with the PyScript team at Anaconda and see what they say. |
As a note: I started down this rabbit hole after someone in Discord couldn't use However, the CPython team seems to be waiting on a PEP to officially allow wheels for wasm on PyPI....an important part of that seemingly being what even delineates wasm platforms. |
@hoodmane Thanks for your help yesterday with getting an index of pyodide wheels. My bash history does not have the commands you entered. Can you paste the code we can use to get an index of pyodide wheels? |
The code to get a local index of pyodide wheels is... pip install pyodide-build
pyodide venv .pyodide-venv The index is now located in the directory listed under |
A bit more lightweight but potentially ultimately untenable source for available packages: curl -s https://cdn.jsdelivr.net/pyodide/v0.22.1/full/repodata.json | jq .packages[].name |
@rmartin16 why is that less tenable than building it from |
Sure; my qualification in that sentence stems from my ignorance of this JSON resource. I found it by looking at what PyScript does when it loads in the browser. So, I'm not sure if this is intended for random use by the public. Additionally, it's a blob of JSON on a CDN; I'd prefer a more canonical link that redirects to a CDN. Additionally, though, IIRC, Briefcase is not currently controlling the version of PyScript being used; however, this JSON of the packages is inherently tied to the version. I am not sure if there's any need to keep the two in sync but I, at least, imagine the JSON version would need to be updated to get updates to the package list. So, I'm just not sure if this is a "good idea" basically. More research is needed.....but I think ideally we'd want be able to dynamically request some sort of payload under PyScript's control for this package list....maybe they even have a pypi server set up... |
What is the problem or limitation you are having?
Pyodide maintains a collection of popular Python packages that are compatible with the pyscript runtime.
It is currently difficult to use these packages within the Briefcase web workflows.
Describe the solution you'd like
Briefcase static web format should support adding Pyodide packages as requirements to the app.
Describe alternatives you've considered
Manually add the needed package to
pyscript.toml
. This needs to happen each time the app is rebuilt.See the package loaded in the browser console:
It does seem eventually that library maintainers will be able to provide packages on PyPI that will be compatible with browser runtimes.
In theory, it should also probably be possible to download Pyodide's numpy wheel but
pip
gets upset about the platform for the downloaded wheel.Additional context
No response
The text was updated successfully, but these errors were encountered: