From 3e039347cf2fe01f36272f369bd738ad681904d6 Mon Sep 17 00:00:00 2001 From: Brian Pugh Date: Sat, 21 Dec 2024 15:40:34 -0500 Subject: [PATCH] fix pyright warning about opencv; exercise opencv code in GA. --- .github/workflows/tests.yaml | 12 +++++++++++- py360convert/utils.py | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 6a62bfa..01f0e31 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -93,7 +93,17 @@ jobs: source ${{ env.ACTIVATE_PYTHON_VENV }} pre-commit run --show-diff-on-failure --color=always --all-files - - name: Run tests + - name: Run tests (standard install) + run: | + source ${{ env.ACTIVATE_PYTHON_VENV }} + python -m pytest + + - name: Install opencv + run: | + source ${{ env.ACTIVATE_PYTHON_VENV }} + pip install opencv-python + + - name: Run tests (with opencv) run: | source ${{ env.ACTIVATE_PYTHON_VENV }} python -m pytest diff --git a/py360convert/utils.py b/py360convert/utils.py index c032ecc..f3101ce 100644 --- a/py360convert/utils.py +++ b/py360convert/utils.py @@ -8,7 +8,7 @@ from scipy.spatial.transform import Rotation try: - import cv2 + import cv2 # pyright: ignore[reportMissingImports] except ImportError: cv2 = None