-
-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build and test PyWavelets Pyodide wheels in CI (#701)
The main change is adding a Pyodide CI job. Other changes: * Add some relevant files and venvs to ignore * ensure file handles get closed and use importlib.resources instead of `__file__` * cache data loading * Convert `ecg` and `sst_nino3` data files from .npy to .npz (NumPy compressed archive) for Pyodide compatibility * Properly skip tests for WASM and wherever threading isn't availables * import `importlib.resources`, mark `/pywt/data/` as constant Co-authored-by: Ralf Gommers <[email protected]>
- Loading branch information
1 parent
e69b126
commit 74b4421
Showing
9 changed files
with
109 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Test Pyodide build for PyWavelets | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- v1.** | ||
pull_request: | ||
branches: | ||
- master | ||
- v1.** | ||
|
||
env: | ||
FORCE_COLOR: 3 | ||
|
||
jobs: | ||
build_wasm_emscripten: | ||
name: Build PyWavelets for Pyodide | ||
runs-on: ubuntu-latest | ||
# Uncomment the following line to test changes on a fork | ||
# if: github.repository == 'PyWavelets/pywt' | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.11 | ||
id: setup-python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.11.2' | ||
|
||
- name: Install prerequisites | ||
run: | | ||
python -m pip install pyodide-build "pydantic<2" | ||
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV | ||
- name: Set up Emscripten toolchain | ||
uses: mymindstorm/setup-emscripten@v14 | ||
with: | ||
version: ${{ env.EMSCRIPTEN_VERSION }} | ||
actions-cache-folder: emsdk-cache | ||
|
||
- name: Set up Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: '18' | ||
|
||
- name: Build PyWavelets | ||
run: | | ||
pyodide build | ||
- name: Install and test wheel | ||
run: | | ||
pyodide venv .venv-pyodide | ||
source .venv-pyodide/bin/activate | ||
pip install dist/*.whl | ||
pushd demo | ||
pip install matplotlib pytest | ||
python -c "import pywt; print(pywt.__version__)" | ||
pytest --pyargs pywt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters