From 8b8ef1306684eba9c842583e636cf42ab025dbb5 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Tue, 13 Oct 2026 06:32:54 +0000 Subject: [PATCH 1/2] pyfixest: add riscv64 build (0.60.0) pyfixest switched to a maturin/PyO3 Rust core (pyfixest.core._core_impl) as of this release. Pure-Rust dependency tree (pyo3, ndarray, rayon, numpy, thiserror, postcard, within), no C libraries and no ISA-gated code, so the port is a plain cibuildwheel/maturin build mirroring pycrdt/granian. Matrix trimmed to cp312/cp313/cp314: PyPy and musllinux dropped per repo convention, cp310/cp311 dropped to match the default interpreter matrix, cp313t dropped because cibuildwheel 4.2.0 has no cp313t build identifier (gotcha 204), and cp314t dropped because pandas has no free-threaded riscv64 wheel. Test scope excludes files that import pyfixest's numba/jax backends or statsmodels at module scope, none of which this registry ships for every targeted interpreter. --- .github/workflows/build-pyfixest.yml | 130 +++++++++++++++++++++++++++ docs/packages/pyfixest.yaml | 5 ++ 2 files changed, 135 insertions(+) create mode 100644 .github/workflows/build-pyfixest.yml create mode 100644 docs/packages/pyfixest.yaml diff --git a/.github/workflows/build-pyfixest.yml b/.github/workflows/build-pyfixest.yml new file mode 100644 index 000000000000..bea11499d3ff --- /dev/null +++ b/.github/workflows/build-pyfixest.yml @@ -0,0 +1,130 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on the `linux` job of +# https://github.com/py-econometrics/pyfixest/blob/v0.60.0/.github/workflows/build-and-release.yaml +name: Build pyfixest wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/pyfixest.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-pyfixest.yml' + - 'docs/packages/pyfixest.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-pyfixest.yml' + - 'docs/packages/pyfixest.yaml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: pyfixest + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build pyfixest ${{ 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) }} + # pyo3 has no abi3 feature enabled here, so upstream builds and + # publishes one wheel per interpreter (cp310-cp314, cp313t/cp314t, + # pypy3.10/3.11); pypy is dropped (this repo doesn't build PyPy + # wheels) and musllinux with it (rustup.rs ships no riscv64 musl + # toolchain). cp310/cp311 are dropped to match this repo's default + # interpreter matrix (numpy 2.5.0+ sets 3.12 as its floor). cp313t + # is dropped because cibuildwheel 4.2.0 has no cp313t build + # identifier on any platform (CLAUDE.md gotcha 204). cp314t is + # dropped because pandas, a runtime requirement, has no + # free-threaded riscv64 wheel anywhere. + python: ["cp312", "cp313", "cp314"] + + env: + PYFIXEST_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout pyfixest v${{ env.PYFIXEST_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: py-econometrics/pyfixest + ref: v${{ env.PYFIXEST_VERSION }} + persist-credentials: false + + - name: Build wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + only: ${{ matrix.python }}-manylinux_riscv64 + output-dir: wheelhouse/ + env: + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + # pyfixest ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + CIBW_BEFORE_ALL_LINUX: >- + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + CIBW_ENVIRONMENT_LINUX: >- + PATH="$PATH:$HOME/.cargo/bin" + PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + PIP_ONLY_BINARY=numpy,scipy,pandas,matplotlib,duckdb + CIBW_TEST_REQUIRES: pytest pytest-xdist duckdb matplotlib polars + CIBW_TEST_SOURCES: tests + # test_collinearity.py, test_count_fixef_fully_nested.py, + # test_demean.py and test_detect_singletons.py import pyfixest's + # numba/jax backends at module scope; neither has a riscv64 wheel + # anywhere, nor a port in this repo. test_quantreg.py needs + # statsmodels, which has no riscv64 wheel for cp314 (CLAUDE.md + # gotcha 84). + CIBW_TEST_COMMAND: >- + python -c "import pyfixest.core._core_impl as m; assert m.__file__.endswith('.so'), m.__file__" + && python -m pytest -v tests + -m "not (extended or against_r_core or against_r_extended or plots or hac)" + --ignore tests/test_collinearity.py + --ignore tests/test_count_fixef_fully_nested.py + --ignore tests/test_demean.py + --ignore tests/test_detect_singletons.py + --ignore tests/test_quantreg.py + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: pyfixest-${{ env.PYFIXEST_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish pyfixest ${{ 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: pyfixest-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/pyfixest.yaml b/docs/packages/pyfixest.yaml new file mode 100644 index 000000000000..5fafac63bc8d --- /dev/null +++ b/docs/packages/pyfixest.yaml @@ -0,0 +1,5 @@ +package-name: pyfixest +source-code: https://github.com/py-econometrics/pyfixest +license: MIT License +versions: +- version: 0.60.0 From be4c6c6096f412ae1d8708c0702300e7f4399556 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Fri, 23 Oct 2026 18:14:25 +0000 Subject: [PATCH 2/2] pyfixest: fix test environment install and test collection The test venv install pulled pillow 13.0.0, which has no riscv64 wheel, as an sdist and failed on missing libjpeg headers. Force pillow, polars-runtime-32 and pyarrow to wheels so pip picks the registry versions. Add pytest-benchmark and pyarrow from upstream's test environment, stage benchmarks/ and pyfixest/did/data/ that tests import or read relative to the repository root, run with -n auto as upstream does, and skip the tests that need torch, jax, numba (wildboottest) or the release script under .github/, plus test_errors_etable, which expects the error type of upstream's locked maketables 0.1.8. --- .github/workflows/build-pyfixest.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-pyfixest.yml b/.github/workflows/build-pyfixest.yml index bea11499d3ff..1b8473f57a09 100644 --- a/.github/workflows/build-pyfixest.yml +++ b/.github/workflows/build-pyfixest.yml @@ -87,24 +87,35 @@ jobs: CIBW_ENVIRONMENT_LINUX: >- PATH="$PATH:$HOME/.cargo/bin" PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,pandas,matplotlib,duckdb - CIBW_TEST_REQUIRES: pytest pytest-xdist duckdb matplotlib polars - CIBW_TEST_SOURCES: tests + PIP_ONLY_BINARY=numpy,scipy,pandas,matplotlib,duckdb,pillow,polars-runtime-32,pyarrow + CIBW_TEST_REQUIRES: pytest pytest-xdist pytest-benchmark duckdb matplotlib polars pyarrow + CIBW_TEST_SOURCES: tests benchmarks pyfixest/did/data # test_collinearity.py, test_count_fixef_fully_nested.py, # test_demean.py and test_detect_singletons.py import pyfixest's - # numba/jax backends at module scope; neither has a riscv64 wheel - # anywhere, nor a port in this repo. test_quantreg.py needs + # numba/jax backends at module scope, and the jax-named tests and + # test_wildboottest.py/test_rwolf_error (wildboottest needs numba) + # call them; neither has a riscv64 wheel anywhere, nor a port in + # this repo. test_batched_lsmr.py and test_lsmr_compiled.py import + # torch, which has no riscv64 wheel either. test_quantreg.py needs # statsmodels, which has no riscv64 wheel for cp314 (CLAUDE.md - # gotcha 84). + # gotcha 84). test_check_version.py tests upstream's release script + # under .github/, not the wheel. test_errors_etable expects the + # AssertionError of upstream's locked maketables 0.1.8; 0.2.0 + # raises ValueError. CIBW_TEST_COMMAND: >- python -c "import pyfixest.core._core_impl as m; assert m.__file__.endswith('.so'), m.__file__" - && python -m pytest -v tests + && python -m pytest -v tests -n auto -m "not (extended or against_r_core or against_r_extended or plots or hac)" + -k "not (jax or test_rwolf_error or test_errors_etable)" + --ignore tests/test_batched_lsmr.py + --ignore tests/test_check_version.py --ignore tests/test_collinearity.py --ignore tests/test_count_fixef_fully_nested.py --ignore tests/test_demean.py --ignore tests/test_detect_singletons.py + --ignore tests/test_lsmr_compiled.py --ignore tests/test_quantreg.py + --ignore tests/test_wildboottest.py - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: