From e37627caab0f6a4e71bccda7bc9ac8ce5f0c11ef Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Thu, 3 Sep 2026 23:27:45 +0200 Subject: [PATCH 1/2] dependency-injector: add build-dependency-injector.yml for riscv64 wheels Cython C-extension build via cibuildwheel, mirroring upstream's own publishing.yml. Two jobs: an abi3 build (cp310 floor, matching setup.py's py_limited_api="cp310", oldest-first per gotcha 96) covering cp310-cp314, and a free-threaded build for cp314t (setup.py drops the limited API under Py_GIL_DISABLED, same shape as build-pycryptodomex.yml) since upstream's own CIBW_SKIP excludes it from their release. Tests mirror upstream's tox testenv dependency set and run the full tests/unit/ suite. --- .../workflows/build-dependency-injector.yml | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 .github/workflows/build-dependency-injector.yml diff --git a/.github/workflows/build-dependency-injector.yml b/.github/workflows/build-dependency-injector.yml new file mode 100644 index 000000000..f24649238 --- /dev/null +++ b/.github/workflows/build-dependency-injector.yml @@ -0,0 +1,147 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on: https://github.com/ets-labs/python-dependency-injector/blob/4.49.1/.github/workflows/publishing.yml +name: Build dependency-injector wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'dependency-injector version to build (git tag, e.g. 4.49.1)' + required: true + default: '4.49.1' + pull_request: + paths: + - '.github/workflows/build-dependency-injector.yml' + +concurrency: + group: ${{ github.workflow }}-${{ inputs.version || '4.49.1' }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + DEPENDENCY_INJECTOR_VERSION: ${{ inputs.version || '4.49.1' }} + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + # Mirrors upstream's tox testenv deps (tox.ini [testenv]). + TEST_REQUIRES: >- + pytest pytest-asyncio httpx fastapi flask aiohttp numpy scipy boto3 + mypy_boto3_s3 pydantic-settings werkzeug fast-depends "cython>=3,<4" setuptools + TEST_COMMAND: python -m pytest tests/unit + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + + build_abi3: + needs: [setup] + name: Build dependency-injector ${{ inputs.version || '4.49.1' }} cp310-abi3-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 90 + + steps: + - name: Checkout dependency-injector ${{ env.DEPENDENCY_INJECTOR_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: ets-labs/python-dependency-injector + ref: ${{ env.DEPENDENCY_INJECTOR_VERSION }} + persist-credentials: false + + - name: Build wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + output-dir: wheelhouse/ + env: + CIBW_ARCHS: riscv64 + # cp310 first, matching setup.py's py_limited_api="cp310" floor (gotcha 96): + # building the abi3 wheel on a newer interpreter can silently break older + # ones despite the tag. The later entries build nothing; they re-test it. + CIBW_BUILD: >- + cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 + cp313-manylinux_riscv64 cp314-manylinux_riscv64 + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + CIBW_ENVIRONMENT: >- + PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + DEPENDENCY_INJECTOR_LIMITED_API=1 + CIBW_TEST_REQUIRES: ${{ env.TEST_REQUIRES }} + CIBW_TEST_EXTRAS: yaml + CIBW_TEST_SOURCES: tests pyproject.toml + CIBW_TEST_COMMAND: ${{ env.TEST_COMMAND }} + + - name: Check the Cython extensions made it into the wheel + run: | + python3 - wheelhouse/*.whl <<'EOF' + import sys, zipfile, posixpath + expected = { + "dependency_injector.containers", + "dependency_injector.providers", + "dependency_injector._cwiring", + } + for whl in sys.argv[1:]: + found = set() + for n in zipfile.ZipFile(whl).namelist(): + if not n.endswith(".so"): + continue + pkg, base = posixpath.split(n) + # Extension filenames carry an ABI tag (e.g. containers.abi3.so). + found.add(f"{pkg.replace('/', '.')}.{base.split('.', 1)[0]}") + assert expected <= found, (whl, found) + print(whl, "ok") + EOF + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: dependency-injector-${{ env.DEPENDENCY_INJECTOR_VERSION }}-cp310-abi3-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + # Free-threaded builds get no abi3 wheel: setup.py drops py_limited_api under + # Py_GIL_DISABLED, same shape as build-pycryptodomex.yml. Upstream itself skips + # cp3??t-* in CIBW_SKIP, so this has no upstream wheel to mirror. + build_freethreaded: + needs: [setup] + name: Build dependency-injector ${{ inputs.version || '4.49.1' }} cp314t-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 90 + + steps: + - name: Checkout dependency-injector ${{ env.DEPENDENCY_INJECTOR_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: ets-labs/python-dependency-injector + ref: ${{ env.DEPENDENCY_INJECTOR_VERSION }} + persist-credentials: false + + - name: Build wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + output-dir: wheelhouse/ + env: + CIBW_ARCHS: riscv64 + CIBW_BUILD: cp314t-manylinux_riscv64 + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + CIBW_ENVIRONMENT: >- + PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + DEPENDENCY_INJECTOR_LIMITED_API=1 + CIBW_TEST_REQUIRES: ${{ env.TEST_REQUIRES }} + CIBW_TEST_EXTRAS: yaml + CIBW_TEST_SOURCES: tests pyproject.toml + CIBW_TEST_COMMAND: ${{ env.TEST_COMMAND }} + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: dependency-injector-${{ env.DEPENDENCY_INJECTOR_VERSION }}-cp314t-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish dependency-injector ${{ inputs.version || '4.49.1' }} + needs: [setup, build_abi3, build_freethreaded] + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + with: + artifact-pattern: dependency-injector-${{ inputs.version || '4.49.1' }}-*-manylinux_riscv64 From 4348b01b2cc824b5cb4a7b3390cd45ca39322684 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Fri, 4 Sep 2026 08:14:56 +0200 Subject: [PATCH 2/2] dependency-injector: pin numpy/scipy to binary-only in the abi3 test env cp310/cp311 lag our registry's newest numpy/scipy: the latest PyPI release still supporting Python 3.10 (scipy 1.15.3, numpy 2.2.6) has no riscv64 wheel published here, so unconstrained pip tried to build scipy from source and failed on a missing OpenBLAS. PIP_ONLY_BINARY=numpy,scipy in CIBW_TEST_ENVIRONMENT makes pip back off to the newest version we do publish for each interpreter (gotcha 67/84/172). --- .github/workflows/build-dependency-injector.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-dependency-injector.yml b/.github/workflows/build-dependency-injector.yml index f24649238..ac523f440 100644 --- a/.github/workflows/build-dependency-injector.yml +++ b/.github/workflows/build-dependency-injector.yml @@ -65,6 +65,10 @@ jobs: CIBW_ENVIRONMENT: >- PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ DEPENDENCY_INJECTOR_LIMITED_API=1 + # cp310/cp311 lag our registry's newest numpy/scipy (gotcha 67/84): the + # newest PyPI release still supporting 3.10 has no riscv64 wheel here, so + # unconstrained pip tries to build it from source and fails on missing OpenBLAS. + CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,scipy CIBW_TEST_REQUIRES: ${{ env.TEST_REQUIRES }} CIBW_TEST_EXTRAS: yaml CIBW_TEST_SOURCES: tests pyproject.toml