Skip to content

Commit 5c50858

Browse files
Fix CI issues with python 3.7, readthedocs, outdated tests, and gcov (#1823)
Signed-off-by: Darby Johnston <[email protected]>
1 parent 003ab04 commit 5c50858

File tree

5 files changed

+21
-19
lines changed

5 files changed

+21
-19
lines changed

.github/workflows/python-package.yml

+4-8
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,8 @@ jobs:
6565
if: matrix.os == env.GH_COV_OS && github.actor != env.GH_DEPENDABOT
6666
run: |
6767
cd ${{ env.OTIO_BUILD_DIR }}
68-
lcov --capture -b . --directory . --output-file=coverage.info -q
68+
lcov --rc lcov_branch_coverage=1 --rc no_exception_branch=1 --ignore-errors mismatch --capture -b . --directory . --output-file=coverage.info -q
6969
cat coverage.info | sed "s/SF:.*src/SF:src/g" > coverage.filtered.info
70-
lcov --remove coverage.filtered.info '*/usr/*' --output-file=coverage.filtered.info -q
71-
lcov --remove coverage.filtered.info '*/deps/*' --output-file=coverage.filtered.info -q
7270
lcov --remove coverage.filtered.info '*/tests/*' --output-file=coverage.filtered.info -q
7371
lcov --list coverage.filtered.info
7472
# \todo Should the Codecov web pages show the results of the C++ or Python tests?
@@ -98,6 +96,7 @@ jobs:
9896
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
9997
include:
10098
- { os: ubuntu-latest, shell: bash }
99+
- { os: ubuntu-22.04, shell: bash, python-version: 3.7 }
101100
- { os: macos-latest, shell: bash }
102101
- { os: macos-13, shell: bash }
103102
- { os: windows-latest, shell: pwsh }
@@ -106,6 +105,7 @@ jobs:
106105
- { os: macos-latest, python-version: 3.7 }
107106
- { os: macos-latest, python-version: 3.8 }
108107
- { os: macos-latest, python-version: 3.9 }
108+
- { os: ubuntu-latest, python-version: 3.7 }
109109

110110
defaults:
111111
run:
@@ -131,9 +131,6 @@ jobs:
131131
mingw-w64-x86_64-cmake
132132
make
133133
git
134-
- name: Ensure MSYS2 pip is updated
135-
if: matrix.python-version == 'mingw64'
136-
run: curl -sS https://bootstrap.pypa.io/get-pip.py | python
137134
- name: Set up Python ${{ matrix.python-version }}
138135
if: matrix.python-version != 'mingw64'
139136
uses: actions/[email protected]
@@ -151,8 +148,7 @@ jobs:
151148
run: make ci-prebuild
152149
- name: Build and Install
153150
run: |
154-
# compile and install into virtualenv/virtual machine (verbosely)
155-
pip install .[dev] -v
151+
pip install .[dev] -v --break-system-packages
156152
- name: Run tests w/ python coverage
157153
run: make ci-postbuild
158154
# (only on ubuntu/pyhton3.7)

.readthedocs.yml

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# required by RTD
22
version: 2
33

4+
sphinx:
5+
# Path to your Sphinx configuration file.
6+
configuration: docs/conf.py
7+
48
build:
59
os: "ubuntu-20.04"
610
tools:

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
150150
set(CMAKE_CXX_EXTENSIONS OFF)
151151

152152
if(OTIO_CXX_COVERAGE AND NOT MSVC)
153-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
153+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-update=atomic -fprofile-exclude-files='/usr/*;src/deps/*'")
154154
# this causes cmake to produce file.gcno instead of file.cpp.gcno
155155
set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
156156
message(STATUS "Building C++ with Coverage: ON")

Makefile

+2-6
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,10 @@ ifndef OTIO_CXX_BUILD_TMP_DIR
9292
C++ coverage will not work, because intermediate build products will \
9393
not be found.)
9494
endif
95-
lcov --rc lcov_branch_coverage=1 --capture -b . --directory ${OTIO_CXX_BUILD_TMP_DIR} \
95+
lcov --rc lcov_branch_coverage=1 --rc no_exception_branch=1 --ignore-errors mismatch --capture -b . --directory ${OTIO_CXX_BUILD_TMP_DIR} \
9696
--output-file=${OTIO_CXX_BUILD_TMP_DIR}/coverage.info -q
97-
cat ${OTIO_CXX_BUILD_TMP_DIR}/coverage.info | sed "s/SF:.*src/SF:src/g"\
97+
cat ${OTIO_CXX_BUILD_TMP_DIR}/coverage.info | sed "s/SF:.*src/SF:src/g" \
9898
> ${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info
99-
lcov --rc lcov_branch_coverage=1 --remove ${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info '/usr/*' \
100-
--output-file=${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info -q
101-
lcov --rc lcov_branch_coverage=1 --remove ${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info '*/deps/*' \
102-
--output-file=${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info -q
10399
rm ${OTIO_CXX_BUILD_TMP_DIR}/coverage.info
104100
lcov --list ${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info
105101

tests/test_clip.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,18 @@ def test_str(self):
6363

6464
self.assertMultiLineEqual(
6565
str(cl),
66-
'Clip("test_clip", MissingReference(\'\', None, None, {}), None, {})'
66+
'Clip("test_clip", '
67+
'MissingReference(\'\', None, None, {}), None, {}, [], [])'
6768
)
6869
self.assertMultiLineEqual(
6970
repr(cl),
7071
'otio.schema.Clip('
7172
"name='test_clip', "
7273
'media_reference={}, '
7374
'source_range=None, '
74-
'metadata={{}}'
75+
'metadata={{}}, '
76+
'effects=[], '
77+
'markers=[]'
7578
')'.format(
7679
repr(cl.media_reference)
7780
)
@@ -87,7 +90,8 @@ def test_str_with_filepath(self):
8790
self.assertMultiLineEqual(
8891
str(cl),
8992
'Clip('
90-
'"test_clip", ExternalReference("/var/tmp/foo.mov"), None, {}'
93+
'"test_clip", '
94+
'ExternalReference("/var/tmp/foo.mov"), None, {}, [], []'
9195
')'
9296
)
9397
self.assertMultiLineEqual(
@@ -98,7 +102,9 @@ def test_str_with_filepath(self):
98102
"target_url='/var/tmp/foo.mov'"
99103
"), "
100104
'source_range=None, '
101-
'metadata={}'
105+
'metadata={}, '
106+
'effects=[], '
107+
'markers=[]'
102108
')'
103109
)
104110

0 commit comments

Comments
 (0)