From 3810f63983a7c1db99ea4b893b8f50a3d10da86e Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Thu, 15 Oct 2026 12:29:33 +0000 Subject: [PATCH 1/4] port: add pendulum (riscv64) Rust/PyO3 (maturin) datetime library. Verified real upstream (python-pendulum/pendulum, MIT): pyproject.toml/rust/Cargo.toml confirm a plain `features = ["pyo3/extension-module"]` build (no abi3), and cargo metadata's crate set (pyo3/pyo3-ffi/pyo3-macros/libc/once_cell/ portable-atomic/target-lexicon/heck/proc-macro2/quote/syn/unicode-ident) is pure Rust with zero -sys/C crates. Mirrors upstream's own tests.yml Tests job, running its real pytest suite against the built wheel (and once more with PENDULUM_EXTENSIONS=0, as upstream also does). Matrix trimmed to cp312-cp314t: time-machine, one of upstream's own test dependencies, is only published for cp312+ on our registry and has no riscv64 wheel on public PyPI either, so cp310/cp311 wheels could not be tested against upstream's real suite (same trim as build-neo4j-rust-ext.yml's pyarrow note). --- .github/workflows/build-pendulum.yml | 140 +++++++++++++++++++++++++++ docs/packages/pendulum.yaml | 5 + 2 files changed, 145 insertions(+) create mode 100644 .github/workflows/build-pendulum.yml create mode 100644 docs/packages/pendulum.yaml diff --git a/.github/workflows/build-pendulum.yml b/.github/workflows/build-pendulum.yml new file mode 100644 index 000000000000..47a0aa5390bc --- /dev/null +++ b/.github/workflows/build-pendulum.yml @@ -0,0 +1,140 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on the `Tests` job of +# https://github.com/python-pendulum/pendulum/blob/3.3.0/.github/workflows/tests.yml +name: Build pendulum wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/pendulum.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-pendulum.yml' + - 'docs/packages/pendulum.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-pendulum.yml' + - 'docs/packages/pendulum.yaml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: pendulum + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build pendulum ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 180 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # pendulum's pyo3 dependency has a plain `features = + # ["pyo3/extension-module"]` (no abi3-pyNN), so every interpreter + # needs its own build. pypy3.11 (upstream also builds it) is + # dropped: PyPy has no riscv64 port. Upstream's own tests.yml only + # exercises free-threading on 3.14t/3.15t, not 3.13t. cp310/cp311 are + # dropped too: time-machine, one of upstream's own test dependencies, + # is only published for cp312+ on our registry and has no riscv64 + # wheel on public PyPI either, so a cp310/cp311 wheel couldn't be + # tested against upstream's real suite (same trim as + # build-neo4j-rust-ext.yml's pyarrow note). + python: ['cp312', 'cp313', 'cp314', 'cp314t'] + + env: + PENDULUM_VERSION: ${{ matrix.version }} + # Without this uv would reuse the runner image's system CPython for + # some interpreters and download a standalone build for the others. + UV_PYTHON_PREFERENCE: only-managed + + steps: + - name: Checkout pendulum v${{ env.PENDULUM_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: python-pendulum/pendulum + ref: ${{ env.PENDULUM_VERSION }} + persist-credentials: false + + - name: Determine target interpreter + id: interp + run: | + v="${{ matrix.python }}" + v="${v#cp}" + t="${v%t}" + suffix="" + if [ "$t" != "$v" ]; then + suffix="t" + fi + echo "value=python${t:0:1}.${t:1}${suffix}" >> "$GITHUB_OUTPUT" + + - name: Build wheel + uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 + with: + target: riscv64gc-unknown-linux-gnu + args: --release --strip -i ${{ steps.interp.outputs.value }} --out dist + manylinux: '2_39' + + - name: Install Python + uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 + with: + python-version: ${{ steps.interp.outputs.value }} + activate-environment: true + enable-cache: false + + # Mirrors upstream's own "Tests" job (tests.yml): install the runtime + # and test dependencies it declares, then run its own test suite + # unmodified, once against the just-built wheel and once (as upstream + # also does) with the native extension disabled. + - name: Install test dependencies + env: + UV_EXTRA_INDEX_URL: https://pypi.riseproject.dev/simple/ + run: | + uv pip install pendulum --no-index --find-links dist --force-reinstall + uv pip install 'python-dateutil>=2.6' 'tzdata>=2020.1' 'pytest>=9.0.3' 'pytest-benchmark>=4.0.0,<5.0.0' 'time-machine>=3.0.0,<4.0.0' + + - name: Test Pure Python + run: PENDULUM_EXTENSIONS=0 pytest -q tests + + - name: Test + run: pytest -q tests + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: pendulum-${{ env.PENDULUM_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: dist/*.whl + if-no-files-found: error + + publish: + name: Publish pendulum ${{ 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: pendulum-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/pendulum.yaml b/docs/packages/pendulum.yaml new file mode 100644 index 000000000000..c428cc05d062 --- /dev/null +++ b/docs/packages/pendulum.yaml @@ -0,0 +1,5 @@ +package-name: pendulum +source-code: https://github.com/python-pendulum/pendulum +license: MIT License +versions: +- version: 3.3.0 From dc12aea644da9657c4502ba075e8c16ebf1201f7 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Sun, 25 Oct 2026 18:05:05 +0000 Subject: [PATCH 2/4] fix(pendulum): --no-deps on the --no-index wheel install --no-index disables index lookups entirely, including for pendulum's own runtime deps (python-dateutil, tzdata), which dist/ only has the built wheel for. That made the step fail resolving dependencies before ever reaching the network, since the next line installs those deps explicitly anyway. --- .github/workflows/build-pendulum.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-pendulum.yml b/.github/workflows/build-pendulum.yml index 47a0aa5390bc..e4278e2f7f2d 100644 --- a/.github/workflows/build-pendulum.yml +++ b/.github/workflows/build-pendulum.yml @@ -107,7 +107,10 @@ jobs: env: UV_EXTRA_INDEX_URL: https://pypi.riseproject.dev/simple/ run: | - uv pip install pendulum --no-index --find-links dist --force-reinstall + # --no-deps: --no-index disables index lookups entirely, including for + # pendulum's own runtime deps (python-dateutil, tzdata), which dist/ + # doesn't carry. They're installed explicitly below instead. + uv pip install pendulum --no-index --find-links dist --force-reinstall --no-deps uv pip install 'python-dateutil>=2.6' 'tzdata>=2020.1' 'pytest>=9.0.3' 'pytest-benchmark>=4.0.0,<5.0.0' 'time-machine>=3.0.0,<4.0.0' - name: Test Pure Python From 54f41577b38d375a53cdb2decfc70020107be402 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 2 Nov 2026 07:51:54 +0000 Subject: [PATCH 3/4] fix(pendulum): pin python-dateutil to upstream's lock for tests python-dateutil 3.0.0 (now resolved by the loose >=2.6 floor) gives tz.gettz() tzfile objects a .key attribute. pendulum's _safe_timezone treats any tzinfo with .key as zoneinfo and keeps the IANA name, so test_instance_with_aware_datetime_any_tzinfo gets 'Europe/Paris' instead of the '+02:00' fixed offset it expects, on every interpreter. This is version drift and isn't specific to riscv64: upstream's CI passes against poetry.lock, which pins python-dateutil 2.9.0.post0, so pin that in the test environment. --- .github/workflows/build-pendulum.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-pendulum.yml b/.github/workflows/build-pendulum.yml index e4278e2f7f2d..b69ae22a80bf 100644 --- a/.github/workflows/build-pendulum.yml +++ b/.github/workflows/build-pendulum.yml @@ -110,8 +110,10 @@ jobs: # --no-deps: --no-index disables index lookups entirely, including for # pendulum's own runtime deps (python-dateutil, tzdata), which dist/ # doesn't carry. They're installed explicitly below instead. + # python-dateutil pinned to upstream's poetry.lock: 3.0's tz.gettz() + # objects gain a .key, which breaks test_instance_with_aware_datetime_any_tzinfo. uv pip install pendulum --no-index --find-links dist --force-reinstall --no-deps - uv pip install 'python-dateutil>=2.6' 'tzdata>=2020.1' 'pytest>=9.0.3' 'pytest-benchmark>=4.0.0,<5.0.0' 'time-machine>=3.0.0,<4.0.0' + uv pip install 'python-dateutil==2.9.0.post0''tzdata>=2020.1' 'pytest>=9.0.3' 'pytest-benchmark>=4.0.0,<5.0.0' 'time-machine>=3.0.0,<4.0.0' - name: Test Pure Python run: PENDULUM_EXTENSIONS=0 pytest -q tests From f15d784cd8103c434f35999a99fdde92fcaa0ea1 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 2 Nov 2026 09:37:26 +0000 Subject: [PATCH 4/4] pendulum: fix shell quoting in test-deps install Two adjacent single-quoted args with no space between them get concatenated by the shell into one invalid requirement (python-dateutil==2.9.0.post0tzdata>=2020.1), failing uv's install on every job before the test ever runs. --- .github/workflows/build-pendulum.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-pendulum.yml b/.github/workflows/build-pendulum.yml index b69ae22a80bf..a20580290d40 100644 --- a/.github/workflows/build-pendulum.yml +++ b/.github/workflows/build-pendulum.yml @@ -113,7 +113,7 @@ jobs: # python-dateutil pinned to upstream's poetry.lock: 3.0's tz.gettz() # objects gain a .key, which breaks test_instance_with_aware_datetime_any_tzinfo. uv pip install pendulum --no-index --find-links dist --force-reinstall --no-deps - uv pip install 'python-dateutil==2.9.0.post0''tzdata>=2020.1' 'pytest>=9.0.3' 'pytest-benchmark>=4.0.0,<5.0.0' 'time-machine>=3.0.0,<4.0.0' + uv pip install 'python-dateutil==2.9.0.post0' 'tzdata>=2020.1' 'pytest>=9.0.3' 'pytest-benchmark>=4.0.0,<5.0.0' 'time-machine>=3.0.0,<4.0.0' - name: Test Pure Python run: PENDULUM_EXTENSIONS=0 pytest -q tests