Skip to content

Commit ae20f9f

Browse files
committed
pyicu-wheels: Add version 2.15.2
1 parent b1e060c commit ae20f9f

4 files changed

Lines changed: 229 additions & 0 deletions

File tree

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# SPDX-FileCopyrightText: 2026 The RISE Project
2+
# SPDX-License-Identifier: MIT
3+
---
4+
# This workflow is based on: https://github.com/Init7/pyicu/blob/v2.15.2/.github/workflows/build.yml
5+
name: Build pyicu-wheels wheels (riscv64)
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
version:
11+
description: 'Version glob to (re)build; empty builds every version of docs/packages/pyicu-wheels.yaml not released yet'
12+
required: false
13+
default: ''
14+
pull_request:
15+
branches: [main]
16+
paths:
17+
- '.github/workflows/build-pyicu-wheels.yml'
18+
- 'docs/packages/pyicu-wheels.yaml'
19+
- 'patches/pyicu-wheels/**'
20+
push:
21+
branches: [main]
22+
paths:
23+
- '.github/workflows/build-pyicu-wheels.yml'
24+
- 'docs/packages/pyicu-wheels.yaml'
25+
- 'patches/pyicu-wheels/**'
26+
27+
concurrency:
28+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
29+
cancel-in-progress: true
30+
31+
permissions:
32+
contents: read # to fetch code (actions/checkout)
33+
34+
env:
35+
UV_EXTRA_INDEX_URL: https://pypi.riseproject.dev/simple/
36+
UV_INDEX_STRATEGY: unsafe-best-match
37+
UV_ONLY_BINARY: ':all:'
38+
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
39+
40+
jobs:
41+
setup:
42+
uses: $/.github/workflows/_setup.yml
43+
with:
44+
package: pyicu-wheels
45+
version: ${{ inputs.version }}
46+
47+
linux:
48+
needs: [setup]
49+
if: needs.setup.outputs.versions != '[]'
50+
name: Build pyicu-wheels ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64
51+
runs-on: ubuntu-24.04-riscv
52+
timeout-minutes: 240
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
version: ${{ fromJSON(needs.setup.outputs.versions) }}
57+
python: ["cp312", "cp313", "cp314", "cp314t"]
58+
59+
env:
60+
PYICU_WHEELS_VERSION: ${{ matrix.version }}
61+
# A container-local ICU prefix; upstream's /host/tmp/.build only exists to feed its actions/cache.
62+
_LIBICU_DIR: "/tmp/.build"
63+
64+
steps:
65+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
66+
with:
67+
repository: Init7/pyicu
68+
ref: v${{ env.PYICU_WHEELS_VERSION }}
69+
persist-credentials: false
70+
71+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
72+
with:
73+
path: python-wheels
74+
persist-credentials: false
75+
76+
- name: Apply riscv64 patches
77+
run: git apply -v python-wheels/patches/pyicu-wheels/${{ env.PYICU_WHEELS_VERSION }}/*.patch
78+
79+
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
80+
with:
81+
python-version: '3.12'
82+
activate-environment: true
83+
enable-cache: false
84+
85+
- name: Install Hatch
86+
run: uv pip install --upgrade hatch
87+
88+
- name: Export PYICU_VERSION and LIBICU_VERSION
89+
run: |
90+
python - >> "$GITHUB_ENV" <<'EOF'
91+
import tomllib
92+
env = tomllib.load(open("pyproject.toml", "rb"))["tool"]["hatch"]["envs"]["default"]["env-vars"]
93+
for key in ("PYICU_VERSION", "LIBICU_VERSION"):
94+
print(f"{key}={env[key]}")
95+
EOF
96+
97+
- name: Fetch pyicu source
98+
run: hatch run pyicu:clone
99+
100+
- name: Copy src and tests
101+
run: |
102+
hatch run pyicu:src
103+
hatch run pyicu:tests
104+
105+
- name: Build wheels
106+
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
107+
with:
108+
output-dir: wheelhouse
109+
only: ${{ matrix.python }}-manylinux_riscv64
110+
env:
111+
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
112+
CIBW_ENVIRONMENT: MAKEFLAGS="-j$(nproc)"
113+
114+
- name: Check the wheel bundles ICU and its licences
115+
run: |
116+
python - wheelhouse/*.whl <<'EOF'
117+
import sys, zipfile
118+
for whl in sys.argv[1:]:
119+
names = zipfile.ZipFile(whl).namelist()
120+
assert any(n.startswith("icu/_icu_") and n.endswith(".so") for n in names), (whl, names)
121+
assert any(n.startswith("pyicu_wheels.libs/libicudata") for n in names), (whl, names)
122+
for lic in ("LICENSE.txt", "licenses/icu.txt", "licenses/pyicu.txt"):
123+
assert any(n.endswith(".dist-info/licenses/" + lic) for n in names), (whl, lic, names)
124+
print(whl, "OK")
125+
EOF
126+
127+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
128+
with:
129+
name: pyicu-wheels-${{ env.PYICU_WHEELS_VERSION }}-${{ matrix.python }}-manylinux_riscv64
130+
path: wheelhouse/*.whl
131+
if-no-files-found: error
132+
133+
publish:
134+
name: Publish pyicu-wheels ${{ matrix.version }}
135+
needs: [setup, linux]
136+
if: needs.setup.outputs.versions != '[]'
137+
strategy:
138+
fail-fast: false
139+
matrix:
140+
version: ${{ fromJSON(needs.setup.outputs.versions) }}
141+
permissions:
142+
contents: write
143+
pull-requests: write
144+
uses: $/.github/workflows/_publish-wheel.yml
145+
secrets:
146+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
147+
with:
148+
artifact-pattern: pyicu-wheels-${{ matrix.version }}-*-manylinux_riscv64

‎docs/packages/pyicu-wheels.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package-name: pyicu-wheels
2+
source-code: https://github.com/Init7/pyicu
3+
license: Apache-2.0
4+
versions:
5+
- version: 2.15.2
6+
patched: true
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Ludovic Henry <git@ludovic.dev>
3+
Date: Mon, 28 Sep 2026 00:00:00 +0200
4+
Subject: [PATCH] before-build-linux: accept Rocky Linux
5+
6+
scripts/before-build-linux.sh dispatches on /etc/os-release's ID and
7+
exits 1 on any distribution it does not list. manylinux_2_28 is
8+
AlmaLinux 8, but manylinux_2_39 (the only manylinux image published for
9+
riscv64) is Rocky Linux 10, whose ID is "rocky", so the script aborts
10+
before ICU is built. Rocky takes exactly the AlmaLinux path: dnf for
11+
wget, then ld.so.conf + ldconfig for the ICU prefix.
12+
13+
Upstream-Status: To upstream [not submitted from this automated port run; needs a pull request against Init7/pyicu]
14+
---
15+
scripts/before-build-linux.sh | 4 ++--
16+
1 file changed, 2 insertions(+), 2 deletions(-)
17+
18+
diff --git a/scripts/before-build-linux.sh b/scripts/before-build-linux.sh
19+
index 8d05caa..57f054f 100755
20+
--- a/scripts/before-build-linux.sh
21+
+++ b/scripts/before-build-linux.sh
22+
@@ -22,7 +22,7 @@ case "${ID}" in
23+
yum install -y wget
24+
;;
25+
26+
- almalinux)
27+
+ almalinux|rocky)
28+
dnf -y install wget
29+
;;
30+
31+
@@ -45,7 +45,7 @@ fi
32+
33+
# NOTE: configure library search paths
34+
case "${ID}" in
35+
- almalinux|centos)
36+
+ almalinux|centos|rocky)
37+
echo "${_LIBICU_DIR}/lib" >> /etc/ld.so.conf
38+
ldconfig
39+
;;
40+
--
41+
2.43.0
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Ludovic Henry <git@ludovic.dev>
3+
Date: Mon, 28 Sep 2026 00:00:00 +0200
4+
Subject: [PATCH] pyproject: ship the ICU and PyICU licences in the wheel
5+
6+
The wheel bundles PyICU's extension (MIT) and, via auditwheel,
7+
libicudata/libicuuc/libicui18n (Unicode-3.0 plus the third-party notices
8+
in ICU's LICENSE). Both notices already sit in licenses/, but hatchling
9+
only picks up the root LICENSE.txt by default, so the released wheels
10+
carry the Apache-2.0 text alone. Listing licenses/*.txt in PEP 639
11+
license-files puts them in dist-info/licenses/ with no other change.
12+
13+
Upstream's own 2.15.2 wheels on PyPI carry the same gap on every
14+
platform.
15+
16+
Upstream-Status: To upstream [not submitted from this automated port run; needs a pull request against Init7/pyicu]
17+
---
18+
pyproject.toml | 1 +
19+
1 file changed, 1 insertion(+)
20+
21+
diff --git a/pyproject.toml b/pyproject.toml
22+
index 2ee507f..7c12f33 100644
23+
--- a/pyproject.toml
24+
+++ b/pyproject.toml
25+
@@ -9,6 +9,7 @@ description = 'Wheels for PyICU'
26+
readme = "README.md"
27+
requires-python = ">=3.10"
28+
license = "Apache-2.0"
29+
+license-files = ["LICENSE.txt", "licenses/*.txt"]
30+
keywords = ["icu", "i18n", "wheel"]
31+
classifiers = [
32+
"Development Status :: 4 - Beta",
33+
--
34+
2.43.0

0 commit comments

Comments
 (0)