From c8f46117b0cab54ab556135dad217ad642b80aac Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Tue, 13 Oct 2026 12:38:52 +0000 Subject: [PATCH 1/2] Port cityseer 5.8.0 to riscv64 Pure-Rust PyO3/maturin extension (geo, ndarray, petgraph, rayon, rstar, wkt, exmex; no -sys crates, no SIMD/arch-specific code, no GPL build-time linkage beyond glibc), so the manylinux_riscv64 image builds it like any other maturin port. Not abi3, matching upstream's own per-interpreter release matrix; cp314 is dropped because statsmodels (a runtime dependency) has no riscv64 wheel for it yet, leaving cp312/cp313. AGPL-3.0: maturin bundles LICENSE.txt into the wheel automatically, satisfying the licence-compliance check. --- .github/workflows/build-cityseer.yml | 113 +++++++++++++++++++++++++++ docs/packages/cityseer.yaml | 5 ++ 2 files changed, 118 insertions(+) create mode 100644 .github/workflows/build-cityseer.yml create mode 100644 docs/packages/cityseer.yaml diff --git a/.github/workflows/build-cityseer.yml b/.github/workflows/build-cityseer.yml new file mode 100644 index 000000000000..399337c9f3e0 --- /dev/null +++ b/.github/workflows/build-cityseer.yml @@ -0,0 +1,113 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on the `linux` job of +# https://github.com/benchmark-urbanism/cityseer-api/blob/v5.8.0/.github/workflows/publish_package.yml +name: Build cityseer wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/cityseer.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-cityseer.yml' + - 'docs/packages/cityseer.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-cityseer.yml' + - 'docs/packages/cityseer.yaml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: cityseer + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build cityseer ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 120 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # cityseer's pyo3 dependency carries no abi3-pyNN feature, matching + # upstream's own per-interpreter wheel matrix. Upstream builds no + # free-threaded wheel, so cp314t is dropped; cp314 is dropped too -- + # statsmodels (a runtime dependency) has no riscv64 wheel for it yet. + python: ['cp312', 'cp313'] + + env: + CITYSEER_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout cityseer v${{ env.CITYSEER_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: benchmark-urbanism/cityseer-api + ref: v${{ env.CITYSEER_VERSION }} + persist-credentials: false + + - name: Build wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + output-dir: wheelhouse/ + only: ${{ matrix.python }}-manylinux_riscv64 + env: + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + # cityseer ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + CIBW_BEFORE_ALL_LINUX: >- + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + CIBW_ENVIRONMENT_LINUX: >- + PATH="$PATH:$HOME/.cargo/bin" + PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + PIP_ONLY_BINARY=:all: + # Upstream's own `check` job: run the pytest suite (minus the + # performance benchmarks pyproject.toml's addopts already ignores). + # The Overpass-API network test upstream's own suite carries is + # self-skipping under GITHUB_ACTIONS (set on every GHA runner). + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_COMMAND: pytest {package}/tests -v + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: cityseer-${{ env.CITYSEER_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish cityseer ${{ matrix.version }} + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + secrets: + app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} + with: + artifact-pattern: cityseer-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/cityseer.yaml b/docs/packages/cityseer.yaml new file mode 100644 index 000000000000..87430bbeb8f7 --- /dev/null +++ b/docs/packages/cityseer.yaml @@ -0,0 +1,5 @@ +package-name: cityseer +source-code: https://github.com/benchmark-urbanism/cityseer-api +license: AGPL-3.0 +versions: +- version: 5.8.0 From 6a9956194bfbda6177f98c431a82abec7b1e8661 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Fri, 16 Oct 2026 01:09:11 +0000 Subject: [PATCH 2/2] cityseer: fix riscv64 test failures (missing pyarrow, inert addopts ignore) Both cp312 and cp313 manylinux_riscv64 test runs failed identically with 5 failures: - 4 ImportErrors: CityNetwork.save() calls geopandas.to_parquet(), which needs the optional pyarrow dependency. Upstream's own CI only gets it transitively (overturemaps, a dev-group dependency, requires pyarrow), so it was never declared explicitly; CIBW_TEST_REQUIRES only installed pytest. pyarrow already has a riscv64 wheel on pypi.riseproject.dev, so add it to CIBW_TEST_REQUIRES. - 1 timing assertion in tests/test_performance.py::test_local_centrality_time (func_time < 1, observed ~2.9-3.2s): upstream's own pyproject.toml already excludes this file via `addopts = "--ignore=tests/test_performance.py"`, but that path is resolved relative to pytest's invocation directory, not its rootdir. cibuildwheel's default empty test_cwd made the two differ, so the ignore silently did nothing and the file was collected and run for real. `cd {package}` before invoking pytest makes cwd match rootdir, so the ignore applies as upstream intends (same pattern as build-lapx.yml). --- .github/workflows/build-cityseer.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-cityseer.yml b/.github/workflows/build-cityseer.yml index 399337c9f3e0..54a996c8e0cb 100644 --- a/.github/workflows/build-cityseer.yml +++ b/.github/workflows/build-cityseer.yml @@ -83,11 +83,15 @@ jobs: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=:all: # Upstream's own `check` job: run the pytest suite (minus the - # performance benchmarks pyproject.toml's addopts already ignores). - # The Overpass-API network test upstream's own suite carries is - # self-skipping under GITHUB_ACTIONS (set on every GHA runner). - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: pytest {package}/tests -v + # performance benchmarks pyproject.toml's addopts already ignores -- + # `cd` into {package} first so cwd matches rootdir and that addopts + # is actually read. The Overpass-API network test upstream's own + # suite carries self-skips under GITHUB_ACTIONS. + # pyarrow is an optional geopandas dependency upstream's own dev + # group pulls in transitively (via overturemaps); CityNetwork.save() + # needs it directly and we already ship a riscv64 wheel for it. + CIBW_TEST_REQUIRES: pytest pyarrow + CIBW_TEST_COMMAND: cd {package} && pytest tests -v - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: