Build pipdeptree wheels (riscv64) #3
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 | |
| --- | |
| # This workflow builds directly from a checkout, mirroring upstream's own `wheels` job in | |
| # https://github.com/tox-dev/pipdeptree/blob/4.2.2/.github/workflows/dist.yaml, narrowed to | |
| # riscv64. Cargo.lock is committed, so no separate sdist step is needed (gotcha 10 doesn't | |
| # apply here). | |
| name: Build pipdeptree wheels (riscv64) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'pipdeptree version/tag to build (e.g. 4.2.2)' | |
| required: true | |
| default: '4.2.2' | |
| pull_request: | |
| paths: | |
| - '.github/workflows/build-pipdeptree.yml' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ inputs.version || '4.2.2' }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read # to fetch code (actions/checkout) | |
| env: | |
| # `inputs.version` is empty on pull_request events; default to 4.2.2 there. | |
| PIPDEPTREE_VERSION: ${{ inputs.version || '4.2.2' }} | |
| MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 | |
| jobs: | |
| setup: | |
| uses: $/.github/workflows/_setup.yml | |
| build_wheels: | |
| needs: [setup] | |
| name: Build pipdeptree ${{ inputs.version || '4.2.2' }} ${{ matrix.python }}-manylinux_riscv64 | |
| runs-on: ubuntu-24.04-riscv | |
| timeout-minutes: 90 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # cp310 picks up pyproject.toml's own cp310-* cibuildwheel override, which turns on | |
| # the limited API, so this one wheel is reused+tested on every GIL cp3.10+ interpreter. | |
| # cp314t/cp315t can't use the limited API, so each takes a wheel of its own; the image | |
| # has no cp313t (gotcha 11), but upstream doesn't publish a cp313t wheel either. | |
| python: ["cp310", "cp314t", "cp315t"] | |
| steps: | |
| - name: Checkout pipdeptree ${{ env.PIPDEPTREE_VERSION }} | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| repository: tox-dev/pipdeptree | |
| ref: ${{ env.PIPDEPTREE_VERSION }} | |
| persist-credentials: false | |
| - name: Build wheels | |
| 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 }} | |
| CIBW_BEFORE_ALL_LINUX: >- | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
| # The checkout carries no git history, so tools/version.py can't derive the version | |
| # from tags; PIPDEPTREE_VERSION is the override switch upstream's own CI uses for the | |
| # same reason (a container build over a checkout it doesn't own). | |
| CIBW_ENVIRONMENT_LINUX: >- | |
| PATH=$HOME/.cargo/bin:$PATH | |
| PIPDEPTREE_VERSION=${{ env.PIPDEPTREE_VERSION }} | |
| PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ | |
| # --graph-output/--output=graphviz-* shell out to the `dot` binary. | |
| CIBW_BEFORE_TEST_LINUX: dnf -y install graphviz | |
| # pytest-cov pulls in coverage: test_render_explicit_extras renders pluggy's | |
| # "testing" extra, which lists coverage as a requirement. | |
| CIBW_TEST_REQUIRES: pytest pytest-cov | |
| CIBW_TEST_SOURCES: tests docs | |
| CIBW_TEST_COMMAND: >- | |
| python -c "import pipdeptree._rust as m; assert m.__file__.endswith('.so'), m.__file__" && | |
| pipdeptree --version && | |
| python -m pytest tests -v | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: pipdeptree-${{ env.PIPDEPTREE_VERSION }}-${{ matrix.python }}-manylinux_riscv64 | |
| path: wheelhouse/*.whl | |
| if-no-files-found: error | |
| publish: | |
| name: Publish pipdeptree ${{ inputs.version || '4.2.2' }} | |
| needs: [setup, build_wheels] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| uses: $/.github/workflows/_publish-wheel.yml | |
| with: | |
| artifact-pattern: pipdeptree-${{ inputs.version || '4.2.2' }}-*-manylinux_riscv64 |