Skip to content

Commit

Permalink
Fix CI issues with python 3.7, readthedocs, outdated tests, and gcov (#…
Browse files Browse the repository at this point in the history
…1823)

Signed-off-by: Darby Johnston <[email protected]>
  • Loading branch information
darbyjohnston authored Jan 21, 2025
1 parent 003ab04 commit 5c50858
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ jobs:
if: matrix.os == env.GH_COV_OS && github.actor != env.GH_DEPENDABOT
run: |
cd ${{ env.OTIO_BUILD_DIR }}
lcov --capture -b . --directory . --output-file=coverage.info -q
lcov --rc lcov_branch_coverage=1 --rc no_exception_branch=1 --ignore-errors mismatch --capture -b . --directory . --output-file=coverage.info -q
cat coverage.info | sed "s/SF:.*src/SF:src/g" > coverage.filtered.info
lcov --remove coverage.filtered.info '*/usr/*' --output-file=coverage.filtered.info -q
lcov --remove coverage.filtered.info '*/deps/*' --output-file=coverage.filtered.info -q
lcov --remove coverage.filtered.info '*/tests/*' --output-file=coverage.filtered.info -q
lcov --list coverage.filtered.info
# \todo Should the Codecov web pages show the results of the C++ or Python tests?
Expand Down Expand Up @@ -98,6 +96,7 @@ jobs:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
include:
- { os: ubuntu-latest, shell: bash }
- { os: ubuntu-22.04, shell: bash, python-version: 3.7 }
- { os: macos-latest, shell: bash }
- { os: macos-13, shell: bash }
- { os: windows-latest, shell: pwsh }
Expand All @@ -106,6 +105,7 @@ jobs:
- { os: macos-latest, python-version: 3.7 }
- { os: macos-latest, python-version: 3.8 }
- { os: macos-latest, python-version: 3.9 }
- { os: ubuntu-latest, python-version: 3.7 }

defaults:
run:
Expand All @@ -131,9 +131,6 @@ jobs:
mingw-w64-x86_64-cmake
make
git
- name: Ensure MSYS2 pip is updated
if: matrix.python-version == 'mingw64'
run: curl -sS https://bootstrap.pypa.io/get-pip.py | python
- name: Set up Python ${{ matrix.python-version }}
if: matrix.python-version != 'mingw64'
uses: actions/[email protected]
Expand All @@ -151,8 +148,7 @@ jobs:
run: make ci-prebuild
- name: Build and Install
run: |
# compile and install into virtualenv/virtual machine (verbosely)
pip install .[dev] -v
pip install .[dev] -v --break-system-packages
- name: Run tests w/ python coverage
run: make ci-postbuild
# (only on ubuntu/pyhton3.7)
Expand Down
4 changes: 4 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# required by RTD
version: 2

sphinx:
# Path to your Sphinx configuration file.
configuration: docs/conf.py

build:
os: "ubuntu-20.04"
tools:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(OTIO_CXX_COVERAGE AND NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-update=atomic -fprofile-exclude-files='/usr/*;src/deps/*'")
# this causes cmake to produce file.gcno instead of file.cpp.gcno
set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
message(STATUS "Building C++ with Coverage: ON")
Expand Down
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,10 @@ ifndef OTIO_CXX_BUILD_TMP_DIR
C++ coverage will not work, because intermediate build products will \
not be found.)
endif
lcov --rc lcov_branch_coverage=1 --capture -b . --directory ${OTIO_CXX_BUILD_TMP_DIR} \
lcov --rc lcov_branch_coverage=1 --rc no_exception_branch=1 --ignore-errors mismatch --capture -b . --directory ${OTIO_CXX_BUILD_TMP_DIR} \
--output-file=${OTIO_CXX_BUILD_TMP_DIR}/coverage.info -q
cat ${OTIO_CXX_BUILD_TMP_DIR}/coverage.info | sed "s/SF:.*src/SF:src/g"\
cat ${OTIO_CXX_BUILD_TMP_DIR}/coverage.info | sed "s/SF:.*src/SF:src/g" \
> ${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info
lcov --rc lcov_branch_coverage=1 --remove ${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info '/usr/*' \
--output-file=${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info -q
lcov --rc lcov_branch_coverage=1 --remove ${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info '*/deps/*' \
--output-file=${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info -q
rm ${OTIO_CXX_BUILD_TMP_DIR}/coverage.info
lcov --list ${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info

Expand Down
14 changes: 10 additions & 4 deletions tests/test_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,18 @@ def test_str(self):

self.assertMultiLineEqual(
str(cl),
'Clip("test_clip", MissingReference(\'\', None, None, {}), None, {})'
'Clip("test_clip", '
'MissingReference(\'\', None, None, {}), None, {}, [], [])'
)
self.assertMultiLineEqual(
repr(cl),
'otio.schema.Clip('
"name='test_clip', "
'media_reference={}, '
'source_range=None, '
'metadata={{}}'
'metadata={{}}, '
'effects=[], '
'markers=[]'
')'.format(
repr(cl.media_reference)
)
Expand All @@ -87,7 +90,8 @@ def test_str_with_filepath(self):
self.assertMultiLineEqual(
str(cl),
'Clip('
'"test_clip", ExternalReference("/var/tmp/foo.mov"), None, {}'
'"test_clip", '
'ExternalReference("/var/tmp/foo.mov"), None, {}, [], []'
')'
)
self.assertMultiLineEqual(
Expand All @@ -98,7 +102,9 @@ def test_str_with_filepath(self):
"target_url='/var/tmp/foo.mov'"
"), "
'source_range=None, '
'metadata={}'
'metadata={}, '
'effects=[], '
'markers=[]'
')'
)

Expand Down

0 comments on commit 5c50858

Please sign in to comment.