Skip to content

scikit-learn: add build-scikit-learn.yml for riscv64 wheels - #339

Draft
luhenry wants to merge 2 commits into
mainfrom
scikit-learn
Draft

scikit-learn: add build-scikit-learn.yml for riscv64 wheels#339
luhenry wants to merge 2 commits into
mainfrom
scikit-learn

Conversation

@luhenry

@luhenry luhenry commented Aug 25, 2026

Copy link
Copy Markdown
Member

~100 Cython/C++ extension modules. Upstream publishes manylinux wheels for every architecture except riscv64.

Mirrors upstream's wheels.yml, reusing its cibw_before_build.sh and test_wheels.sh.

Differs from upstream

  • PIP_EXTRA_INDEX_URL plus PIP_ONLY_BINARY=numpy,scipy,pandas — those three have no riscv64 wheels on PyPI and must come from our registry. cython and meson-python are deliberately not in the list; they have no riscv64 wheel anywhere and build from sdist.

Testing

  • same as upstream

License: ✅ cibw_before_build.sh appends the bundled-library notice to COPYING, and test_wheels.sh asserts it via check_license.py.

A gpl_sources job publishes gcc sources against the same pinned image, since auditwheel bundles the image's libgomp.

@luhenry
luhenry marked this pull request as draft August 25, 2026 13:14
scikit-learn publishes manylinux wheels for every architecture except
riscv64, so nothing installs on ubuntu-24.04-riscv today.

The workflow mirrors the `build_wheels` job of upstream's
.github/workflows/wheels.yml, narrowed to riscv64: the same
cibw_before_build.sh / test_wheels.sh entry points, the same
RUNNER_OS pass-through that check_license.py depends on, and the
same SKLEARN_SKIP_NETWORK_TESTS=1.

riscv64-only overrides:

- CIBW_MANYLINUX_RISCV64_IMAGE,
- PIP_EXTRA_INDEX_URL so numpy/scipy/pandas resolve to our riscv64
  wheels in both the build and the test phase,
- PIP_ONLY_BINARY scoped to those three so pip cannot silently
  source-build them; it is deliberately not :all:, since cython and
  meson-python have no riscv64 wheel anywhere and must compile from
  sdist in the build environment.

pytest-xdist is added to CIBW_TEST_REQUIRES: upstream's test_wheels.sh
already uses it when present, and the full sklearn suite is otherwise
too slow on the riscv64 runner.

The matrix stops at cp313 because scipy is a *build* requirement
(sklearn cimports scipy.linalg.cython_blas) and pypi.riseproject.dev
carries riscv64 scipy only up to cp313 (1.15.2); cp314/cp314t can be
added once scipy is built for them.

A gpl_sources job is included: auditwheel vendors the manylinux image's
libgomp into the wheel (scikit_learn.libs/libgomp-*.so.1.0.0, as
upstream's build_tools/wheels/LICENSE_linux.txt documents), so the gcc
sources that produced it have to be published alongside.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Reverts the temporary cp312/cp313 restriction: scipy 1.18.1 riscv64 wheels
are published for all four interpreters, including cp314t, so the build
requirement resolves.
@luhenry
luhenry marked this pull request as ready for review August 26, 2026 18:50
@luhenry

luhenry commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

Depends on scipy<1.18.0; work in progress.

@luhenry
luhenry marked this pull request as draft August 26, 2026 19:02
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