Skip to content

Commit 654cd84

Browse files
committed
pyahocorasick: add build-pyahocorasick.yml for riscv64 wheels
pyahocorasick is a self-contained pure-C CPython extension (Aho-Corasick string matching automaton) with no third-party dependencies. Upstream publishes no riscv64 wheel.
1 parent 8f32c2d commit 654cd84

1 file changed

Lines changed: 76 additions & 0 deletions

File tree

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# SPDX-FileCopyrightText: 2026 The RISE Project
2+
# SPDX-License-Identifier: MIT
3+
---
4+
# Based on the `build_wheels` job of
5+
# https://github.com/WojciechMula/pyahocorasick/blob/v2.3.1/.github/workflows/test-and-build.yml
6+
name: Build pyahocorasick wheels (riscv64)
7+
8+
on:
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: 'pyahocorasick version to build (e.g. 2.3.1)'
13+
required: true
14+
default: '2.3.1'
15+
pull_request:
16+
paths:
17+
- '.github/workflows/build-pyahocorasick.yml'
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ inputs.version || '2.3.1' }}-${{ 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+
PYAHOCORASICK_VERSION: ${{ inputs.version || '2.3.1' }}
28+
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
29+
30+
jobs:
31+
setup:
32+
uses: $/.github/workflows/_setup.yml
33+
34+
build_wheels:
35+
needs: [setup]
36+
name: Build pyahocorasick ${{ inputs.version || '2.3.1' }} ${{ matrix.python }}-manylinux_riscv64
37+
runs-on: ubuntu-24.04-riscv
38+
timeout-minutes: 60
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
python: ["cp312", "cp313", "cp314", "cp314t"]
43+
44+
steps:
45+
- name: Checkout pyahocorasick v${{ env.PYAHOCORASICK_VERSION }}
46+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
47+
with:
48+
repository: WojciechMula/pyahocorasick
49+
ref: v${{ env.PYAHOCORASICK_VERSION }}
50+
persist-credentials: false
51+
52+
- uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
53+
env:
54+
CIBW_ARCHS: riscv64
55+
CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64
56+
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
57+
CIBW_TEST_REQUIRES: pytest
58+
CIBW_TEST_COMMAND: >-
59+
python -c "import ahocorasick; assert ahocorasick.__file__.endswith('.so'), ahocorasick.__file__" &&
60+
pytest -vvs {project}/tests
61+
62+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
63+
with:
64+
name: pyahocorasick-${{ env.PYAHOCORASICK_VERSION }}-${{ matrix.python }}-manylinux_riscv64
65+
path: ./wheelhouse/*.whl
66+
if-no-files-found: error
67+
68+
publish:
69+
name: Publish pyahocorasick ${{ inputs.version || '2.3.1' }}
70+
needs: [setup, build_wheels]
71+
permissions:
72+
contents: write
73+
pull-requests: write
74+
uses: $/.github/workflows/_publish-wheel.yml
75+
with:
76+
artifact-pattern: pyahocorasick-${{ inputs.version || '2.3.1' }}-*-manylinux_riscv64

0 commit comments

Comments
 (0)