From 8f650642bc4b8aa7e1ab96737c8768c730620a26 Mon Sep 17 00:00:00 2001 From: "riseproject-dev[bot]" <330740410+riseproject-dev[bot]@users.noreply.github.com> Date: Thu, 22 Oct 2026 12:10:08 +0000 Subject: [PATCH 1/2] pypolyline: Add version 1.0.0 Signed-off-by: riseproject-dev[bot] <330740410+riseproject-dev[bot]@users.noreply.github.com> --- docs/packages/pypolyline.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/packages/pypolyline.yaml b/docs/packages/pypolyline.yaml index 3ee76192b6a0..021abbae9049 100644 --- a/docs/packages/pypolyline.yaml +++ b/docs/packages/pypolyline.yaml @@ -14,3 +14,4 @@ versions: - filename: pypolyline-0.5.8-cp314-cp314-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl sha256: d71a335b469e8e08f8c0b7c65219664c0c782c8d1a0c3902697ed37bfff4b054 requires-python: '>=3.10' +- version: 1.0.0 From 870e4bcbdd194b1efad70eaca43346a1048899a4 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Fri, 23 Oct 2026 11:43:29 +0800 Subject: [PATCH 2/2] pypolyline: build 1.0.0 as the maturin abi3 extension it now is 1.0.0 is a rewrite as a pure Rust/PyO3 extension built with maturin, with pyo3's abi3-py311 feature, instead of Cython over a prebuilt libpolylineffi. Drop the polyline-ffi build and the per-interpreter matrix; install rustup so maturin finds cargo, and build one cp311-abi3 wheel on cp312. --- .github/workflows/build-pypolyline.yml | 54 +++++++++++++------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build-pypolyline.yml b/.github/workflows/build-pypolyline.yml index d96f7f0552b2..a320a2cb238b 100644 --- a/.github/workflows/build-pypolyline.yml +++ b/.github/workflows/build-pypolyline.yml @@ -1,7 +1,8 @@ # SPDX-FileCopyrightText: 2026 The RISE Project # SPDX-License-Identifier: MIT --- -# This workflow is based on: https://github.com/urschrei/pypolyline/blob/v0.5.8/.github/workflows/wheels.yml +# This workflow is based on `[tool.cibuildwheel]` in +# https://github.com/urschrei/pypolyline/blob/v1.0.0/pyproject.toml name: Build pypolyline wheels (riscv64) on: @@ -31,10 +32,6 @@ permissions: env: MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 - # The urschrei/polyline-ffi tag that was latest when pypolyline 0.5.8 shipped. - # Upstream's own CI fetches whatever tag is latest at release time; it has no - # riscv64 release asset, so this is built from source instead (gotcha 77). - POLYLINE_FFI_TAG: v0.8.0 jobs: setup: @@ -46,16 +43,13 @@ jobs: build_wheels: needs: [setup] if: needs.setup.outputs.versions != '[]' - name: Build pypolyline ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + name: Build pypolyline ${{ matrix.version }} cp311-abi3-manylinux_riscv64 runs-on: ubuntu-24.04-riscv - timeout-minutes: 60 + timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - # Upstream builds cp310-cp314 only (no free-threaded variant); this repo's - # floor is cp312, so cp314t is dropped along with cp310/cp311. - python: ["cp312", "cp313", "cp314"] env: PYPOLYLINE_VERSION: ${{ matrix.version }} @@ -68,46 +62,52 @@ jobs: ref: v${{ env.PYPOLYLINE_VERSION }} persist-credentials: false + # 1.0.0 is a rewrite as a pure Rust/PyO3 extension built by maturin (the + # earlier releases were Cython over a prebuilt libpolylineffi), with + # pyo3's abi3-py311 feature on: one wheel serves every CPython >= 3.11. + # It is built on cp312, the oldest interpreter this repo's image has. - name: Build wheels uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 with: output-dir: wheelhouse/ + only: cp312-manylinux_riscv64 env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64 CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream downloads a prebuilt libpolylineffi.so from - # urschrei/polyline-ffi's releases; there is no riscv64 asset, so build - # it from source instead (gotcha 77) and stage it where - # CMakeLists.txt's find_library expects it. + # manylinux images ship no Rust toolchain (upstream's before-all, minus + # its macOS-only parts). Without cargo on PATH maturin falls back to + # puccinialin, which has no riscv64 toolchain to install. CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && - git clone --depth 1 --branch ${{ env.POLYLINE_FFI_TAG }} - https://github.com/urschrei/polyline-ffi /tmp/polyline-ffi && - cd /tmp/polyline-ffi && - $HOME/.cargo/bin/cargo build --release --features headers && - cp target/release/libpolylineffi.so include/header.h {project}/src/pypolyline/ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | + sh -s -- -y --profile minimal + CIBW_ENVIRONMENT_LINUX: PATH="$HOME/.cargo/bin:$PATH" # cibuildwheel's build[uv] frontend (upstream's pyproject.toml default) # crashes the audit step: it asserts a host `uv`, which the self-hosted # riscv64 runner doesn't have (gotcha 13). CIBW_BUILD_FRONTEND: build - # numpy/cython have riscv64 wheels only on our registry. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy + # numpy has riscv64 wheels only on our registry; tests that need it + # importorskip it, so it is installed to run them rather than skip them. + CIBW_TEST_ENVIRONMENT: >- + PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + PIP_ONLY_BINARY=numpy + CIBW_TEST_REQUIRES: pytest numpy + CIBW_TEST_COMMAND: pytest {package} - - name: Check the licence made it into the wheel + - name: Check the extension and the licence made it into the wheel run: | python3 - wheelhouse/*.whl <<'EOF' import sys, zipfile for whl in sys.argv[1:]: + assert "-cp311-abi3-" in whl, whl names = zipfile.ZipFile(whl).namelist() + assert any(n.startswith("pypolyline/cutil.") and n.endswith(".so") + for n in names), names assert any(n.endswith("dist-info/licenses/LICENSE.md") for n in names), names print(whl, "ok") EOF - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: pypolyline-${{ env.PYPOLYLINE_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + name: pypolyline-${{ env.PYPOLYLINE_VERSION }}-cp311-abi3-manylinux_riscv64 path: wheelhouse/*.whl if-no-files-found: error