Skip to content

runstats: add build-runstats.yml for riscv64 wheels - #1346

Merged
luhenry merged 3 commits into
mainfrom
runstats
Sep 7, 2026
Merged

runstats: add build-runstats.yml for riscv64 wheels#1346
luhenry merged 3 commits into
mainfrom
runstats

Conversation

@luhenry

@luhenry luhenry commented Sep 7, 2026

Copy link
Copy Markdown
Member

Compiles a Cython extension for online statistics and regression (mean, variance, skewness, kurtosis). Upstream publishes no riscv64 wheel.

Mirrors upstream's release.yml cibuildwheel build.

Differs from upstream

  • Builds without isolation (--no-build-isolation) - setup.py has no [build-system] table, so the default isolated build env never sees the installed Cython and silently falls back to a pure-Python wheel.
  • Adds a compiled-extension assertion ahead of the test suite - same silent-fallback risk applies to the test run.
  • Stages only tests/ for pytest instead of {project}/tests - the checkout's own runstats/ package otherwise shadows the installed wheel, and drops tox.ini's unrelated --cov-fail-under=100 gate.

Testing

  • same as upstream (pytest + benchmark.py), staged as above

License: OK, Apache-2.0, no vendored third-party code.

Patches

  • 0001-core-define-Statistics.__rmul__-explicitly-instead-o.patch - To upstream. Cython 3.x never wires the compiled type's __rmul__ when it's assigned from __mul__ rather than defined with def, so 2 * stats raised TypeError; reproduces on any architecture.

Mirrors upstream's own release.yml cibuildwheel build (CIBW_BEFORE_BUILD:
pip install cython, test with pytest + benchmark.py), matrixed over
cp312/cp313/cp314/cp314t for manylinux_riscv64. Adds an explicit compiled-
extension assertion ahead of the test suite since setup.py silently falls
back to a pure-Python wheel on any Cython/build failure.
luhenry added a commit that referenced this pull request Sep 7, 2026
setup.py has no [build-system] table, so pypa/build's default isolated
venv never sees CIBW_BEFORE_BUILD's cython install and setup.py's bare
try/except falls back to a pure-Python wheel, which cibuildwheel then
rejects (gotcha 57).
CI showed two real failures beyond the earlier build-isolation fix:
Cython 3.x never wires the compiled Statistics type's __rmul__ (the
"__rmul__ = __mul__" alias only adds a dict entry, it does not retroactively
fill the nb_multiply slot), so "2 * stats" raised TypeError; and running
pytest against {project}/tests let the checkout's own runstats/ package
shadow the installed wheel under tox.ini's discovered config, which also
pulled in a --cov-fail-under=100 gate unrelated to the port. Patches the
__rmul__ definition and stages just tests/ into an empty cwd instead.
@luhenry
luhenry merged commit 3114af6 into main Sep 7, 2026
10 checks passed
@luhenry
luhenry deleted the runstats branch September 7, 2026 16:04
@luhenry luhenry linked an issue Sep 7, 2026 that may be closed by this pull request
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.

runstats riscv64 support

1 participant