Skip to content

Commit eba39a0

Browse files
authored
Merge pull request #131 from petercorke/ci/pgraph-version-matrix
ci: test against pgraph 0.6 and latest, require pgraph-python>=0.6.4
2 parents 3ec5bda + 316269f commit eba39a0

2 files changed

Lines changed: 43 additions & 2 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,46 @@ jobs:
4747
MPLBACKEND: Agg
4848
run: python -m pytest --timeout=50 --timeout-method=thread
4949

50+
pgraph-compat:
51+
# BundleAdjust is the only pgraph user and pgraph 1.0 changed API (keyword-only
52+
# graph constructors, UVertex -> Vertex, edges() a list). The main matrix
53+
# installs whatever pip resolves, so run the pgraph-touching tests against
54+
# both the 0.6 series and the newest release explicitly.
55+
name: pgraph compat (${{ matrix.pgraph }})
56+
runs-on: ubuntu-latest
57+
strategy:
58+
fail-fast: false
59+
matrix:
60+
pgraph: ["pgraph-python<1", "pgraph-python"]
61+
62+
steps:
63+
- uses: actions/checkout@v7
64+
65+
- uses: actions/setup-python@v7
66+
with:
67+
python-version: "3.12"
68+
69+
- name: Install libegl
70+
run: sudo apt-get update && sudo apt-get install -y libegl1 libgl1
71+
72+
- name: Install package
73+
run: |
74+
pip install .[dev,tool]
75+
cd packages/mvtb-data && pip install .
76+
77+
- name: Install requested pgraph
78+
run: |
79+
pip install --upgrade "${{ matrix.pgraph }}"
80+
pip show pgraph-python | grep -i '^version'
81+
82+
- name: Run pgraph tests
83+
env:
84+
MPLBACKEND: Agg
85+
run: python -m pytest tests/test_bundleadjust.py --timeout=50 --timeout-method=thread
86+
5087
all-tests-passed:
5188
name: All tests passed
52-
needs: test
89+
needs: [test, pgraph-compat]
5390
runs-on: ubuntu-latest
5491
if: always()
5592
steps:
@@ -59,6 +96,10 @@ jobs:
5996
echo "test matrix did not succeed: ${{ needs.test.result }}"
6097
exit 1
6198
fi
99+
if [ "${{ needs.pgraph-compat.result }}" != "success" ]; then
100+
echo "pgraph compat did not succeed: ${{ needs.pgraph-compat.result }}"
101+
exit 1
102+
fi
62103
63104
codecov:
64105
needs: test

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dependencies = [
4343
"opencv-python>=4.5,<6.0.0",
4444
"opencv-contrib-python>=4.5,<6.0.0",
4545
"spatialmath-python",
46-
"pgraph-python",
46+
"pgraph-python>=0.6.4",
4747
"ansitable",
4848
"mvtb-data",
4949
"requests",

0 commit comments

Comments
 (0)