Skip to content

Commit

Permalink
[DEBUG] video extension not available in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeier committed Dec 11, 2023
1 parent e12d200 commit 2bd50c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/scripts/unittest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ echo '::group::Install testing utilities'
pip install --progress-bar=off pytest pytest-mock pytest-cov expecttest
echo '::endgroup::'

export SHOULD_HAVE_VIDEO_EXTENSION=1
python test/smoke_test.py
pytest --junit-xml="${RUNNER_TEST_RESULTS_DIR}/test-results.xml" -v --durations=25
#pytest --junit-xml="${RUNNER_TEST_RESULTS_DIR}/test-results.xml" -v --durations=25
6 changes: 5 additions & 1 deletion torchvision/io/_video_opt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import math
import os
import warnings
from fractions import Fraction
from typing import Dict, List, Optional, Tuple, Union
Expand All @@ -11,9 +12,12 @@
try:
_load_library("video_reader")
_HAS_VIDEO_OPT = True
except (ImportError, OSError):
except (ImportError, OSError) as e:
_HAS_VIDEO_OPT = False

if "SHOULD_HAVE_VIDEO_EXTENSION" in os.environ:
warnings.warn(f"Failed to load video Python extension: '{e}'")

default_timebase = Fraction(0, 1)


Expand Down

0 comments on commit 2bd50c4

Please sign in to comment.