From 5057d98a92f4a78305cac1eabfd7e5630c3adb46 Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Thu, 14 Aug 2025 17:54:09 +1000 Subject: [PATCH 01/14] BLD: wasm --- .github/workflows/wheels.yml | 11 ++++++++++- cibuildwheel.toml | 10 ++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 4e34445..481fa99 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 @@ -147,7 +151,12 @@ jobs: - name: Build wheel env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + SRC: ${{ github.workspace }}/numpy-src run: | + if [[ $CIBW_BUILD == *pyodide_wasm32 ]]; then + # specifying CIBW_PLATFORM is required to get the wasm build to work + export CIBW_PLATFORM="pyodide" + fi python -m pip install cibuildwheel==3.1.1 python -m cibuildwheel numpy-src --config-file cibuildwheel.toml --output-dir ./dist 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"] From 9b14e6f48adcd7c2e7dd4b46f9bef67b0d89708e Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Thu, 14 Aug 2025 20:27:27 +1000 Subject: [PATCH 02/14] BLD: wasm --- .github/workflows/wheels.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 481fa99..d768366 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -148,15 +148,16 @@ jobs: with: python-version: "3.13" + - name: Pyodide setup + if: ${{ matrix.buildplat[1] == 'pyodide_wasm32' }} + run: | + echo "CIBW_PLATFORM=pyodide" >> "$GITHUB_ENV" + - name: Build wheel env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} SRC: ${{ github.workspace }}/numpy-src run: | - if [[ $CIBW_BUILD == *pyodide_wasm32 ]]; then - # specifying CIBW_PLATFORM is required to get the wasm build to work - export CIBW_PLATFORM="pyodide" - fi python -m pip install cibuildwheel==3.1.1 python -m cibuildwheel numpy-src --config-file cibuildwheel.toml --output-dir ./dist From 2228d1f8f30e03b8e8eeee4b516329aa445ecd25 Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Thu, 14 Aug 2025 20:36:24 +1000 Subject: [PATCH 03/14] BLD: update cibuildwheel version --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index d768366..61633cc 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -158,7 +158,7 @@ jobs: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} SRC: ${{ github.workspace }}/numpy-src run: | - python -m pip install cibuildwheel==3.1.1 + python -m pip install cibuildwheel==3.1.3 python -m cibuildwheel numpy-src --config-file cibuildwheel.toml --output-dir ./dist - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 From 0b773d7b0c9a196cc8d13e12fc0c8691d66576d8 Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Thu, 21 Aug 2025 11:26:38 +1000 Subject: [PATCH 04/14] BLD: bump cibuildwheel --- .github/workflows/wheels.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 61633cc..a97a2e2 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -49,19 +49,19 @@ jobs: # https://github.com/github/feedback/discussions/7835#discussioncomment-1769026 buildplat: - [ubuntu-22.04, manylinux_x86_64, ""] - - [ubuntu-22.04, musllinux_x86_64, ""] - - [ubuntu-22.04-arm, manylinux_aarch64, ""] - - [ubuntu-22.04-arm, musllinux_aarch64, ""] - - [macos-13, macosx_x86_64, openblas] - - # targeting macos >= 14. Could probably build on macos-14, but it would be a cross-compile - - [macos-13, macosx_x86_64, accelerate] - - [macos-14, macosx_arm64, openblas] - - [macos-14, macosx_arm64, accelerate] - - [windows-2022, win_amd64, ""] - - [windows-2022, win32, ""] - - [windows-11-arm, win_arm64, ""] - python: ["cp311", "cp312", "cp313", "cp313t", "cp314", "cp314t", "pp311"] +# - [ubuntu-22.04, musllinux_x86_64, ""] +# - [ubuntu-22.04-arm, manylinux_aarch64, ""] +# - [ubuntu-22.04-arm, musllinux_aarch64, ""] +# - [macos-13, macosx_x86_64, openblas] +# +# # targeting macos >= 14. Could probably build on macos-14, but it would be a cross-compile +# - [macos-13, macosx_x86_64, accelerate] +# - [macos-14, macosx_arm64, openblas] +# - [macos-14, macosx_arm64, accelerate] +# - [windows-2022, win_amd64, ""] +# - [windows-2022, win32, ""] +# - [windows-11-arm, win_arm64, ""] + python: ["cp311"]#, "cp312", "cp313", "cp313t", "cp314", "cp314t", "pp311"] exclude: # Don't build PyPy 32-bit windows - buildplat: [windows-2022, win32, ""] @@ -158,7 +158,7 @@ jobs: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} SRC: ${{ github.workspace }}/numpy-src run: | - python -m pip install cibuildwheel==3.1.3 + python -m pip install cibuildwheel==3.1.4 python -m cibuildwheel numpy-src --config-file cibuildwheel.toml --output-dir ./dist - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 From 3125cbb59c7435abd219a772ef0502cb06b26db6 Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Thu, 21 Aug 2025 11:35:58 +1000 Subject: [PATCH 05/14] BLD: try excluding CIBW_BUILD --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index a97a2e2..0104bc6 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -155,7 +155,7 @@ jobs: - name: Build wheel env: - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + # CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} SRC: ${{ github.workspace }}/numpy-src run: | python -m pip install cibuildwheel==3.1.4 From 2b83a69cfe46b356989e49d6b523b4f888ef9f4c Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Thu, 21 Aug 2025 12:02:10 +1000 Subject: [PATCH 06/14] BLD: reinclude CIBW_BUILD --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0104bc6..a97a2e2 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -155,7 +155,7 @@ jobs: - name: Build wheel env: - # CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} SRC: ${{ github.workspace }}/numpy-src run: | python -m pip install cibuildwheel==3.1.4 From 3973c2bf4507f49cf30d33aa82397e9e872565b8 Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Thu, 21 Aug 2025 14:40:30 +1000 Subject: [PATCH 07/14] BLD: try 3.12 --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index a97a2e2..710b4a2 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -146,7 +146,7 @@ jobs: # Used to run cibuildwheel - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: - python-version: "3.13" + python-version: "3.12" - name: Pyodide setup if: ${{ matrix.buildplat[1] == 'pyodide_wasm32' }} From f71f2a2f0b4e2d522457185d2e461e6375ac3f0a Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Thu, 21 Aug 2025 14:44:55 +1000 Subject: [PATCH 08/14] BLD: try 3.14 --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 710b4a2..924b63c 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -146,7 +146,7 @@ jobs: # Used to run cibuildwheel - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: - python-version: "3.12" + python-version: "3.14" - name: Pyodide setup if: ${{ matrix.buildplat[1] == 'pyodide_wasm32' }} From 7afb35740d230ef4488cfa4c373d0207945a8f47 Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Thu, 21 Aug 2025 14:47:34 +1000 Subject: [PATCH 09/14] BLD: try 3.14 --- .github/workflows/wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 924b63c..09716f0 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -147,6 +147,7 @@ jobs: - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: "3.14" + allow-prereleases: true - name: Pyodide setup if: ${{ matrix.buildplat[1] == 'pyodide_wasm32' }} From 02b54f031f442df117d9c285d9721ece767c356a Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Thu, 21 Aug 2025 15:12:31 +1000 Subject: [PATCH 10/14] BLD: go through cibuildwheel action --- .github/workflows/wheels.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 09716f0..0c109b2 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -144,23 +144,33 @@ jobs: fi # Used to run cibuildwheel - - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 - with: - python-version: "3.14" - allow-prereleases: true +# - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 +# with: +# python-version: "3.14" +# allow-prereleases: true - 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@v3.1.4 env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} SRC: ${{ github.workspace }}/numpy-src - run: | - python -m pip install cibuildwheel==3.1.4 - python -m cibuildwheel numpy-src --config-file cibuildwheel.toml --output-dir ./dist + with: + package-dir: numpy-src + output-dir: dist + config-file: cibuildwheel.toml + +# - name: Build wheel +# env: +# CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} +# SRC: ${{ github.workspace }}/numpy-src +# run: | +# python -m pip install cibuildwheel==3.1.4 +# python -m cibuildwheel numpy-src --config-file cibuildwheel.toml --output-dir ./dist - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: From aa52ba7152280f102fe3fcbafd9b03d11ea4e53d Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Tue, 26 Aug 2025 13:07:00 +1000 Subject: [PATCH 11/14] BLD: clean up --- .github/workflows/wheels.yml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0c109b2..8eb8983 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -143,17 +143,6 @@ 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.14" -# allow-prereleases: true - - - name: Pyodide setup - if: ${{ matrix.buildplat[1] == 'pyodide_wasm32' }} - run: | - echo "CIBW_PLATFORM=pyodide" >> "$GITHUB_ENV" - - name: Build wheels uses: pypa/cibuildwheel@v3.1.4 env: @@ -164,14 +153,6 @@ jobs: output-dir: dist config-file: cibuildwheel.toml -# - name: Build wheel -# env: -# CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} -# SRC: ${{ github.workspace }}/numpy-src -# run: | -# python -m pip install cibuildwheel==3.1.4 -# python -m cibuildwheel numpy-src --config-file cibuildwheel.toml --output-dir ./dist - - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }} From f6f751ba50f55322286a07796a7fa4db272de7af Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Tue, 26 Aug 2025 13:25:47 +1000 Subject: [PATCH 12/14] CI: cibuildwheel full hash commit --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 8eb8983..00ed85d 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -144,7 +144,7 @@ jobs: fi - name: Build wheels - uses: pypa/cibuildwheel@v3.1.4 + uses: pypa/cibuildwheel@c923d83ad9c1bc00211c5041d0c3f73294ff88f6 env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} SRC: ${{ github.workspace }}/numpy-src From 6bea741b251ccbeb2e7049b832cf668db4ff04d7 Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Tue, 26 Aug 2025 13:34:53 +1000 Subject: [PATCH 13/14] BLD: CIBW_PLATFORM --- .github/workflows/wheels.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 00ed85d..92a9b17 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -143,6 +143,11 @@ jobs: echo "CIBW_ENVIRONMENT_MACOS=PKG_CONFIG_PATH=$PWD/.openblas" >> "$GITHUB_ENV" fi + - name: Pyodide setup + if: ${{ matrix.buildplat[1] == 'pyodide_wasm32' }} + run: | + echo "CIBW_PLATFORM=pyodide" >> "$GITHUB_ENV" + - name: Build wheels uses: pypa/cibuildwheel@c923d83ad9c1bc00211c5041d0c3f73294ff88f6 env: From 0cc149f1f1f09bc0c9340ce62c224a69f5bb675c Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Tue, 26 Aug 2025 13:46:20 +1000 Subject: [PATCH 14/14] BLD: reenable other targets --- .github/workflows/wheels.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 92a9b17..26d5fbb 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -49,19 +49,19 @@ jobs: # https://github.com/github/feedback/discussions/7835#discussioncomment-1769026 buildplat: - [ubuntu-22.04, manylinux_x86_64, ""] -# - [ubuntu-22.04, musllinux_x86_64, ""] -# - [ubuntu-22.04-arm, manylinux_aarch64, ""] -# - [ubuntu-22.04-arm, musllinux_aarch64, ""] -# - [macos-13, macosx_x86_64, openblas] -# -# # targeting macos >= 14. Could probably build on macos-14, but it would be a cross-compile -# - [macos-13, macosx_x86_64, accelerate] -# - [macos-14, macosx_arm64, openblas] -# - [macos-14, macosx_arm64, accelerate] -# - [windows-2022, win_amd64, ""] -# - [windows-2022, win32, ""] -# - [windows-11-arm, win_arm64, ""] - python: ["cp311"]#, "cp312", "cp313", "cp313t", "cp314", "cp314t", "pp311"] + - [ubuntu-22.04, musllinux_x86_64, ""] + - [ubuntu-22.04-arm, manylinux_aarch64, ""] + - [ubuntu-22.04-arm, musllinux_aarch64, ""] + - [macos-13, macosx_x86_64, openblas] + + # targeting macos >= 14. Could probably build on macos-14, but it would be a cross-compile + - [macos-13, macosx_x86_64, accelerate] + - [macos-14, macosx_arm64, openblas] + - [macos-14, macosx_arm64, accelerate] + - [windows-2022, win_amd64, ""] + - [windows-2022, win32, ""] + - [windows-11-arm, win_arm64, ""] + python: ["cp311", "cp312", "cp313", "cp313t", "cp314", "cp314t", "pp311"] exclude: # Don't build PyPy 32-bit windows - buildplat: [windows-2022, win32, ""]