Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
build_wheels:
name: Build wheel ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }}
# To enable this job on a fork, comment out:
if: github.repository == 'numpy/numpy'
if: github.repository == 'numpy/numpy' || github.repository == 'riseproject-dev/numpy'
runs-on: ${{ matrix.buildplat[0] }}
strategy:
fail-fast: false
Expand All @@ -39,6 +39,7 @@ jobs:
- [ubuntu-22.04, musllinux_x86_64, ""]
- [ubuntu-22.04-arm, manylinux_aarch64, ""]
- [ubuntu-22.04-arm, musllinux_aarch64, ""]
- [ubuntu-24.04-riscv, manylinux_riscv64, ""]
- [macos-15-intel, macosx_x86_64, openblas]
- [macos-14, macosx_arm64, openblas]
- [windows-2022, win_amd64, ""]
Expand All @@ -54,6 +55,12 @@ jobs:
submodules: true
persist-credentials: false

- name: Setup Python for riscv64
if: matrix.buildplat[1] == 'manylinux_riscv64'
run: |
echo "/opt/python-3.12/bin" >> "$GITHUB_PATH"
/opt/python-3.12/bin/python3.12 -m pip install cibuildwheel==3.4.0

- name: Setup MSVC (32-bit)
if: ${{ matrix.buildplat[1] == 'win32' }}
uses: bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1
Expand Down Expand Up @@ -99,10 +106,36 @@ jobs:
fi

- name: Build wheels
if: matrix.buildplat[1] != 'manylinux_riscv64'
uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}

- name: Restore ccache for riscv64
if: matrix.buildplat[1] == 'manylinux_riscv64'
uses: actions/cache@v4
with:
path: .ccache
key: ccache-riscv64-${{ matrix.python }}-${{ github.sha }}
restore-keys: |
ccache-riscv64-${{ matrix.python }}-

- name: Build wheels (riscv64)
if: matrix.buildplat[1] == 'manylinux_riscv64'
run: |
mkdir -p ${{ github.workspace }}/.ccache
python3 -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
CIBW_BEFORE_ALL_LINUX: >
yum install -y ccache || true &&
ln -sf $(which ccache) /usr/local/bin/gcc &&
ln -sf $(which ccache) /usr/local/bin/g++ &&
ln -sf $(which ccache) /usr/local/bin/cc &&
ln -sf $(which ccache) /usr/local/bin/c++
CIBW_CONTAINER_ENGINE: "docker; create_args: --volume=${{ github.workspace }}/.ccache:/root/.cache/ccache"
CIBW_TEST_COMMAND: "python -c \"import numpy; print(numpy.__version__); numpy.show_config()\""

- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }}
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ build-dir = "build"
[tool.cibuildwheel.linux]
manylinux-x86_64-image = "manylinux_2_28"
manylinux-aarch64-image = "manylinux_2_28"
manylinux-riscv64-image = "manylinux_2_39"
musllinux-x86_64-image = "musllinux_1_2"
musllinux-aarch64-image = "musllinux_1_2"

Expand Down
Loading