-
-
Notifications
You must be signed in to change notification settings - Fork 355
Add Pyodide support and CI jobs for Zarr #1903
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
Open
agriyakhetarpal
wants to merge
81
commits into
zarr-developers:main
Choose a base branch
from
agriyakhetarpal:emscripten
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 24 commits
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
9f5a110
Add CI job to test out-of-tree Pyodide builds
agriyakhetarpal 29282fc
Add `[msgpack]` dependency for `numcodecs`
agriyakhetarpal d465742
Bump to Pyodide 0.26.0, update comments
agriyakhetarpal cdf0bb2
Try to run tests without async
agriyakhetarpal dfe0321
Move shared file to rootdir, outside v2 and v3
agriyakhetarpal b100ec9
Move `fasteners` import inside ThreadSynchronizer
agriyakhetarpal b0dddca
Make the tests directory importable, fix `_shared`
agriyakhetarpal d227728
Import list of greetings from `numcodecs`
agriyakhetarpal fdb2bef
Skip some tests that use threading
agriyakhetarpal 621077a
Skip some tests that use `fcntl`
agriyakhetarpal 7ae9a97
Skip tests that require `dbm`
agriyakhetarpal 22eb6da
Move `IS_WASM` logic to internal `zarr` API
agriyakhetarpal 6836947
Skip a few tests trying to import `multiprocessing`
agriyakhetarpal fe3bf27
Skip tests that use async and threading code
agriyakhetarpal 08997ec
Improve `asyncio_tests_wrapper`, fix test imports
agriyakhetarpal 9bfc860
Skip entire `test_codecs.py` file
agriyakhetarpal 9bcb350
Skip yet another test that requires threads
agriyakhetarpal 9985abb
xfail test where array's fill values are different
agriyakhetarpal 7ea12ef
xfail test because Emscripten FS
agriyakhetarpal a6565de
Skip last test that tries to run threads
agriyakhetarpal 85f621c
Another test that tries to run threads
agriyakhetarpal 1a64255
xfail another array's differing `fill_values` test
agriyakhetarpal c8cb38b
Skip entire sync file under WASM, no threading
agriyakhetarpal eb36d40
Restore pytest config options, remove when needed
agriyakhetarpal e3bf365
Merge main
agriyakhetarpal b3a5b8a
Bump Emscripten, Pyodide xbuildenv, Node.js versions
agriyakhetarpal 42d2792
Running on `ubuntu-latest` should be fine
agriyakhetarpal 27068e2
Don't persist credentials with git clone
agriyakhetarpal aff9b18
Don't pin the version of `pyodide-build`
agriyakhetarpal bb2c136
Use same xbuildenv for building and testing
agriyakhetarpal 710195a
Temporarily build numcodecs for WASM as well
agriyakhetarpal 07e5bc9
Use Pyodide 0.28.0a2 for now
agriyakhetarpal 403fbb0
Use `fetch-depth: 0` to bring correct versions
agriyakhetarpal 24dbc77
Skip `test_multiprocessing` for WASM
agriyakhetarpal ecea615
Skip all sync tests
agriyakhetarpal d919bd7
xfail `test_array_roundtrip` for now
agriyakhetarpal 0bb7d47
Skip `test_group_members_performance[memory]` for now
agriyakhetarpal fb59eba
Set concurrency and max workers as 1
agriyakhetarpal 4c6bed6
Update `zarr.config` tests to match
agriyakhetarpal 6754131
Move WASM check to resolve circular import
agriyakhetarpal f426ed7
Mark Blosc `test_typesize` as a known failure case
agriyakhetarpal 405d247
Skip `async.concurrency` config override test case
agriyakhetarpal e93073a
Mark some indexing tests as flaky on WASM
agriyakhetarpal d862953
Oops, fix a config test
agriyakhetarpal cbd1d4d
Fix another config test
agriyakhetarpal 3e8bdef
Hook into Pyodide WebLoop
agriyakhetarpal 4ee492e
Move `zarr.constants` to `zarr._constants`
agriyakhetarpal d94970e
Bump to Pyodide 0.28.0a3
agriyakhetarpal cd3424c
Fix typo
agriyakhetarpal 5044a22
`asyncio_mode = "auto"` works now, clean it up
agriyakhetarpal e131867
Restore `test_group_members_performance`
agriyakhetarpal c7c22dc
Disable SIMD when building numcodecs
agriyakhetarpal e62c933
Oops, disable AVX2, SSE2 at the right place
agriyakhetarpal d3bcf56
Debug improper numcodecs version
agriyakhetarpal e4b7379
Debug numcodecs version again
agriyakhetarpal 35cecc1
Fetch tags manually for now
agriyakhetarpal ceb70c7
Force Zarr to install
agriyakhetarpal 1ea992f
Install `numcodecs` with `crc32c`
agriyakhetarpal f51ddd1
Install the rest of the missing dependencies
agriyakhetarpal 0ec47b9
Escape wheel filename correctly
agriyakhetarpal e1617c0
Remove extra install line
agriyakhetarpal 23e34bf
Fix misquoted end
agriyakhetarpal 22e6795
Remove lenience for performance test, skip it instead
agriyakhetarpal da8bfc7
Undo async.concurrency to 1, improve performance
agriyakhetarpal 81f5df3
Add `slow_wasm` marker, skip orthogonal indexing tests
agriyakhetarpal bad9920
Move WebLoop patch to `conftest.py`
agriyakhetarpal 2217455
Mark more indexing tests as slow in WASM
agriyakhetarpal 86f8785
Fix condition for slow WASM tests
agriyakhetarpal 3230892
Clearer skip message for slow WASM tests
agriyakhetarpal 07b5645
Merge main
agriyakhetarpal ef70cbd
Add release note for Pyodide/WASM support.
agriyakhetarpal 9212c0e
Ignore WASM code paths Codecov doesn't know about
agriyakhetarpal 86323eb
Bring back numcodecs version check
agriyakhetarpal 9c6af32
Revert "Bring back numcodecs version check"
agriyakhetarpal 090c62b
Add guidance highlighting JSPI requirement
agriyakhetarpal 3f2d41d
Merge branch 'main' into emscripten
agriyakhetarpal b89f682
Drop `shutdown_asyncgens` fixture
agriyakhetarpal 700aae4
Clarify docs for JSPI availability and usage
agriyakhetarpal 93680d2
Merge branch 'main' into emscripten
agriyakhetarpal 401311e
Fix lint error
agriyakhetarpal dd25a36
Update release note with JSPI info
agriyakhetarpal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,78 @@ | ||
# Attributed to NumPy https://github.com/numpy/numpy/pull/25894 | ||
# https://github.com/numpy/numpy/blob/d2d2c25fa81b47810f5cbd85ea6485eb3a3ffec3/.github/workflows/emscripten.yml | ||
|
||
name: Pyodide wheel | ||
|
||
on: | ||
# TODO: refine after this is ready to merge | ||
[push, pull_request, workflow_dispatch] | ||
|
||
env: | ||
FORCE_COLOR: 3 | ||
PYODIDE_VERSION: 0.26.0 | ||
# PYTHON_VERSION and EMSCRIPTEN_VERSION are determined by PYODIDE_VERSION. | ||
# The appropriate versions can be found in the Pyodide repodata.json | ||
# "info" field, or in Makefile.envs: | ||
# https://github.com/pyodide/pyodide/blob/main/Makefile.envs#L2 | ||
PYTHON_VERSION: 3.12.1 | ||
EMSCRIPTEN_VERSION: 3.1.58 | ||
NODE_VERSION: 18 | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read # to fetch code (actions/checkout) | ||
|
||
jobs: | ||
build_wasm_emscripten: | ||
name: Build and test Zarr for Pyodide | ||
runs-on: ubuntu-22.04 | ||
# To enable this workflow on a fork, comment out: | ||
# FIXME: uncomment after this is ready to merge | ||
# if: github.repository == 'zarr-developers/zarr-python' | ||
steps: | ||
- name: Checkout Zarr repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ env.PYTHON_VERSION }} | ||
id: setup-python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Set up Emscripten toolchain | ||
uses: mymindstorm/setup-emsdk@v14 | ||
with: | ||
version: ${{ env.EMSCRIPTEN_VERSION }} | ||
actions-cache-folder: emsdk-cache | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Install pyodide-build | ||
run: python -m pip install "pyodide-build==${{ env.PYODIDE_VERSION }}" | ||
|
||
- name: Build Zarr for Pyodide | ||
run: | | ||
pyodide build | ||
|
||
- name: Run Zarr tests for Pyodide | ||
run: | | ||
# Avoid missing asyncio plugin error from pytest, unavailable in Pyodide | ||
if grep -q 'asyncio_mode = "auto"' "pyproject.toml"; then sed '/asyncio_mode = "auto"/d' "pyproject.toml" > temp && mv temp "pyproject.toml"; fi | ||
pyodide venv .venv-pyodide | ||
source .venv-pyodide/bin/activate | ||
python -m pip install dist/*.whl | ||
python -m pip install pytest pytest-cov | ||
python -m pytest -v --cov=zarr --cov-config=pyproject.toml | ||
|
||
- name: Upload Pyodide wheel artifact for debugging | ||
# FIXME: Remove after this is ready to merge | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: zarr-pyodide-wheel | ||
path: dist/*.whl |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.