Skip to content

Commit accf661

Browse files
authored
puhu: Add version 0.4.1 (#3166)
Build the riscv64 wheel of puhu (a pyo3/maturin image-processing extension) from the upstream v0.4.1 tag. pyo3's abi3-py38 feature is unconditional, so one cp38-abi3 wheel is built and tested on cp312/cp313/cp314; pyo3 0.24 cannot target 3.14t and upstream ships no free-threaded wheel, so there is no cp314t job.
1 parent db908bb commit accf661

2 files changed

Lines changed: 113 additions & 0 deletions

File tree

‎.github/workflows/build-puhu.yml‎

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# SPDX-FileCopyrightText: 2026 The RISE Project
2+
# SPDX-License-Identifier: MIT
3+
---
4+
# Based on the `linux` job of
5+
# https://github.com/bgunebakan/puhu/blob/v0.4.1/.github/workflows/build-wheels.yml
6+
# and the test step of
7+
# https://github.com/bgunebakan/puhu/blob/v0.4.1/.github/workflows/ci.yml
8+
name: Build puhu wheels (riscv64)
9+
10+
on:
11+
workflow_dispatch:
12+
inputs:
13+
version:
14+
description: 'Version glob to (re)build; empty builds every version of docs/packages/puhu.yaml not released yet'
15+
required: false
16+
default: ''
17+
pull_request:
18+
branches: [main]
19+
paths:
20+
- '.github/workflows/build-puhu.yml'
21+
- 'docs/packages/puhu.yaml'
22+
push:
23+
branches: [main]
24+
paths:
25+
- '.github/workflows/build-puhu.yml'
26+
- 'docs/packages/puhu.yaml'
27+
28+
concurrency:
29+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
30+
cancel-in-progress: true
31+
32+
permissions:
33+
contents: read # to fetch code (actions/checkout)
34+
35+
env:
36+
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
37+
38+
jobs:
39+
setup:
40+
uses: $/.github/workflows/_setup.yml
41+
with:
42+
package: puhu
43+
version: ${{ inputs.version }}
44+
45+
build_wheels:
46+
needs: [setup]
47+
if: needs.setup.outputs.versions != '[]'
48+
strategy:
49+
fail-fast: false
50+
matrix:
51+
version: ${{ fromJSON(needs.setup.outputs.versions) }}
52+
name: Build puhu ${{ matrix.version }} cp38-abi3-manylinux_riscv64
53+
runs-on: ubuntu-24.04-riscv
54+
timeout-minutes: 120
55+
56+
env:
57+
PUHU_VERSION: ${{ matrix.version }}
58+
59+
steps:
60+
- name: Checkout puhu v${{ env.PUHU_VERSION }}
61+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
62+
with:
63+
repository: bgunebakan/puhu
64+
ref: v${{ env.PUHU_VERSION }}
65+
persist-credentials: false
66+
67+
- name: Build wheels
68+
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
69+
with:
70+
output-dir: wheelhouse/
71+
env:
72+
# pyo3's abi3-py38 feature is on unconditionally, so one wheel serves every
73+
# interpreter; pyo3 0.24 refuses to build for 3.14t, so there is no cp314t job.
74+
CIBW_BUILD: >-
75+
cp312-manylinux_riscv64 cp313-manylinux_riscv64
76+
cp314-manylinux_riscv64
77+
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
78+
CIBW_BEFORE_ALL_LINUX: >-
79+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
80+
CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin"
81+
CIBW_TEST_REQUIRES: pytest
82+
# The tests ship inside the wheel; --pyargs runs that copy instead of the checkout's.
83+
CIBW_TEST_COMMAND: >-
84+
python -c "import puhu._core as m; assert m.__file__.endswith('.abi3.so'), m.__file__" &&
85+
python -m pytest -v --pyargs puhu.tests
86+
87+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
88+
with:
89+
name: puhu-${{ env.PUHU_VERSION }}-cp38-abi3-manylinux_riscv64
90+
path: wheelhouse/*.whl
91+
if-no-files-found: error
92+
93+
publish:
94+
name: Publish puhu ${{ matrix.version }}
95+
needs: [setup, build_wheels]
96+
if: needs.setup.outputs.versions != '[]'
97+
strategy:
98+
fail-fast: false
99+
matrix:
100+
version: ${{ fromJSON(needs.setup.outputs.versions) }}
101+
permissions:
102+
contents: write
103+
pull-requests: write
104+
uses: $/.github/workflows/_publish-wheel.yml
105+
secrets:
106+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
107+
with:
108+
artifact-pattern: puhu-${{ matrix.version }}-*-manylinux_riscv64

‎docs/packages/puhu.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package-name: puhu
2+
source-code: https://github.com/bgunebakan/puhu
3+
license: MIT
4+
versions:
5+
- version: 0.4.1

0 commit comments

Comments
 (0)