From eda983e90c6fd5d898848d6e502130f25b9cb207 Mon Sep 17 00:00:00 2001 From: Peter Corke Date: Tue, 13 Oct 2026 11:07:17 +1000 Subject: [PATCH] ci: test against pgraph 0.6 and latest, require pgraph-python>=0.6.4 pgraph 1.0 changed API and BundleAdjust is its only user here, but CI installed whatever pip resolved. Add a pgraph-compat job running the pgraph tests against pgraph-python<1 and the newest release, and make it part of the 'All tests passed' gate. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/ci.yml | 43 +++++++++++++++++++++++++++++++++++++++- pyproject.toml | 2 +- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d01fd99..1769d2eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,9 +47,46 @@ jobs: MPLBACKEND: Agg run: python -m pytest --timeout=50 --timeout-method=thread + pgraph-compat: + # BundleAdjust is the only pgraph user and pgraph 1.0 changed API (keyword-only + # graph constructors, UVertex -> Vertex, edges() a list). The main matrix + # installs whatever pip resolves, so run the pgraph-touching tests against + # both the 0.6 series and the newest release explicitly. + name: pgraph compat (${{ matrix.pgraph }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + pgraph: ["pgraph-python<1", "pgraph-python"] + + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-python@v7 + with: + python-version: "3.12" + + - name: Install libegl + run: sudo apt-get update && sudo apt-get install -y libegl1 libgl1 + + - name: Install package + run: | + pip install .[dev,tool] + cd packages/mvtb-data && pip install . + + - name: Install requested pgraph + run: | + pip install --upgrade "${{ matrix.pgraph }}" + pip show pgraph-python | grep -i '^version' + + - name: Run pgraph tests + env: + MPLBACKEND: Agg + run: python -m pytest tests/test_bundleadjust.py --timeout=50 --timeout-method=thread + all-tests-passed: name: All tests passed - needs: test + needs: [test, pgraph-compat] runs-on: ubuntu-latest if: always() steps: @@ -59,6 +96,10 @@ jobs: echo "test matrix did not succeed: ${{ needs.test.result }}" exit 1 fi + if [ "${{ needs.pgraph-compat.result }}" != "success" ]; then + echo "pgraph compat did not succeed: ${{ needs.pgraph-compat.result }}" + exit 1 + fi codecov: needs: test diff --git a/pyproject.toml b/pyproject.toml index 6a63b3a8..b094f199 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ dependencies = [ "opencv-python>=4.5,<6.0.0", "opencv-contrib-python>=4.5,<6.0.0", "spatialmath-python", - "pgraph-python", + "pgraph-python>=0.6.4", "ansitable", "mvtb-data", "requests",