Skip to content

docs: Update projects #97

docs: Update projects

docs: Update projects #97

Workflow file for this run

# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# This workflow is based on the `build_wheels` job of
# https://github.com/AcademySoftwareFoundation/openexr/blob/v3.4.15/.github/workflows/python-wheels.yml
name: Build openexr wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/openexr.yaml not released yet'
required: false
default: ''
pull_request:
branches: [main]
paths:
- '.github/workflows/build-openexr.yml'
- 'docs/packages/openexr.yaml'
push:
branches: [main]
paths:
- '.github/workflows/build-openexr.yml'
- 'docs/packages/openexr.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
# CMakeLists.txt FetchContent-pulls Imath at this tag when OPENEXR_FORCE_INTERNAL_IMATH
# is set; bump alongside it if upstream ever moves the pin.
IMATH_TAG: v3.2.2
jobs:
setup:
uses: $/.github/workflows/_setup.yml
with:
package: openexr
version: ${{ inputs.version }}
build_wheels:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
name: Build openexr ${{ 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) }}
python: ["cp312", "cp313", "cp314", "cp314t"]
env:
OPENEXR_VERSION: ${{ matrix.version }}
steps:
- name: Checkout openexr v${{ env.OPENEXR_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: AcademySoftwareFoundation/openexr
ref: v${{ env.OPENEXR_VERSION }}
persist-credentials: false
# Imath, libdeflate and OpenJPH are statically linked in (OPENEXR_FORCE_INTERNAL_*),
# but upstream's own wheel only ships LICENSE.md; libdeflate/OpenJPH are vendored
# under external/ while Imath is git-fetched at configure time (gotcha 53), so none
# of the three licences reach dist-info without staging them at the project root.
- name: Stage vendored licences
run: |
cp external/deflate/COPYING LICENSE.deflate
cp external/OpenJPH/LICENSE LICENSE.openjph
curl -fsSL --retry 5 "https://raw.githubusercontent.com/AcademySoftwareFoundation/Imath/${{ env.IMATH_TAG }}/LICENSE.md" -o LICENSE.imath
- 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_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/
# OpenEXR's compiled extension has no Py_mod_gil slot, so cp314t
# re-enables the GIL at import and the test suite's warnings-as-errors
# config turns that into a collection error (gotcha 127).
CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy PYTHON_GIL=1
CIBW_TEST_COMMAND: >-
python -c "import importlib.metadata as m; f = sorted(str(p).split('licenses/', 1)[1] for p in m.files('openexr') if '.dist-info/licenses/' in str(p)); assert f == ['LICENSE.deflate', 'LICENSE.imath', 'LICENSE.md', 'LICENSE.openjph'], f" &&
pytest -s {project}/src/wrappers/python/tests
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: openexr-${{ env.OPENEXR_VERSION }}-${{ matrix.python }}-manylinux_riscv64
path: wheelhouse/*.whl
if-no-files-found: error
publish:
name: Publish openexr ${{ 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: openexr-${{ matrix.version }}-*-manylinux_riscv64