Skip to content

Commit 7f656bd

Browse files
authored
texture2ddecoder: add build-texture2ddecoder.yml for riscv64 wheels (#1594)
* **Package**: `texture2ddecoder` * **Version**: `1.0.6` * **Source**: https://github.com/K0lb3/texture2ddecoder * **Docs**: https://k0lb3.github.io/texture2ddecoder/ Compiles a pure C++ setuptools extension decoding GPU texture formats (BCn, ETC, ASTC, PVRTC, ATC, crunch). Upstream publishes no riscv64 wheel. Mirrors [upstream's `release.yml`](https://github.com/K0lb3/texture2ddecoder/blob/3ebc3b758bd6b1a3108b50148f7998ee34f058c6/.github/workflows/release.yml). **Differs from upstream** - Pins the release commit, not a tag - upstream cut 1.0.6 without pushing one; the tree matches the PyPI sdist byte-for-byte. **Matrix**: cp312/cp313/cp314, no cp314t - `setup.py`'s own abi3 tagging has no `Py_GIL_DISABLED` guard, so a free-threaded build defines `Py_LIMITED_API` and hits CPython's own compile-time error; upstream ships no free-threaded wheel either. **Testing** - same as upstream **License**: OK Built on cp312 locally (macOS/arm64); 9 passed.
1 parent 94860e9 commit 7f656bd

1 file changed

Lines changed: 92 additions & 0 deletions

File tree

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# SPDX-FileCopyrightText: 2026 The RISE Project
2+
# SPDX-License-Identifier: MIT
3+
---
4+
# This workflow is based on the `build_wheels` job of
5+
# https://github.com/K0lb3/texture2ddecoder/blob/3ebc3b758bd6b1a3108b50148f7998ee34f058c6/.github/workflows/release.yml
6+
name: Build texture2ddecoder wheels (riscv64)
7+
8+
on:
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: 'texture2ddecoder version to build (e.g. 1.0.6)'
13+
required: true
14+
default: '1.0.6'
15+
pull_request:
16+
paths:
17+
- '.github/workflows/build-texture2ddecoder.yml'
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ inputs.version || '1.0.6' }}-${{ github.head_ref || github.run_id }}
21+
cancel-in-progress: true
22+
23+
permissions:
24+
contents: read # to fetch code (actions/checkout)
25+
26+
env:
27+
# `inputs.version` is empty on pull_request events; default to 1.0.6 there.
28+
TEXTURE2DDECODER_VERSION: ${{ inputs.version || '1.0.6' }}
29+
# Upstream cuts releases without git tags, so pin the release commit: this is
30+
# "feat: use Py_buffer, remove 3.7 support (cibuildwheel), make 3.11 use abi3",
31+
# whose tree is byte-identical to the 1.0.6 PyPI sdist. Update it alongside
32+
# TEXTURE2DDECODER_VERSION.
33+
TEXTURE2DDECODER_REF: 3ebc3b758bd6b1a3108b50148f7998ee34f058c6
34+
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
35+
36+
jobs:
37+
setup:
38+
uses: $/.github/workflows/_setup.yml
39+
40+
build_wheels:
41+
needs: [setup]
42+
name: Build texture2ddecoder ${{ inputs.version || '1.0.6' }} cp311-abi3-manylinux_riscv64
43+
runs-on: ubuntu-24.04-riscv
44+
timeout-minutes: 90
45+
46+
steps:
47+
- name: Checkout texture2ddecoder ${{ env.TEXTURE2DDECODER_VERSION }}
48+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
49+
with:
50+
repository: K0lb3/texture2ddecoder
51+
ref: ${{ env.TEXTURE2DDECODER_REF }}
52+
persist-credentials: false
53+
54+
- name: Build wheels
55+
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
56+
with:
57+
output-dir: wheelhouse/
58+
env:
59+
CIBW_ARCHS: riscv64
60+
# setup.py's own bdist_wheel subclass tags every build cp311-abi3 when
61+
# CIBUILDWHEEL is set and the interpreter is >=3.11 - no CIBW config
62+
# needed to opt in. It has no Py_GIL_DISABLED guard, so a cp314t build
63+
# would define Py_LIMITED_API under a free-threaded interpreter and hit
64+
# CPython's own "limited API is not supported in the free-threaded
65+
# build" #error; upstream doesn't publish a free-threaded wheel either
66+
# (no Free Threading classifier), so cp314t is dropped rather than
67+
# patched in.
68+
CIBW_BUILD: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64
69+
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
70+
# Upstream's test.yml: `pip install .[tests]` + `pytest -vs ./tests`.
71+
CIBW_TEST_EXTRAS: tests
72+
CIBW_TEST_COMMAND: pytest {package}/tests -v
73+
# The [tests] extra pulls in Pillow, which ships no riscv64 wheel on public
74+
# PyPI; ours is what the test env installs. PIP_ONLY_BINARY keeps pip from
75+
# falling back to a from-source build (it needs libjpeg headers we lack).
76+
CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=Pillow
77+
78+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
79+
with:
80+
name: texture2ddecoder-${{ env.TEXTURE2DDECODER_VERSION }}-cp311-abi3-manylinux_riscv64
81+
path: wheelhouse/*.whl
82+
if-no-files-found: error
83+
84+
publish:
85+
name: Publish texture2ddecoder ${{ inputs.version || '1.0.6' }}
86+
needs: [setup, build_wheels]
87+
permissions:
88+
contents: write
89+
pull-requests: write
90+
uses: $/.github/workflows/_publish-wheel.yml
91+
with:
92+
artifact-pattern: texture2ddecoder-${{ inputs.version || '1.0.6' }}-*-manylinux_riscv64

0 commit comments

Comments
 (0)