docs: Update projects #48
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: 2026 The RISE Project | |
| # SPDX-License-Identifier: MIT | |
| --- | |
| # Based on the build_unix job of | |
| # https://github.com/wannesm/dtaidistance/blob/v2.4.0/.github/workflows/deploy.yml | |
| name: Build dtaidistance wheels (riscv64) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version glob to (re)build; empty builds every version of docs/packages/dtaidistance.yaml not released yet' | |
| required: false | |
| default: '' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-dtaidistance.yml' | |
| - 'docs/packages/dtaidistance.yaml' | |
| - 'patches/dtaidistance/**' | |
| push: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-dtaidistance.yml' | |
| - 'docs/packages/dtaidistance.yaml' | |
| - 'patches/dtaidistance/**' | |
| 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: dtaidistance | |
| version: ${{ inputs.version }} | |
| build_wheels: | |
| needs: [setup] | |
| if: needs.setup.outputs.versions != '[]' | |
| name: Build dtaidistance ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 | |
| runs-on: ubuntu-24.04-riscv | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| python: ["cp312", "cp313", "cp314", "cp314t"] | |
| env: | |
| DTAIDISTANCE_VERSION: ${{ matrix.version }} | |
| steps: | |
| - name: Checkout dtaidistance v${{ env.DTAIDISTANCE_VERSION }} | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| repository: wannesm/dtaidistance | |
| ref: v${{ env.DTAIDISTANCE_VERSION }} | |
| persist-credentials: false | |
| - name: Checkout python-wheels | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| path: python-wheels | |
| persist-credentials: false | |
| # libgomp's guided schedule segfaults on the riscv64 runners | |
| # (riseproject-dev/python-wheels#617); schedule(static, 1) is unaffected. | |
| - name: Apply patches | |
| run: git apply python-wheels/patches/dtaidistance/${{ env.DTAIDISTANCE_VERSION }}/00*.patch | |
| - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 | |
| with: | |
| output-dir: wheelhouse/ | |
| only: ${{ matrix.python }}-manylinux_riscv64 | |
| env: | |
| CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} | |
| # Cython >=3.2.0's "already imported" fast path mistruncates the | |
| # resolved qualname for util_numpy_cc.pyx's bare `import dtw_cc`, | |
| # binding it to the top-level dtaidistance package (gotcha 175). | |
| CIBW_BEFORE_ALL: echo 'Cython<3.2.0' > /cython-constraint.txt | |
| CIBW_ENVIRONMENT: >- | |
| PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ | |
| PIP_ONLY_BINARY=numpy,scipy,matplotlib | |
| PIP_CONSTRAINT=/cython-constraint.txt | |
| PIP_BUILD_CONSTRAINT=/cython-constraint.txt | |
| CIBW_TEST_EXTRAS: "dev" | |
| # test_lc_pat3 does Path(os.environ.get('TESTDIR', None)) unconditionally | |
| # (every sibling test defaults to Path(__file__).parent instead) and | |
| # crashes with TESTDIR unset, which upstream's own CI never sets either | |
| # (gotcha 14: -k over a path-based --deselect). | |
| CIBW_TEST_COMMAND: pytest --ignore=venv --benchmark-skip -k "not test_lc_pat3" {project}/tests | |
| - name: Store wheels | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: dtaidistance-${{ env.DTAIDISTANCE_VERSION }}-${{ matrix.python }}-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: | |
| DTAIDISTANCE_VERSION: ${{ matrix.version }} | |
| steps: | |
| - name: Checkout python-wheels | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| # dtw_cc_omp links -fopenmp, so auditwheel vendors the image's libgomp | |
| # into dtaidistance.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: dtaidistance-${{ env.DTAIDISTANCE_VERSION }}-gpl-sources | |
| path: gpl-sources.tar | |
| if-no-files-found: error | |
| publish: | |
| name: Publish dtaidistance ${{ 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: dtaidistance-${{ matrix.version }}-*-manylinux_riscv64 | |
| gpl-sources-artifact: dtaidistance-${{ matrix.version }}-gpl-sources | |
| gpl-sources-description: gcc |