Skip to content

Commit 4731d45

Browse files
authored
mwparserfromhell: add build-mwparserfromhell.yml for riscv64 wheels (#1393)
* **Package**: `mwparserfromhell` * **Version**: `0.7.2` * **Source**: https://github.com/earwig/mwparserfromhell * **Docs**: https://mwparserfromhell.readthedocs.io/ Compiles the optional C tokenizer extension for the MediaWiki wikicode parser. Upstream publishes no riscv64 wheel. Mirrors [upstream's `build.yml`](https://github.com/earwig/mwparserfromhell/blob/v0.7.2/.github/workflows/build.yml). **Differs from upstream** - Adds `PIP_EXTRA_INDEX_URL` - resolves the `dev` test group's psutil for riscv64. **Matrix**: `cp312`/`cp313`/`cp314` only - `cp314t` segfaults in the C tokenizer under free-threading ([earwig/mwparserfromhell#343](earwig/mwparserfromhell#343), open upstream); PyPI itself ships no cp314 or cp314t wheel. **Testing** - same as upstream **License**: OK Built on cp39 (x86_64, local); 2005 passed, 1 skipped. CI: cp312/cp313/cp314 manylinux+musllinux riscv64 all green.
1 parent 0884c43 commit 4731d45

1 file changed

Lines changed: 85 additions & 0 deletions

File tree

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# SPDX-FileCopyrightText: 2026 The RISE Project
2+
# SPDX-License-Identifier: MIT
3+
---
4+
# This workflow is based on: https://github.com/earwig/mwparserfromhell/blob/v0.7.2/.github/workflows/build.yml
5+
name: Build mwparserfromhell wheels (riscv64)
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
version:
11+
description: 'mwparserfromhell version to build (git tag without leading v, e.g. 0.7.2)'
12+
required: true
13+
default: '0.7.2'
14+
pull_request:
15+
paths:
16+
- '.github/workflows/build-mwparserfromhell.yml'
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ inputs.version || '0.7.2' }}-${{ github.head_ref || github.run_id }}
20+
cancel-in-progress: true
21+
22+
permissions:
23+
contents: read # to fetch code (actions/checkout)
24+
25+
env:
26+
MWPARSERFROMHELL_VERSION: ${{ inputs.version || '0.7.2' }}
27+
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
28+
MUSLLINUX_RISCV64_IMAGE: quay.io/pypa/musllinux_1_2_riscv64
29+
30+
jobs:
31+
setup:
32+
uses: $/.github/workflows/_setup.yml
33+
34+
build_wheels:
35+
needs: [setup]
36+
name: Build mwparserfromhell ${{ inputs.version || '0.7.2' }} ${{ matrix.python }}-${{ matrix.libc }}_riscv64
37+
runs-on: ubuntu-24.04-riscv
38+
timeout-minutes: 60
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
# cp314t excluded: the C tokenizer segfaults under Py_GIL_DISABLED
43+
# (upstream issue earwig/mwparserfromhell#343, still open), matching
44+
# upstream's own scope - PyPI ships no cp314 or cp314t wheel either.
45+
python: ["cp312", "cp313", "cp314"]
46+
libc: [manylinux, musllinux]
47+
48+
steps:
49+
- name: Checkout mwparserfromhell v${{ env.MWPARSERFROMHELL_VERSION }}
50+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
51+
with:
52+
repository: earwig/mwparserfromhell
53+
ref: v${{ env.MWPARSERFROMHELL_VERSION }}
54+
fetch-depth: 0
55+
persist-credentials: false
56+
57+
- uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
58+
env:
59+
CIBW_ARCHS: riscv64
60+
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.libc }}_riscv64
61+
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
62+
CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }}
63+
# Overriding CIBW_ENVIRONMENT replaces (not merges with) pyproject's
64+
# [tool.cibuildwheel] environment table, so WITH_EXTENSION=1 (which
65+
# selects the C tokenizer) has to be repeated here; PIP_EXTRA_INDEX_URL
66+
# is added so the `dev` test-group's psutil resolves for riscv64.
67+
CIBW_ENVIRONMENT: >-
68+
WITH_EXTENSION=1
69+
PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/
70+
71+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
72+
with:
73+
name: mwparserfromhell-${{ env.MWPARSERFROMHELL_VERSION }}-${{ matrix.python }}-${{ matrix.libc }}_riscv64
74+
path: ./wheelhouse/*.whl
75+
if-no-files-found: error
76+
77+
publish:
78+
name: Publish mwparserfromhell ${{ inputs.version || '0.7.2' }}
79+
needs: [setup, build_wheels]
80+
permissions:
81+
contents: write
82+
pull-requests: write
83+
uses: $/.github/workflows/_publish-wheel.yml
84+
with:
85+
artifact-pattern: mwparserfromhell-${{ inputs.version || '0.7.2' }}-*riscv64

0 commit comments

Comments
 (0)