y-crdt/ypy

Uploading emscripten wheels to pypi fails

kafonek opened this issue · 10 comments

Nooo! https://github.com/y-crdt/ypy/actions/runs/3566940726/jobs/5994217644

I did not see this coming. Apologies, I should have tried to upload an emscripten wheel to test pypi on another project. Looks like pypi/warehouse#10416 is relevant.

I'll revert the wasm build in ci/cd later today if someone else doesn't get to it first.

ERROR    HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/        
         Binary wheel 'y_py-0.5.5-cp310-cp310-emscripten_3_1_14_wasm32.whl' has 
         an unsupported platform tag 'emscripten_3_1_14_wasm32'.                
Error: Process completed with exit code 1.

@Waidhoferj how do you feel about hosting the emscripten wheel as an asset on the y-py release? I've put together a prototype of that over in py-rust-fib. Bit janky that we can't micropip.install right from the github release download link (CORS) but any kind of CORS proxy can get around that as a temporary solution until emscripten wheels can be hosted on pypi.

https://github.com/kafonek/py-rust-fib/releases/tag/second-release has an example of a Python/Rust emscripten wheel attached as an asset. I used https://github.com/softprops/action-gh-release to create the release as a CI action triggered by a tag, but we could also manually attach an emscripten wheel as an asset when creating the release if you do that via the UI right now.

image

@kafonek This is a good fix given the choices we have. Would you be able to alter the wasm path of the wheels action to attach the wheel to the Ypy release?

Yep I think https://github.com/softprops/action-gh-release fits the workflow in this repo. I'll tweak py-rust-fib to match this structure and try it out, then put up a PR. I'll build the emscripten / wasm wheel into a different directory than dist and upload the artifact to a different name than wheels.

This looks great! Thanks for troubleshooting!

Quick update, think I've got the ci actions working but I'll need to tweak the dependencies in pyproject.toml to make maturin an optional dependency, since there's no pure Python wheel for that library.

image

That makes sense. Maturin is a dev dependency and totally unnecessary for library users

Love to see it. Just need to clean up the branch and touch up docs, then I'll put the PR up here.

image

Wow exiting to see it running!