From b859069aa2a8eb3247c6282f22d8f08c59dba34b Mon Sep 17 00:00:00 2001 From: Peter Corke Date: Mon, 3 Aug 2026 10:29:22 +1000 Subject: [PATCH] ci: normalize to actions/setup-python + pip, matching sibling toolboxes RTB, bdsim, and SMTB all use actions/setup-python + pip install .[dev]; MVTB was the only one still on mamba-org/setup-micromamba with a hand-maintained conda create-args package list. That split meant pyproject.toml's opencv-python<5.0.0 / opencv-contrib-python<5.0.0 pins were never actually exercised by CI (pip install .[dev] --no-deps --no-build-isolation skipped dependency resolution entirely), which is how CI silently started testing against opencv 5.0.0 when conda-forge's unpinned opencv package resolved there. Drop --no-deps so pip's resolver actually enforces pyproject.toml's pins, add pytest-timeout/pytest-xvfb to the dev extra (previously only present in the conda create-args list), and install the tool extra so tests/test_bin.py's IPython/pygments-dependent mvtbtool coverage still runs. Swap the conda-forge libegl install for the apt equivalent on Linux. Verified with a real pip install into an isolated venv: resolves to opencv-contrib-python 4.14.0.94 (honoring the <5.0.0 pin for real), full test suite passes (771 passed, 94 skipped). Fixes #43 Co-Authored-By: Claude Sonnet 5 --- .github/workflows/ci.yml | 67 ++++++++-------------------------------- pyproject.toml | 2 +- 2 files changed, 14 insertions(+), 55 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 527938dd..7a5226b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,44 +19,23 @@ jobs: steps: - uses: actions/checkout@v7 - - uses: mamba-org/setup-micromamba@v2 + - uses: actions/setup-python@v6 with: - init-shell: >- - bash - powershell - environment-name: myenv - create-args: >- - python=${{ matrix.python-version }} - numpy - pip - pytest - pytest-timeout - pytest-xvfb - matplotlib-base - setuptools - opencv<5 - scipy - spatialmath-python - ansitable - wcwidth - tqdm - hatchling - ipython - pygments + python-version: ${{ matrix.python-version }} - name: Install libegl (Linux) if: runner.os == 'Linux' - run: micromamba install -y -n myenv -c conda-forge libegl + run: sudo apt-get update && sudo apt-get install -y libegl1 libgl1 - name: Install package run: | - micromamba run -n myenv pip install .[dev] --no-deps --no-build-isolation - cd packages/mvtb-data && micromamba run -n myenv pip install . --no-deps --no-build-isolation + pip install .[dev,tool] + cd packages/mvtb-data && pip install . - name: Run tests env: MPLBACKEND: Agg - run: micromamba run -n myenv python -m pytest --timeout=50 --timeout-method=thread + run: python -m pytest --timeout=50 --timeout-method=thread all-tests-passed: name: All tests passed @@ -79,44 +58,24 @@ jobs: steps: - uses: actions/checkout@v7 - - uses: mamba-org/setup-micromamba@v2 + - uses: actions/setup-python@v6 with: - init-shell: bash - environment-name: myenv - create-args: >- - python=3.13 - numpy - pip - coverage - pytest - pytest-timeout - pytest-xvfb - matplotlib-base - setuptools - opencv<5 - scipy - spatialmath-python - ansitable - wcwidth - tqdm - hatchling - ipython - pygments + python-version: "3.13" - name: Install libegl - run: micromamba install -y -n myenv -c conda-forge libegl + run: sudo apt-get update && sudo apt-get install -y libegl1 libgl1 - name: Install package run: | - micromamba run -n myenv pip install .[dev] --no-deps --no-build-isolation - cd packages/mvtb-data && micromamba run -n myenv pip install . --no-deps --no-build-isolation + pip install .[dev,tool] + cd packages/mvtb-data && pip install . - name: Run coverage env: MPLBACKEND: Agg run: | - micromamba run -n myenv coverage run --source=machinevisiontoolbox --omit="src/machinevisiontoolbox/blocks/*,src/machinevision/blocks/*" -m pytest --timeout=50 - micromamba run -n myenv coverage xml + coverage run --source=machinevisiontoolbox --omit="src/machinevisiontoolbox/blocks/*,src/machinevision/blocks/*" -m pytest --timeout=50 + coverage xml - name: Upload to Codecov uses: codecov/codecov-action@v7 diff --git a/pyproject.toml b/pyproject.toml index cd6582b0..cbf31080 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,7 +67,7 @@ dependencies = [ # ocr - OCR support via pytesseract # tool - dependencies for the mvtbtool interactive shell -dev = ["pytest", "coverage", "ruff", "nbmake"] +dev = ["pytest", "pytest-timeout", "pytest-xvfb", "coverage", "ruff", "nbmake"] ros = ["rosbags", "roslibpy", "websockets"]