diff --git a/.github/workflows/build-pydevd.yml b/.github/workflows/build-pydevd.yml new file mode 100644 index 000000000..e42b78548 --- /dev/null +++ b/.github/workflows/build-pydevd.yml @@ -0,0 +1,108 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on: https://github.com/fabioz/PyDev.Debugger/blob/pydev_debugger_3_5_0/.github/workflows/pydevd-release-manylinux.yml +name: Build pydevd wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'pydevd version (git tag pydev_debugger_, e.g. 3.5.0)' + required: true + default: '3.5.0' + pull_request: + paths: + - '.github/workflows/build-pydevd.yml' + +concurrency: + group: ${{ github.workflow }}-${{ inputs.version || '3.5.0' }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + PYDEVD_VERSION: ${{ inputs.version || '3.5.0' }} + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + + build_wheels: + needs: [setup] + name: Build pydevd ${{ inputs.version || '3.5.0' }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 90 + strategy: + fail-fast: false + matrix: + # No cp314t: upstream ships no cp3xxt wheel for pydevd, its own test + # matrix carries no free-threaded job, and setup.py's classifiers don't + # mention free threading (same signal debugpy used for its own pydevd + # build, CLAUDE.md gotcha 33). + python: + - "cp312" + - "cp313" + - "cp314" + + steps: + # Upstream tags releases as `pydev_debugger_`. + - name: Resolve upstream tag + run: echo "PYDEVD_TAG=pydev_debugger_${PYDEVD_VERSION//./_}" >> "$GITHUB_ENV" + + - name: Checkout pydevd ${{ env.PYDEVD_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: fabioz/PyDev.Debugger + ref: ${{ env.PYDEVD_TAG }} + 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 enforces PEP-484 annotations more strictly and rejects + # _pydevd_sys_monitoring_cython.pyx's repeated `func_code_info: FuncCodeInfo = ...` + # as a redeclaration (CLAUDE.md gotcha 175). + CIBW_BEFORE_ALL: echo 'Cython<3.3.0' > /cython-constraint.txt + CIBW_ENVIRONMENT: >- + PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + PIP_CONSTRAINT=/cython-constraint.txt + CIBW_TEST_SOURCES: conftest.py tests_python pytest.ini + # untangle parses the debuggee's XML protocol messages in debugger_unittest.py. + CIBW_TEST_REQUIRES: pytest untangle + CIBW_TEST_ENVIRONMENT: PYDEVD_USE_CYTHON=YES + CIBW_TEST_COMMAND: >- + python -c "import _pydevd_bundle.pydevd_cython as c; + import _pydevd_sys_monitoring._pydevd_sys_monitoring_cython as m; + assert c.__file__.endswith('.so'), c.__file__; + assert m.__file__.endswith('.so'), m.__file__" && + python -m pytest {package}/tests_python/test_frame_eval_and_tracing.py + {package}/tests_python/test_frame_evaluator.py + {package}/tests_python/test_sys_monitoring.py + {package}/tests_python/test_tracing_gotchas.py + {package}/tests_python/test_tracing_on_top_level.py + {package}/tests_python/test_bytecode_manipulation.py + {package}/tests_python/test_safe_repr.py + {package}/tests_python/test_additional_thread_info.py + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: pydevd-${{ env.PYDEVD_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish pydevd ${{ inputs.version || '3.5.0' }} + needs: [setup, build_wheels] + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + with: + artifact-pattern: pydevd-${{ inputs.version || '3.5.0' }}-*-manylinux_riscv64