From 159a1e67e268706d035cd9f0a3f29ad5a937e48b Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Wed, 30 Sep 2026 14:43:36 +0000 Subject: [PATCH 1/3] kivy: Add version 2.3.1 --- .github/workflows/build-kivy.yml | 264 +++++++++++++++++++++++++++++++ docs/packages/kivy.yaml | 5 + 2 files changed, 269 insertions(+) create mode 100644 .github/workflows/build-kivy.yml create mode 100644 docs/packages/kivy.yaml diff --git a/.github/workflows/build-kivy.yml b/.github/workflows/build-kivy.yml new file mode 100644 index 00000000000..4a86c5e3f2c --- /dev/null +++ b/.github/workflows/build-kivy.yml @@ -0,0 +1,264 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on +# https://github.com/kivy/kivy/blob/2.3.1/.github/workflows/manylinux_wheels.yml +name: Build kivy wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/kivy.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-kivy.yml' + - 'docs/packages/kivy.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-kivy.yml' + - 'docs/packages/kivy.yaml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: kivy + version: ${{ inputs.version }} + + kivy_examples_create: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build kivy-examples ${{ matrix.version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + env: + KIVY_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout kivy ${{ env.KIVY_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: kivy/kivy + ref: ${{ env.KIVY_VERSION }} + persist-credentials: false + + - uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 + with: + python-version: '3.12' + activate-environment: true + enable-cache: false + + - name: Install CI/CD Python requirements + run: | + uv pip install -r .ci/cicd-requirements.txt + + - name: Create wheel + run: | + KIVY_BUILD_EXAMPLES=1 python3 -m build --wheel . + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: kivy-${{ env.KIVY_VERSION }}-examples + path: dist/*.whl + if-no-files-found: error + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build kivy ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 360 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # 2.3.1 predates 3.14: upstream builds up to cp313 and caps Cython at 3.0.11. + python: ["cp312", "cp313"] + + env: + KIVY_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout kivy ${{ env.KIVY_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: kivy/kivy + ref: ${{ env.KIVY_VERSION }} + persist-credentials: false + + - uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 + with: + python-version: '3.12' + activate-environment: true + enable-cache: false + + - name: Generate version metadata + run: | + source .ci/ubuntu_ci.sh + update_version_metadata + + - name: Build wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + output-dir: wheelhouse/ + only: ${{ matrix.python }}-manylinux_riscv64 + env: + CIBW_ENVIRONMENT_LINUX: >- + KIVY_SPLIT_EXAMPLES=1 USE_X11=1 USE_SDL2=1 USE_PANGOFT2=0 USE_GSTREAMER=0 + KIVY_DEPS_ROOT=$(pwd)/kivy-dependencies + LD_LIBRARY_PATH=$(pwd)/kivy-dependencies/dist/lib:$(pwd)/kivy-dependencies/dist/lib64 + CMAKE_POLICY_VERSION_MINIMUM=3.5 + # Upstream's install_manylinux_build_deps minus EPEL and three optional packages Rocky 10 + # lacks, then its SDL2 stack build (a separate manylinux2014 docker run upstream). + CIBW_BEFORE_ALL_LINUX: | + set -e + dnf install -y autoconf automake cmake gcc gcc-c++ git make pkgconfig \ + ninja-build alsa-lib-devel pulseaudio-libs-devel \ + libX11-devel libXext-devel libXrandr-devel libXcursor-devel libXfixes-devel \ + libXi-devel dbus-devel ibus-devel \ + systemd-devel mesa-libGL-devel libxkbcommon-devel \ + mesa-libEGL-devel wayland-devel wayland-protocols-devel \ + libdrm-devel mesa-libgbm-devel libsamplerate-devel \ + python-unversioned-command zlib-ng-compat-devel + ./tools/build_linux_dependencies.sh + d=kivy-dependencies/build + cp $d/SDL2-*/LICENSE.txt LICENSE.SDL2 + cp $d/SDL2_image-*/LICENSE.txt LICENSE.SDL2_image + cp $d/SDL2_image-*/external/libtiff/COPYRIGHT LICENSE.libtiff + cp $d/SDL2_image-*/external/libwebp/COPYING LICENSE.libwebp + cp $d/SDL2_mixer-*/LICENSE.txt LICENSE.SDL2_mixer + cp $d/SDL2_mixer-*/external/libxmp/docs/COPYING LICENSE.libxmp + cp $d/SDL2_ttf-*/LICENSE.txt LICENSE.SDL2_ttf + cp $d/SDL2_ttf-*/external/freetype/docs/FTL.TXT LICENSE.freetype + cp $d/SDL2_ttf-*/external/harfbuzz/COPYING LICENSE.harfbuzz + cp $d/libpng-*/LICENSE LICENSE.libpng + + - name: Check the vendored libraries and their licences + run: | + python3 - wheelhouse/*.whl <<'EOF' + import sys, zipfile + licences = {"LICENSE", "LICENSE.SDL2", "LICENSE.SDL2_image", "LICENSE.libtiff", + "LICENSE.libwebp", "LICENSE.SDL2_mixer", "LICENSE.libxmp", + "LICENSE.SDL2_ttf", "LICENSE.freetype", "LICENSE.harfbuzz", + "LICENSE.libpng"} + libs = {"libSDL2", "libSDL2_image", "libSDL2_mixer", "libSDL2_ttf", "libpng16"} + for whl in sys.argv[1:]: + names = zipfile.ZipFile(whl).namelist() + found = {n.rsplit("/", 1)[1] for n in names if ".dist-info/" in n} + assert licences <= found, f"{whl}: missing {licences - found}" + vendored = {n.rsplit("/", 1)[1].split("-")[0] for n in names + if n.lower().startswith("kivy.libs/") and not n.endswith("/")} + assert vendored == libs, f"{whl}: vendors {sorted(vendored)}" + assert any(n.startswith("kivy/core/window/_window_sdl2.") for n in names), whl + print(whl, "ok") + EOF + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: kivy-${{ env.KIVY_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + test_wheels: + needs: [setup, kivy_examples_create, build_wheels] + if: needs.setup.outputs.versions != '[]' + name: Test kivy ${{ matrix.version }} on Python ${{ matrix.python }} + runs-on: ubuntu-24.04-riscv + timeout-minutes: 180 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + python: ['3.12', '3.13'] + + env: + KIVY_VERSION: ${{ matrix.version }} + DISPLAY: ':99.0' + PIP_EXTRA_INDEX_URL: https://pypi.riseproject.dev/simple/ + + steps: + - name: Checkout kivy ${{ env.KIVY_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: kivy/kivy + ref: ${{ env.KIVY_VERSION }} + persist-credentials: false + + - uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 + with: + python-version: ${{ matrix.python }} + activate-environment: true + enable-cache: false + + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + pattern: kivy-${{ env.KIVY_VERSION }}-*-manylinux_riscv64 + merge-multiple: true + path: dist + + # Upstream's ubuntu-latest image already has Xvfb and Mesa; uv's venv has no pip. + - name: Setup env + run: | + sudo apt-get update + sudo apt-get install -qy xvfb libgl1-mesa-dri + uv pip install pip + source .ci/ubuntu_ci.sh + prepare_env_for_unittest + + - name: Install Kivy + run: | + source .ci/ubuntu_ci.sh + install_kivy_wheel dev + + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: kivy-${{ env.KIVY_VERSION }}-examples + path: dist + + - name: Install kivy-examples wheel + run: | + source .ci/ubuntu_ci.sh + install_kivy_examples_wheel dev + + - name: Test Kivy + run: | + source .ci/ubuntu_ci.sh + test_kivy_install + + - name: Test Kivy benchmarks + run: | + source .ci/ubuntu_ci.sh + test_kivy_benchmark + + publish: + name: Publish kivy ${{ matrix.version }} + needs: [setup, build_wheels, test_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: kivy-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/kivy.yaml b/docs/packages/kivy.yaml new file mode 100644 index 00000000000..aae9cc71dd9 --- /dev/null +++ b/docs/packages/kivy.yaml @@ -0,0 +1,5 @@ +package-name: kivy +source-code: https://github.com/kivy/kivy +license: MIT +versions: +- version: 2.3.1 From bdbeabae9bd296aca86905af1bb558330c351731 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Wed, 30 Sep 2026 19:27:18 +0200 Subject: [PATCH 2/3] build-kivy: constrain pytest below 9.1 for the test run Test collection failed on all matrix legs with "Failed: Marks cannot be applied to fixtures." in common.py's async_run helper (pytest.mark.asyncio(pytest_asyncio.fixture(func))). Not riscv64-specific: setup.cfg's [dev] extra pins pytest>=3.6 and pytest-asyncio!=0.11.0, both open-ended, so install_kivy_wheel dev resolves against today's PyPI and lands on pytest 9.1+. Verified by diffing the pytest 9.0.3 and 9.1.0 wheels directly: the same message lives in _pytest/deprecated.py (a PytestRemovedIn8Warning) through 9.0.3, and moves to _pytest/fixtures.py as a hard fail() in 9.1.0. A PIP_CONSTRAINT file caps pytest for the test install only, without touching setup.cfg's own bound or the shipped wheel's dependencies (kivy declares no pytest runtime dependency at all). Signed-off-by: Ludovic Henry --- .github/workflows/build-kivy.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/build-kivy.yml b/.github/workflows/build-kivy.yml index 4a86c5e3f2c..b96e5ccdc38 100644 --- a/.github/workflows/build-kivy.yml +++ b/.github/workflows/build-kivy.yml @@ -221,6 +221,19 @@ jobs: source .ci/ubuntu_ci.sh prepare_env_for_unittest + # setup.cfg's [dev] extra pins pytest>=3.6 and pytest-asyncio!=0.11.0, both with no + # upper bound. install_kivy_wheel below resolves that against today's PyPI, landing on + # pytest 9.1+, where a check that used to be a PytestRemovedIn8Warning (deprecated.py) + # became a hard `Failed: Marks cannot be applied to fixtures.` (fixtures.py) -- verified + # by diffing the pytest 9.0.3 and 9.1.0 wheels directly. common.py's own async_run + # decorator does pytest.mark.asyncio(pytest_asyncio.fixture(func)), exactly the pattern + # that now trips. A PIP_CONSTRAINT keeps pytest below that line without touching + # setup.cfg's own bound. + - name: Constrain pytest for the test run + run: | + echo 'pytest<9.1' > "${{ runner.temp }}/constraints.txt" + echo "PIP_CONSTRAINT=${{ runner.temp }}/constraints.txt" >> "$GITHUB_ENV" + - name: Install Kivy run: | source .ci/ubuntu_ci.sh From 17bd096ead4a86fd126bd2d8a14fe85cc822f9be Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Wed, 30 Sep 2026 22:22:23 +0200 Subject: [PATCH 3/3] build-kivy: tighten the pytest cap to <8, not just <9.1 <9.1 fixed the hard `Failed: Marks cannot be applied to fixtures.` error (that's pytest 9.1.0+ only), but the resolved 9.0.x still promotes the same underlying PytestRemovedIn9Warning to a collection ERROR at import time -- same test_app.py collection failure, different error class. pytest's own deprecation-escalation policy in the 9.0 pre-9.1 window apparently already enforces this one as fatal, not just warn-worthy. Drop the cap below the whole 8.x/9.0 cycle to pytest<8, the last major line predating this deprecation existing at all (my earlier diff of 7.4.4's _pytest/fixtures.py and deprecated.py found neither the warning nor the hard-error string). No change to pytest-asyncio's own version -- pip's resolver picks whichever release is compatible with pytest<8. Signed-off-by: Ludovic Henry --- .github/workflows/build-kivy.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-kivy.yml b/.github/workflows/build-kivy.yml index b96e5ccdc38..fed2d714eac 100644 --- a/.github/workflows/build-kivy.yml +++ b/.github/workflows/build-kivy.yml @@ -222,16 +222,17 @@ jobs: prepare_env_for_unittest # setup.cfg's [dev] extra pins pytest>=3.6 and pytest-asyncio!=0.11.0, both with no - # upper bound. install_kivy_wheel below resolves that against today's PyPI, landing on - # pytest 9.1+, where a check that used to be a PytestRemovedIn8Warning (deprecated.py) - # became a hard `Failed: Marks cannot be applied to fixtures.` (fixtures.py) -- verified - # by diffing the pytest 9.0.3 and 9.1.0 wheels directly. common.py's own async_run - # decorator does pytest.mark.asyncio(pytest_asyncio.fixture(func)), exactly the pattern - # that now trips. A PIP_CONSTRAINT keeps pytest below that line without touching - # setup.cfg's own bound. + # upper bound. install_kivy_wheel below resolves that against today's PyPI. pytest<9.1 + # alone isn't enough: 9.0.x still promotes the underlying PytestRemovedIn9Warning + # (common.py's async_run does pytest.mark.asyncio(pytest_asyncio.fixture(func))) to a + # collection ERROR, just with a different message than 9.1's hard `Failed:` -- pytest's + # own pre-removal deprecation escalation, not a bug in this pin. Dropping below the + # whole 8.x/9.0 cycle to pytest<8 avoids both; 7.4.4's _pytest source has neither the + # warning nor the hard-error string at all. pytest-asyncio itself is left unconstrained; + # pip's resolver picks a release compatible with pytest<8. - name: Constrain pytest for the test run run: | - echo 'pytest<9.1' > "${{ runner.temp }}/constraints.txt" + echo 'pytest<8' > "${{ runner.temp }}/constraints.txt" echo "PIP_CONSTRAINT=${{ runner.temp }}/constraints.txt" >> "$GITHUB_ENV" - name: Install Kivy