diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 4e34445..26d5fbb 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -78,7 +78,11 @@ jobs: python: "cp313t" - buildplat: [ macos13, macosx_x86_64, openblas ] python: "cp314t" - + include: + - buildplat: [ ubuntu-22.04, pyodide_wasm32, "" ] + python: "cp312" + - buildplat: [ ubuntu-22.04, pyodide_wasm32, "" ] + python: "cp313" env: IS_32_BIT: ${{ matrix.buildplat[1] == 'win32' }} # used in a cibw_*.sh script @@ -139,17 +143,20 @@ jobs: echo "CIBW_ENVIRONMENT_MACOS=PKG_CONFIG_PATH=$PWD/.openblas" >> "$GITHUB_ENV" fi - # Used to run cibuildwheel - - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 - with: - python-version: "3.13" + - name: Pyodide setup + if: ${{ matrix.buildplat[1] == 'pyodide_wasm32' }} + run: | + echo "CIBW_PLATFORM=pyodide" >> "$GITHUB_ENV" - - name: Build wheel + - name: Build wheels + uses: pypa/cibuildwheel@c923d83ad9c1bc00211c5041d0c3f73294ff88f6 env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} - run: | - python -m pip install cibuildwheel==3.1.1 - python -m cibuildwheel numpy-src --config-file cibuildwheel.toml --output-dir ./dist + SRC: ${{ github.workspace }}/numpy-src + with: + package-dir: numpy-src + output-dir: dist + config-file: cibuildwheel.toml - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: diff --git a/cibuildwheel.toml b/cibuildwheel.toml index beacb56..2f38915 100644 --- a/cibuildwheel.toml +++ b/cibuildwheel.toml @@ -34,3 +34,13 @@ repair-wheel-command = "bash -el ./tools/wheels/repair_windows.sh {wheel} {dest_ select = ["*-win32"] config-settings = {setup-args = ["--vsenv", "-Dallow-noblas=true"], build-dir="build"} repair-wheel-command = "" + +[tool.cibuildwheel.pyodide] +before-test = "pip install -r $SRC/requirements/emscripten_test_requirements.txt" +# Pyodide ensures that the wheels are already repaired by auditwheel-emscripten +repair-wheel-command = "" +test-command = "python -m pytest --pyargs numpy -m 'not slow'" + +[tool.cibuildwheel.pyodide.config-settings] +build-dir = "build" +setup-args = ["--cross-file=$SRC/tools/ci/emscripten/emscripten.meson.cross", "-Dblas=none", "-Dlapack=none"]