Repository navigation
docs: Update projects #26
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 is based on the `linux` job of | |
| # https://github.com/kornia/kornia-rs/blob/v0.1.14/.github/workflows/python_release.yml | |
| name: Build kornia-rs wheels (riscv64) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version glob to (re)build; empty builds every version of docs/packages/kornia-rs.yaml not released yet' | |
| required: false | |
| default: '' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-kornia-rs.yml' | |
| - 'docs/packages/kornia-rs.yaml' | |
| - 'patches/kornia-rs/**' | |
| push: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-kornia-rs.yml' | |
| - 'docs/packages/kornia-rs.yaml' | |
| - 'patches/kornia-rs/**' | |
| 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: kornia-rs | |
| version: ${{ inputs.version }} | |
| build_wheels: | |
| needs: [setup] | |
| if: needs.setup.outputs.versions != '[]' | |
| name: Build kornia-rs ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 | |
| runs-on: ubuntu-24.04-riscv | |
| timeout-minutes: 90 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| # pyo3 carries no abi3 feature here, so upstream ships one cp3x-cp3x | |
| # wheel per interpreter (see python_release.yml's own matrix). | |
| python: ["cp312", "cp313", "cp314", "cp314t"] | |
| env: | |
| KORNIA_RS_VERSION: ${{ matrix.version }} | |
| steps: | |
| # kornia-py is a member of the kornia-rs Cargo workspace and builds | |
| # against its sibling crates (kornia-image, kornia-io, ...), so the | |
| # checkout root has to be the workspace root, not kornia-py itself. | |
| - name: Checkout kornia-rs v${{ env.KORNIA_RS_VERSION }} | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| repository: kornia/kornia-rs | |
| ref: v${{ env.KORNIA_RS_VERSION }} | |
| persist-credentials: false | |
| - name: Checkout python-wheels | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| path: python-wheels | |
| persist-credentials: false | |
| - name: Apply patches | |
| run: git apply -v python-wheels/patches/kornia-rs/${{ env.KORNIA_RS_VERSION }}/*.patch | |
| - name: Build wheel | |
| uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 | |
| with: | |
| package-dir: kornia-py | |
| output-dir: wheelhouse/ | |
| # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. | |
| only: ${{ matrix.python }}-manylinux_riscv64 | |
| env: | |
| CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} | |
| # kornia-py ships no [tool.cibuildwheel]; the Rust toolchain its | |
| # maturin backend needs is installed in-container here. cmake builds | |
| # the turbojpeg feature's vendored libjpeg-turbo (patched above to | |
| # drop its require-simd default, since libjpeg-turbo has no riscv64 | |
| # SIMD kernels). | |
| CIBW_BEFORE_ALL_LINUX: >- | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && | |
| dnf install -y cmake | |
| CIBW_ENVIRONMENT_LINUX: >- | |
| PATH="$PATH:$HOME/.cargo/bin" | |
| PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ | |
| # torch/pillow are import-or-skip'd by the tests that use them | |
| # (test_torch_zero_copy.py, test_io.py, test_against_pil_cv2.py); | |
| # both are on the registry for our whole matrix, unlike opencv-python | |
| # (cp37-abi3 only there, so left out - the cv2-guarded tests skip). | |
| CIBW_TEST_REQUIRES: pytest numpy torch pillow | |
| # test_image_benchmarks.py self-skips its dev-hardware ms ceilings when | |
| # CI=true (its own doc: "shared GitHub Actions runners are too variable | |
| # to gate on absolute ms"), but cibuildwheel's Linux container doesn't | |
| # forward the runner's own CI=true, so it has to be passed through here. | |
| CIBW_TEST_ENVIRONMENT_LINUX: PIP_ONLY_BINARY=numpy,torch,pillow CI=true | |
| # test-sources resolves against the checkout root, not package-dir. | |
| # tests/data is the workspace-level fixture dir several tests read | |
| # via `Path(__file__).parents[2]`; benchmarks/ carries the `_bench` | |
| # helper module test_against_pil_cv2.py imports off pyproject.toml's | |
| # pythonpath. | |
| CIBW_TEST_SOURCES: >- | |
| kornia-py/tests | |
| kornia-py/benchmarks | |
| kornia-py/pyproject.toml | |
| tests/data | |
| # test_apriltag_decoder and (from 0.2.0) test_estimate_pose read | |
| # tag36_11_00005.png out of the tests/data/apriltag-imgs git | |
| # submodule (a 200+ MB clone of kornia/apriltag-imgs for one PNG), | |
| # which the checkout above doesn't fetch; every other apriltag test | |
| # runs off files already in tests/data. Deselecting a test a version | |
| # doesn't have is a no-op, so both apply to every version. | |
| CIBW_TEST_COMMAND: >- | |
| cd kornia-py && | |
| python -c "import kornia_rs.kornia_rs as m; assert m.__file__.endswith('.so'), m.__file__" && | |
| python -m pytest -v | |
| --deselect tests/test_apriltag.py::test_apriltag_decoder | |
| --deselect tests/test_apriltag.py::test_estimate_pose | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: kornia-rs-${{ env.KORNIA_RS_VERSION }}-${{ matrix.python }}-manylinux_riscv64 | |
| path: wheelhouse/*.whl | |
| if-no-files-found: error | |
| publish: | |
| name: Publish kornia-rs ${{ matrix.version }} | |
| needs: [setup, build_wheels] | |
| 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: kornia-rs-${{ matrix.version }}-*-manylinux_riscv64 |