From 13e306604106e4ea6ac92700d93877d648f1198b Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Wed, 30 Sep 2026 14:35:52 +0000 Subject: [PATCH] sparse-dot-topn: Add version 1.2.0 --- .github/workflows/build-sparse-dot-topn.yml | 135 ++++++++++++++++++++ docs/packages/sparse-dot-topn.yaml | 5 + 2 files changed, 140 insertions(+) create mode 100644 .github/workflows/build-sparse-dot-topn.yml create mode 100644 docs/packages/sparse-dot-topn.yaml diff --git a/.github/workflows/build-sparse-dot-topn.yml b/.github/workflows/build-sparse-dot-topn.yml new file mode 100644 index 000000000000..0e1861149730 --- /dev/null +++ b/.github/workflows/build-sparse-dot-topn.yml @@ -0,0 +1,135 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# Based on the `build_wheels` job of +# https://github.com/ing-bank/sparse_dot_topn/blob/v1.2.0/.github/workflows/wheels.yml +name: Build sparse-dot-topn wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/sparse-dot-topn.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-sparse-dot-topn.yml' + - 'docs/packages/sparse-dot-topn.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-sparse-dot-topn.yml' + - 'docs/packages/sparse-dot-topn.yaml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: sparse-dot-topn + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build sparse-dot-topn ${{ matrix.version }} cp312-abi3-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + env: + SPARSE_DOT_TOPN_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout sparse_dot_topn v${{ env.SPARSE_DOT_TOPN_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: ing-bank/sparse_dot_topn + ref: v${{ env.SPARSE_DOT_TOPN_VERSION }} + submodules: true + persist-credentials: false + + # wheel.py-api = "cp312": cp312 builds the one abi3 wheel, cp313/cp314 re-test it. + - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + output-dir: wheelhouse/ + env: + CIBW_ARCHS: riscv64 + CIBW_BUILD: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + CIBW_ENVIRONMENT: >- + CMAKE_ARGS="-DSDTN_ENABLE_ARCH_FLAGS=OFF -DSDTN_ENABLE_OPENMP=ON -DSDTN_DISABLE_OPENMP=OFF" + PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + PIP_ONLY_BINARY=numpy,scipy,psutil + CIBW_TEST_COMMAND: pytest {project}/tests && python -c "from sparse_dot_topn import _has_openmp_support;assert _has_openmp_support" + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: sparse-dot-topn-${{ env.SPARSE_DOT_TOPN_VERSION }}-cp312-abi3-manylinux_riscv64 + path: ./wheelhouse/*.whl + if-no-files-found: error + + gpl_sources: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + name: Collect GPL sources + runs-on: ubuntu-24.04-riscv + + env: + SPARSE_DOT_TOPN_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout python-wheels + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + # SDTN_ENABLE_OPENMP links libgomp, which auditwheel vendors into sparse_dot_topn.libs/. + - uses: ./actions/collect-gpl-sources + with: + image: ${{ env.MANYLINUX_RISCV64_IMAGE }} + packages: gcc + output: gpl-sources.tar + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: sparse-dot-topn-${{ env.SPARSE_DOT_TOPN_VERSION }}-gpl-sources + path: gpl-sources.tar + if-no-files-found: error + + publish: + name: Publish sparse-dot-topn ${{ matrix.version }} + needs: [setup, build_wheels, gpl_sources] + if: needs.setup.outputs.versions != '[]' + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + secrets: + app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} + with: + artifact-pattern: sparse-dot-topn-${{ matrix.version }}-*-manylinux_riscv64 + gpl-sources-artifact: sparse-dot-topn-${{ matrix.version }}-gpl-sources + gpl-sources-description: gcc diff --git a/docs/packages/sparse-dot-topn.yaml b/docs/packages/sparse-dot-topn.yaml new file mode 100644 index 000000000000..b84998b8a7a8 --- /dev/null +++ b/docs/packages/sparse-dot-topn.yaml @@ -0,0 +1,5 @@ +package-name: sparse-dot-topn +source-code: https://github.com/ing-bank/sparse_dot_topn +license: Apache-2.0 +versions: +- version: 1.2.0