From 9db24a59c771f45f77c107e4b76f739a9eb66e08 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Tue, 13 Oct 2026 01:05:33 +0000 Subject: [PATCH 1/4] pyjpt: Add version 1.3.4 --- .github/workflows/build-pyjpt.yml | 115 ++++++++++++++++++++++++++++++ docs/packages/pyjpt.yaml | 5 ++ 2 files changed, 120 insertions(+) create mode 100644 .github/workflows/build-pyjpt.yml create mode 100644 docs/packages/pyjpt.yaml diff --git a/.github/workflows/build-pyjpt.yml b/.github/workflows/build-pyjpt.yml new file mode 100644 index 000000000000..27a26b572d12 --- /dev/null +++ b/.github/workflows/build-pyjpt.yml @@ -0,0 +1,115 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on: https://github.com/joint-probability-trees/jpt-dev/blob/1.3.4/.github/workflows/reusable-test-and-build.yml +name: Build pyjpt wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/pyjpt.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-pyjpt.yml' + - 'docs/packages/pyjpt.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-pyjpt.yml' + - 'docs/packages/pyjpt.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: pyjpt + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build pyjpt ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 120 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # No cp314t: our registry has no free-threaded pandas wheel. + python: ["cp312", "cp313", "cp314"] + + env: + PYJPT_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout pyjpt ${{ env.PYJPT_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: joint-probability-trees/jpt-dev + ref: ${{ env.PYJPT_VERSION }} + persist-credentials: false + + - name: Build wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + output-dir: wheelhouse/ + only: ${{ matrix.python }}-manylinux_riscv64 + env: + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + # Cython 3.3.0 shipped after this release and rejects the .pyx/.pxd + # signature pairs in jpt.base.intervals; build-system.requires only floors it. + CIBW_BEFORE_ALL: echo 'Cython<3.3.0' > /cython-constraint.txt + CIBW_ENVIRONMENT: >- + PIP_BUILD_CONSTRAINT=/cython-constraint.txt + PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + PIP_ONLY_BINARY=numpy,scipy,pandas,scikit-learn,matplotlib + SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYJPT=${{ env.PYJPT_VERSION }} + CIBW_BEFORE_TEST_LINUX: dnf -y install graphviz + CIBW_TEST_SOURCES: tests examples + # The dev extra minus docs/jupyter/mlflow/kaleido; mlflow is what holds + # upstream's pandas below 3, whose str dtype infer_from_dataframe rejects. + CIBW_TEST_EXTRAS: matplotlib,seq + CIBW_TEST_REQUIRES: pytest ddt scikit-learn plotly pandas<3 + # The deselected tests export plotly figures, which needs kaleido (no riscv64 build). + CIBW_TEST_COMMAND: >- + python -c "import jpt.base.intervals.base as m; assert m.__file__.endswith('.so'), m.__file__" && + python -m pytest tests/test -p no:cacheprovider + -k "not plotly and not test_pdf_grid_3_None and not test_abalone + and not test_gaussians and not test_restaurant and not test_tourism" + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: pyjpt-${{ env.PYJPT_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish pyjpt ${{ 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: pyjpt-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/pyjpt.yaml b/docs/packages/pyjpt.yaml new file mode 100644 index 000000000000..fbe84688cada --- /dev/null +++ b/docs/packages/pyjpt.yaml @@ -0,0 +1,5 @@ +package-name: pyjpt +source-code: https://github.com/joint-probability-trees/jpt-dev +license: Unknown +versions: +- version: 1.3.4 From f5979329db1394d3b1fee9df1c24fda66943b830 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Thu, 22 Oct 2026 10:38:21 +0000 Subject: [PATCH 2/4] pyjpt: Pass the Cython pin through PIP_CONSTRAINT too pypa/build installs build-system.requires into its isolated venv with a plain pip install, which PIP_BUILD_CONSTRAINT does not constrain, so Cython 3.3.0 was still picked up and rejected intset.pyx (gotcha 175). --- .github/workflows/build-pyjpt.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-pyjpt.yml b/.github/workflows/build-pyjpt.yml index 27a26b572d12..fd2ec3b7b373 100644 --- a/.github/workflows/build-pyjpt.yml +++ b/.github/workflows/build-pyjpt.yml @@ -74,6 +74,7 @@ jobs: # signature pairs in jpt.base.intervals; build-system.requires only floors it. CIBW_BEFORE_ALL: echo 'Cython<3.3.0' > /cython-constraint.txt CIBW_ENVIRONMENT: >- + PIP_CONSTRAINT=/cython-constraint.txt PIP_BUILD_CONSTRAINT=/cython-constraint.txt PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy,scipy,pandas,scikit-learn,matplotlib From 897c194478f6ded360ff687c3970cf220175ba75 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Fri, 23 Oct 2026 17:07:31 +0000 Subject: [PATCH 3/4] pyjpt: Take pillow, contourpy and kiwisolver from wheels only matplotlib pulls in pillow>=9, and pip picked pillow 13.0.0 from PyPI, which has no riscv64 wheel, over the registry's 12.3.0 wheel. Its sdist then failed every test leg with RequiredDependencyException: jpeg, since the manylinux image has no libjpeg headers (gotchas 67/422). contourpy and kiwisolver are the other compiled matplotlib dependencies, listed for the same reason as in build-wordcloud.yml and build-lightgbm.yml. --- .github/workflows/build-pyjpt.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-pyjpt.yml b/.github/workflows/build-pyjpt.yml index fd2ec3b7b373..e0da071f3ba8 100644 --- a/.github/workflows/build-pyjpt.yml +++ b/.github/workflows/build-pyjpt.yml @@ -77,7 +77,7 @@ jobs: PIP_CONSTRAINT=/cython-constraint.txt PIP_BUILD_CONSTRAINT=/cython-constraint.txt PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,pandas,scikit-learn,matplotlib + PIP_ONLY_BINARY=numpy,scipy,pandas,scikit-learn,matplotlib,contourpy,kiwisolver,pillow SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYJPT=${{ env.PYJPT_VERSION }} CIBW_BEFORE_TEST_LINUX: dnf -y install graphviz CIBW_TEST_SOURCES: tests examples From 12fc0b969e68715fa67b509fc49cb542a8ecd282 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Sun, 25 Oct 2026 17:53:40 +0000 Subject: [PATCH 4/4] pyjpt: drop cp314, deselect riscv64 FP-precision test failures dnutils (a runtime dependency, every released version) imports _thread._set_sentinel, removed in Python 3.14, so pyjpt cannot even be imported under cp314 on any architecture. Drop cp314 from the matrix until dnutils fixes this upstream. On cp312/cp313, four tests fail only on riscv64, at or within a few ULP of a double, from exact-equality asserts (Python ==, not approx) on values from FMA/accumulation-order-sensitive floating point code: test_xshift, test_fit_extreme_magnitudes, test_conditional_jpt and test_conditioning. Deselect just those four. --- .github/workflows/build-pyjpt.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-pyjpt.yml b/.github/workflows/build-pyjpt.yml index e0da071f3ba8..8e44a9c8c4aa 100644 --- a/.github/workflows/build-pyjpt.yml +++ b/.github/workflows/build-pyjpt.yml @@ -50,7 +50,10 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} # No cp314t: our registry has no free-threaded pandas wheel. - python: ["cp312", "cp313", "cp314"] + # No cp314: dnutils (a runtime dependency, every released version) imports + # _thread._set_sentinel, removed in Python 3.14, so pyjpt fails to import + # on cp314 regardless of architecture. + python: ["cp312", "cp313"] env: PYJPT_VERSION: ${{ matrix.version }} @@ -86,11 +89,19 @@ jobs: CIBW_TEST_EXTRAS: matplotlib,seq CIBW_TEST_REQUIRES: pytest ddt scikit-learn plotly pandas<3 # The deselected tests export plotly figures, which needs kaleido (no riscv64 build). + # The --deselect tests fail only on riscv64, at or near the last few ULP of a + # double (e.g. test_conditional_jpt: 0.9999999999999999 != 1.0; test_conditioning: + # 1.0000000000000373 != 1), from vectorized FMA/accumulation order differing across + # architectures - not a pyjpt bug, and the asserts are Python == rather than approx. CIBW_TEST_COMMAND: >- python -c "import jpt.base.intervals.base as m; assert m.__file__.endswith('.so'), m.__file__" && python -m pytest tests/test -p no:cacheprovider -k "not plotly and not test_pdf_grid_3_None and not test_abalone and not test_gaussians and not test_restaurant and not test_tourism" + --deselect tests/test/base/functions/test_piecewise.py::PLFTest::test_xshift + --deselect tests/test/distributions/qpd/test_quantiles.py::FitInvariantTest::test_fit_extreme_magnitudes + --deselect tests/test/test_trees.py::JPTTest::test_conditional_jpt + --deselect tests/test/test_trees.py::TestGaussianConditionalJPT::test_conditioning - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: