Skip to content

polars-ols: Add version 0.3.5 - #2923

Draft
luhenry wants to merge 5 commits into
mainfrom
polars-ols
Draft

luhenry wants to merge 5 commits into
mainfrom
polars-ols

Conversation

@luhenry

@luhenry luhenry commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Compiles the _polars_ols pyo3-polars plugin (Rust, faer, abi3-py38). Upstream publishes no riscv64 wheel.

Mirrors upstream's CI.yml.

Differs from upstream

  • Rust pinned to nightly-2024-08-25 - rust-toolchain.toml floats on nightly; this is the release's build date
  • Dropped musllinux - rustup ships no riscv64 musl host toolchain

Matrix: one cp38-abi3 wheel, built on cp312 and tested on cp312/cp313. cp314: statsmodels (test dependency) has no riscv64 wheel; cp314t: pyo3 0.21 has no free-threading support.

Testing

  • same as upstream, against polars from the RISE registry

License: OK

luhenry added a commit that referenced this pull request Oct 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://riseproject-dev.github.io/python-wheels/pr-preview/pr-2923/

Built to branch gh-pages at 2026-10-12 23:07 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@luhenry
luhenry marked this pull request as draft October 13, 2026 09:27
…runtime-32

pyproject.toml's [build-system] requires pins "polars>=0.20.6", which maturin
never actually needs (its Rust polars dependency comes from crates.io, and
get_requires_for_build_wheel() returns no extra requirements). Resolving it
anyway pulls the newest polars (2.0.0), whose polars-runtime-32 wheel build
falls back to source on riscv64 and needs a newer Rust edition than the
pinned nightly-2024-08-25 toolchain provides.

Switch the cibuildwheel frontend to "pip; args: --no-build-isolation" and
preinstall only maturin, so build-system.requires is never resolved.

luhenry commented Oct 16, 2026 •

Copy link
Copy Markdown
Member Author

CI was failing in the Build polars-ols 0.3.5 cp38-abi3-manylinux_riscv64 job, inside python -m build's isolated-environment setup, before maturin even ran.

Root cause: upstream's pyproject.toml has [build-system] requires = ["maturin>=1.0,<2.0", "polars>=0.20.6"]. polars is dead weight there — maturin builds the Rust polars crate from crates.io, never the Python package (confirmed locally: maturin.get_requires_for_build_wheel() for this project returns []). But build's isolated env still resolves it, which pulls the newest polars (2.0.0) from PyPI, which depends on the exact pinned polars-runtime-32==2.0.0. No riscv64 wheel for that was resolvable in that isolated install, so pip fell back to the sdist, which failed at cargo metadata: feature \edition2024` is required, not stabilized in the pinned nightly-2024-08-25 toolchain (rust-toolchain.tomlupstream builds with). This only bites riscv64: on x86_64/aarch64 PyPI ships a prebuiltpolars/polars-runtime-*` wheel, so the unused build dependency installs from a binary and this path never triggers there.

Fix: switched the cibuildwheel build frontend to pip; args: --no-build-isolation and preinstall only maturin>=1.0,<2.0 via CIBW_BEFORE_BUILD_LINUX. pip's --no-build-isolation (unlike build --no-isolation) doesn't verify/resolve build-system.requires at all, so polars is never touched during the build step — no patch to upstream's pyproject.toml needed. Pushed as 9b2b04a433a.

@luhenry
luhenry marked this pull request as ready for review October 22, 2026 02:56
@luhenry luhenry closed this Oct 22, 2026
@luhenry luhenry reopened this Oct 22, 2026
@luhenry
luhenry marked this pull request as draft October 22, 2026 03:11
Cargo.toml enables pulp's and faer's "nightly" features on every
non-ARM target. On riscv64, pulp 0.18.22's "nightly" re-exports
core::arch::riscv64 without enabling the riscv_ext_intrinsics feature
gate, so the build fails on nightly-2024-08-25 with:

    error[E0658]: use of unstable library feature 'riscv_ext_intrinsics'
      --> pulp-0.18.22/src/core_arch/mod.rs:24:13

Patch Cargo.toml so riscv64 gets faer and pulp without "nightly" (as
upstream already does for ARM), keeping faer's other features. The
dependency graph is unchanged, so the committed Cargo.lock still
resolves with --locked.
…r for current polars

Test with polars[pandas,pyarrow] as tests/requirements-test.txt does:
statsmodels' formula API and the statistics test go through
DataFrame.to_pandas(), which needs pyarrow. Cap polars below 2.0 at
test time: the 0.3.5 suite calls Expr.flatten, removed in polars 2.0.

Patch the _make_data test helper to return float values from its
map_elements(return_dtype=Float64) UDF; polars 1.36 and later no longer
cast the Int64 group column implicitly, which broke test_non_contiguous.
…els only

The test-requires install resolved PyPI's newest numpy (2.5.4) and pandas
(3.1.0), which have no riscv64 wheel and are newer than the registry's, so
pip built both from sdist. numpy took 20 minutes; pandas 3.1.0 then failed
to compile its xsimd-based moments_simd.hpp on riscv64:

    error: 'load_unaligned' is not a member of 'xsimd'

Set PIP_ONLY_BINARY for the compiled test dependencies in the test
environment only, so they resolve to the registry's riscv64 wheels
(numpy 2.4.3, pandas 3.0.6, pyarrow 26.0.0, scipy 1.17.1, statsmodels
0.15.0, scikit-learn 1.9.1, polars-runtime-32 1.44.2).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant