From 1257990f76fd19d21cad295e74902610a482df34 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 28 Sep 2026 07:28:48 +0000 Subject: [PATCH 1/5] feat: add dataframely riscv64 wheel build dataframely is not a pure-Python Polars wrapper: it ships its own PyO3 extension (dataframely._native) built with maturin, and its Cargo.toml patches polars/polars-core/polars-arrow/pyo3-polars onto a pinned pola-rs fork commit, so building it compiles a full Polars-scale crate graph from source -- comparable in size to build-polars-runtime.yml's own build. Mirrors upstream's own build.yml (maturin-action, --release -i python3.10, abi3-py310), narrowed to riscv64gc-unknown-linux-gnu on manylinux_2_39, with the same fat-LTO override build-polars-runtime.yml and build-deltalake.yml already carry for a crate graph of this size. --- .github/workflows/build-dataframely.yml | 138 ++++++++++++++++++++++++ docs/packages/dataframely.yaml | 5 + 2 files changed, 143 insertions(+) create mode 100644 .github/workflows/build-dataframely.yml create mode 100644 docs/packages/dataframely.yaml diff --git a/.github/workflows/build-dataframely.yml b/.github/workflows/build-dataframely.yml new file mode 100644 index 00000000000..dbb3f1d2a48 --- /dev/null +++ b/.github/workflows/build-dataframely.yml @@ -0,0 +1,138 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on: https://github.com/quantco/dataframely/blob/main/.github/workflows/build.yml +name: Build dataframely wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/dataframely.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-dataframely.yml' + - 'docs/packages/dataframely.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-dataframely.yml' + - 'docs/packages/dataframely.yaml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + PYTHON_VERSION: '3.10' + CARGO_INCREMENTAL: 0 + CARGO_NET_RETRY: 10 + RUSTUP_MAX_RETRIES: 10 + # dataframely's Cargo.toml puts `lto = true` + `codegen-units = 1` directly + # on the `release` profile, and pulls in a full pola-rs fork as its crate + # graph (see build-polars-runtime.yml). Overridden down the same way for + # the same reason: the riscv64 runner cannot afford fat LTO on that graph. + CARGO_PROFILE_RELEASE_LTO: 'off' + CARGO_PROFILE_RELEASE_CODEGEN_UNITS: '16' + CARGO_PROFILE_RELEASE_OPT_LEVEL: '1' + CARGO_BUILD_JOBS: '2' + +defaults: + run: + shell: bash + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: dataframely + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build dataframely ${{ matrix.version }} cp310-abi3-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 1440 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + env: + DATAFRAMELY_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout dataframely v${{ env.DATAFRAMELY_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: quantco/dataframely + ref: v${{ env.DATAFRAMELY_VERSION }} + persist-credentials: false + + # Upstream's own build.yml runs `pixi run -e build set-version`, which + # is this same sed against a setuptools_scm-derived string; the target + # version is already known here, so it is substituted directly. + - name: Set version + run: sed -i "s/version = \"0.0.0\"/version = \"${DATAFRAMELY_VERSION}\"/" pyproject.toml + + # Same OOM guard build-polars-runtime.yml needs on these runners for a + # comparably sized Rust build (a pinned pola-rs fork). + - name: Set swap space + uses: pierotofy/set-swap-space@fc79b3f67fa8a838184ce84a674ca12238d2c761 # master + with: + swap-size-gb: 10 + + - name: Build wheel + uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 + with: + command: build + target: riscv64gc-unknown-linux-gnu + args: --out dist --release -i python3.10 --strip + manylinux: '2_39' + before-script-linux: git config --global --add safe.directory "*" + + - name: Install Python + uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 + with: + python-version: ${{ env.PYTHON_VERSION }} + activate-environment: true + enable-cache: false + + - name: Test wheel + run: | + uv pip install --force-reinstall dist/*.whl + uv pip install --extra-index-url https://pypi.riseproject.dev/simple/ \ + pytest pytest-benchmark pytest-mock numpy pyarrow + python -c 'import dataframely; print(dataframely.__version__)' + python -m pytest tests -m "not with_optionals" + + - name: Upload wheel + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: dataframely-${{ env.DATAFRAMELY_VERSION }}-cp310-abi3-manylinux_riscv64 + path: dist/*.whl + if-no-files-found: error + + publish: + name: Publish dataframely ${{ 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: dataframely-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/dataframely.yaml b/docs/packages/dataframely.yaml new file mode 100644 index 00000000000..cf09563fa2f --- /dev/null +++ b/docs/packages/dataframely.yaml @@ -0,0 +1,5 @@ +package-name: dataframely +source-code: https://github.com/quantco/dataframely +license: BSD-3-Clause +versions: +- version: 3.0.0 From a67deb004d80f4713cbad179bd0aabbd80a5ac9f Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 28 Sep 2026 13:44:22 +0000 Subject: [PATCH 2/5] dataframely: drop pyarrow from cp310 test install, skip arrow-pycapsule tests pypi.riseproject.dev's pyarrow only has riscv64 wheels for cp312+, so uv cannot resolve it for the cp310 test venv. dataframely's own test suite only hard-imports pyarrow in tests/columns/test_arrow_pycapsule.py, so ignore that one module instead of pulling pyarrow in for this abi3 build. --- .github/workflows/build-dataframely.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-dataframely.yml b/.github/workflows/build-dataframely.yml index dbb3f1d2a48..2fb30887088 100644 --- a/.github/workflows/build-dataframely.yml +++ b/.github/workflows/build-dataframely.yml @@ -109,9 +109,11 @@ jobs: run: | uv pip install --force-reinstall dist/*.whl uv pip install --extra-index-url https://pypi.riseproject.dev/simple/ \ - pytest pytest-benchmark pytest-mock numpy pyarrow + pytest pytest-benchmark pytest-mock numpy python -c 'import dataframely; print(dataframely.__version__)' - python -m pytest tests -m "not with_optionals" + # pyarrow has no cp310 riscv64 wheel yet (registry starts at cp312); this abi3 + # wheel is cp310+, so skip only the one test module that hard-imports pyarrow. + python -m pytest tests -m "not with_optionals" --ignore=tests/columns/test_arrow_pycapsule.py - name: Upload wheel uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 From 093b7cac9a801e31ba28b04ebc1d726ddf7520f8 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 28 Sep 2026 22:06:30 +0000 Subject: [PATCH 3/5] dataframely: cd out of checkout before the wheel sanity-check/pytest The Test wheel step installs the just-built wheel then runs `python -c 'import dataframely; ...'` and `python -m pytest tests ...` from the checkout root. dataframely's pure-Python wrapper package lives directly at that root, and both invocation forms unconditionally prepend cwd to sys.path[0], so they resolved the checkout's own dataframely/__init__.py (no compiled _native) instead of the wheel's copy in site-packages (gotcha 25/218). Fix: cd /tmp first, and pass the tests dir plus pytest's config file and --ignore path as GITHUB_WORKSPACE-absolute so pytest can still find them. Reproduced and verified the fix locally with a stand-in package tree mimicking the checkout/site-packages split, for both the `python -c` and `python -m pytest` invocations. --- .github/workflows/build-dataframely.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-dataframely.yml b/.github/workflows/build-dataframely.yml index 2fb30887088..643523b39ef 100644 --- a/.github/workflows/build-dataframely.yml +++ b/.github/workflows/build-dataframely.yml @@ -110,10 +110,19 @@ jobs: uv pip install --force-reinstall dist/*.whl uv pip install --extra-index-url https://pypi.riseproject.dev/simple/ \ pytest pytest-benchmark pytest-mock numpy + + # cd out of the checkout first (gotcha 25/218): dataframely's pure-Python + # wrapper package lives directly at the checkout root ($GITHUB_WORKSPACE), + # and both `python -c` and `python -m pytest` prepend cwd to sys.path[0] + # unconditionally, so run from here they'd import that source tree -- + # which has no compiled _native extension -- instead of the wheel just + # installed above. + cd /tmp python -c 'import dataframely; print(dataframely.__version__)' # pyarrow has no cp310 riscv64 wheel yet (registry starts at cp312); this abi3 # wheel is cp310+, so skip only the one test module that hard-imports pyarrow. - python -m pytest tests -m "not with_optionals" --ignore=tests/columns/test_arrow_pycapsule.py + python -m pytest "${GITHUB_WORKSPACE}/tests" -c "${GITHUB_WORKSPACE}/pyproject.toml" \ + -m "not with_optionals" --ignore="${GITHUB_WORKSPACE}/tests/columns/test_arrow_pycapsule.py" - name: Upload wheel uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 From a98ccaf80e31314534eeed7b76fde69f0d845f8f Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Tue, 29 Sep 2026 04:16:03 +0000 Subject: [PATCH 4/5] dataframely: install pandas for the benches test collection tests/benches/conftest.py imports pandas at module load, which pytest collection needs even though the benchmark suite itself is not gated by -m "not with_optionals". pypi.riseproject.dev already publishes a cp310 riscv64 wheel for pandas (up through 2.3.2, before 3.0's requires-python bump to >=3.11), so this resolves to a prebuilt wheel rather than a from-source build. --- .github/workflows/build-dataframely.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-dataframely.yml b/.github/workflows/build-dataframely.yml index 643523b39ef..83a24903ff4 100644 --- a/.github/workflows/build-dataframely.yml +++ b/.github/workflows/build-dataframely.yml @@ -109,7 +109,7 @@ jobs: run: | uv pip install --force-reinstall dist/*.whl uv pip install --extra-index-url https://pypi.riseproject.dev/simple/ \ - pytest pytest-benchmark pytest-mock numpy + pytest pytest-benchmark pytest-mock numpy pandas # cd out of the checkout first (gotcha 25/218): dataframely's pure-Python # wrapper package lives directly at the checkout root ($GITHUB_WORKSPACE), From c3e0135c766f5f6356cb6a8b24d4972b2c168adf Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Wed, 30 Sep 2026 10:40:24 +0200 Subject: [PATCH 5/5] dataframely: skip tests/benches, which hard-imports scikit-learn with no cp310 riscv64 wheel scikit-learn only has cp312+ riscv64 wheels on the registry, so it can't be installed for this cp310-abi3 leg's test dependencies; skip the one directory that needs it, mirroring the existing pyarrow skip. --- .github/workflows/build-dataframely.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-dataframely.yml b/.github/workflows/build-dataframely.yml index 83a24903ff4..fd495c5f382 100644 --- a/.github/workflows/build-dataframely.yml +++ b/.github/workflows/build-dataframely.yml @@ -121,8 +121,11 @@ jobs: python -c 'import dataframely; print(dataframely.__version__)' # pyarrow has no cp310 riscv64 wheel yet (registry starts at cp312); this abi3 # wheel is cp310+, so skip only the one test module that hard-imports pyarrow. + # scikit-learn likewise starts at cp312 on the registry; tests/benches hard-imports + # it in its own conftest.py, so skip that whole directory too. python -m pytest "${GITHUB_WORKSPACE}/tests" -c "${GITHUB_WORKSPACE}/pyproject.toml" \ - -m "not with_optionals" --ignore="${GITHUB_WORKSPACE}/tests/columns/test_arrow_pycapsule.py" + -m "not with_optionals" --ignore="${GITHUB_WORKSPACE}/tests/columns/test_arrow_pycapsule.py" \ + --ignore="${GITHUB_WORKSPACE}/tests/benches" - name: Upload wheel uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1