|
15 | 15 | DISABLE_NUMCODECS_AVX2: 1
|
16 | 16 | DISABLE_NUMCODECS_SSE2: 1
|
17 | 17 | # Common environment variables for both build and test jobs
|
18 |
| - PYODIDE_VERSION: 0.25.1 |
| 18 | + PYODIDE_VERSION: 0.27.0a2 |
19 | 19 | # PYTHON_VERSION and EMSCRIPTEN_VERSION are determined by PYODIDE_VERSION.
|
20 | 20 | # The appropriate versions can be found in the Pyodide repodata.json
|
21 | 21 | # "info" field, or in Makefile.envs:
|
22 | 22 | # https://github.com/pyodide/pyodide/blob/main/Makefile.envs#L2
|
23 |
| - PYTHON_VERSION: 3.11.3 |
24 |
| - EMSCRIPTEN_VERSION: 3.1.46 |
25 |
| - NODE_VERSION: 18 |
| 23 | + PYTHON_VERSION: 3.12.1 |
| 24 | + EMSCRIPTEN_VERSION: 3.1.58 |
| 25 | + NODE_VERSION: 20 |
26 | 26 |
|
27 | 27 | concurrency:
|
28 | 28 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
@@ -62,68 +62,30 @@ jobs:
|
62 | 62 | patch -p1 < tools/ci/patches/0002-add-missing-unistd-headers.patch
|
63 | 63 |
|
64 | 64 | - name: Install pyodide-build
|
65 |
| - run: python -m pip install "pydantic<2" "pyodide-build==${{ env.PYODIDE_VERSION }}" |
| 65 | + run: python -m pip install pyodide-build |
66 | 66 |
|
67 |
| - - name: Build numcodecs for Pyodide |
68 |
| - run: | |
69 |
| - pyodide build |
70 |
| -
|
71 |
| - - name: Set up Node.js |
72 |
| - uses: actions/setup-node@v4 |
73 |
| - with: |
74 |
| - node-version: ${{ env.NODE_VERSION }} |
75 |
| - |
76 |
| - - name: Upload Pyodide wheel artifact |
77 |
| - uses: actions/upload-artifact@v4 |
78 |
| - with: |
79 |
| - name: numcodecs-pyodide-wheel |
80 |
| - path: dist/*.whl |
81 |
| - |
82 |
| - test-wasm-emscripten: |
83 |
| - name: Test numcodecs Pyodide distribution |
84 |
| - runs-on: ubuntu-22.04 |
85 |
| - needs: [build-wasm-emscripten] |
86 |
| - steps: |
87 |
| - - name: Set up Python ${{ env.PYTHON_VERSION }} |
88 |
| - id: setup-python |
89 |
| - uses: actions/setup-python@v5 |
90 |
| - with: |
91 |
| - python-version: ${{ env.PYTHON_VERSION }} |
92 |
| - |
93 |
| - - name: Checkout necessary patch(es) |
94 |
| - uses: actions/checkout@v4 |
95 |
| - with: |
96 |
| - sparse-checkout: tools/ci/patches/0003-fix-npy-file-access.patch |
97 |
| - sparse-checkout-cone-mode: false |
98 |
| - |
99 |
| - - name: Set up Emscripten toolchain |
100 |
| - uses: mymindstorm/setup-emsdk@v14 |
101 |
| - with: |
102 |
| - version: ${{ env.EMSCRIPTEN_VERSION }} |
103 |
| - actions-cache-folder: emsdk-cache |
104 |
| - |
105 |
| - - name: Apply necessary patch(es) |
106 |
| - # We just need the third patch to fix the npy file access this time |
107 |
| - run: patch -d $EMSDK/upstream/emscripten/ -p1 < tools/ci/patches/0003-fix-npy-file-access.patch |
108 |
| - |
109 |
| - - name: Install pyodide-build |
110 |
| - run: python -m pip install "pydantic<2" "pyodide-build==${{ env.PYODIDE_VERSION }}" |
| 67 | + - name: Build numcodecs for Pyodide/WASM |
| 68 | + run: pyodide build |
111 | 69 |
|
112 | 70 | - name: Set up Node.js
|
113 | 71 | uses: actions/setup-node@v4
|
114 | 72 | with:
|
115 | 73 | node-version: ${{ env.NODE_VERSION }}
|
116 | 74 |
|
117 |
| - - name: Download Pyodide wheel artifact |
118 |
| - uses: actions/download-artifact@v4 |
119 |
| - with: |
120 |
| - path: dist |
121 |
| - merge-multiple: true |
122 |
| - |
123 | 75 | - name: Set up Pyodide virtual environment and test numcodecs for Pyodide
|
124 | 76 | run: |
|
| 77 | + # Pin to a specific version of Pyodide to ensure reliability |
| 78 | + pyodide xbuildenv install ${{ env.PYODIDE_VERSION }} |
| 79 | +
|
| 80 | + # Set up Pyodide virtual environment and activate it |
125 | 81 | pyodide venv .venv-pyodide
|
126 | 82 | source .venv-pyodide/bin/activate
|
| 83 | +
|
| 84 | + # Install the built numcodecs WASM package |
127 | 85 | python -m pip install dist/*.whl
|
128 | 86 | python -m pip install pytest pytest-cov coverage
|
| 87 | +
|
| 88 | + # Change into a different directory before running tests to avoid |
| 89 | + # the test runner picking up the local numcodecs package |
| 90 | + cd docs |
129 | 91 | python -m pytest --pyargs numcodecs
|
0 commit comments