Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@agriyakhetarpal
Copy link
Collaborator

Description

At the time of writing, this PR intends to test out pypa/cibuildwheel#1456 for building WASM wheels with Python 3.12.1 and Emscripten 3.1.58.

Additional context

  1. The cibuildwheel documentation: https://cibuildwheel.pypa.io/en/latest/setup/#pyodide-webassembly-builds-experimental

@agriyakhetarpal agriyakhetarpal marked this pull request as draft May 30, 2024 12:00
@agriyakhetarpal agriyakhetarpal added maintenance CI Continuous integration labels May 30, 2024
@agriyakhetarpal agriyakhetarpal force-pushed the cibuildwheel-pyodide branch 2 times, most recently from 5ecb7fc to b4f3a80 Compare May 30, 2024 20:34
@agriyakhetarpal
Copy link
Collaborator Author

agriyakhetarpal commented May 30, 2024

Wheel builds and tests are passing here (🎉): https://github.com/PyWavelets/pywt/actions/runs/9308866217/job/25623111691

There is one thing to be noted, though. Maybe this is a valid bug that we either need to raise upstream, or I did some invalid tinkering: none of the commands as follows: pytest --pyargs pywt / pytest pywt / pytest {project} / pytest {package} seem to be working, and that's probably one of the downsides of not having an src layout for PyWavelets (side note, should we switch to it for v1.6.1 or v1.7.0? I feel it should be trivial). Regular pytest also does not work right now and it picks up the wrong pytest on the PATH, which I already know is coming from pyodide/pyodide#4802. Therefore, I tried python -m pytest <...> commands, which all failed because they tried to load the extension somehow from the root directory and not cibuildwheel's venv (or I'm using the replaceable markers {package} and {project} incorrectly). Lastly, the pywt.test() API is the only invocation method that ended up in success, so, we can go with that for now – I have no strong opinions about this choice.

P.S. I was confused as to why the wheel gets retagged with the ABI tag pyodide_2024_0 rather than emscripten_3_1_58 but I later realised that this came from https://github.com/pypa/cibuildwheel/pull/1456/files#diff-2b69544a3d026eefdb78165338361dd2def21bc816d39774b9523265d1c84481R243-R248 and pyodide/pyodide#4777 😅

@rgommers
Copy link
Member

rgommers commented Jun 2, 2024

none of the commands as follows: pytest --pyargs pywt / pytest pywt / pytest {project} / pytest {package} seem to be working

Isn't that a matter of doing cd doc && pytest --pyargs pywt or some such thing?

@agriyakhetarpal
Copy link
Collaborator Author

agriyakhetarpal commented Jun 2, 2024

I thought so too, it's the usual pytest peculiarity because it can't find the shared objects to import from the source folder. However, the cibuildwheel documentation says that the package to be tested is imported from a new virtual environment where it gets installed at the time of testing, and not from the CI workspace directory for exactly this reason, so I expected that it would avoid that

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now. CI is green, CI log looks nice and everything seems to be in order there, and code is easier to understand. So in it goes. Thanks @agriyakhetarpal!

@rgommers rgommers merged commit e25eed5 into PyWavelets:main Jun 25, 2024
@agriyakhetarpal agriyakhetarpal deleted the cibuildwheel-pyodide branch June 25, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous integration maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants