Skip to content

Commit d5a368a

Browse files
committed
Merge branch 'main' into pure_python_install
2 parents 6c4a434 + 46d19ef commit d5a368a

File tree

86 files changed

+2234
-196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2234
-196
lines changed

.github/workflows/python-package.yml

Lines changed: 59 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,63 @@ jobs:
2121
strategy:
2222
matrix:
2323
os: [ubuntu-latest, windows-latest, macos-latest]
24+
# Unfortunately the CMake test target is OS dependent so we set it as
25+
# a variable here.
26+
include:
27+
- os: ubuntu-latest
28+
OTIO_TEST_TARGET: test
29+
- os: windows-latest
30+
OTIO_TEST_TARGET: RUN_TESTS
31+
- os: macos-latest
32+
OTIO_TEST_TARGET: test
33+
34+
env:
35+
OTIO_BUILD_CONFIG: Release
36+
OTIO_BUILD_DIR: ${{ github.workspace }}/build
37+
OTIO_INSTALL_DIR: ${{ github.workspace }}/install
2438

2539
steps:
26-
- uses: actions/checkout@v2.3.5
40+
- uses: actions/checkout@v3
2741
with:
2842
submodules: 'recursive'
29-
30-
- name: compile c++
43+
- name: Install coverage dependency
44+
if: matrix.os == env.GH_COV_OS && github.actor != env.GH_DEPENDABOT
45+
run: |
46+
sudo apt-get install lcov
47+
- name: Build
48+
run: |
49+
cmake -E make_directory ${{ env.OTIO_BUILD_DIR }}
50+
cd ${{ env.OTIO_BUILD_DIR }}
51+
cmake ${{ github.workspace }} -DCMAKE_INSTALL_PREFIX=${{ env.OTIO_INSTALL_DIR }} -DOTIO_SHARED_LIBS=OFF -DOTIO_CXX_COVERAGE=ON
52+
cmake --build . --config ${{ env.OTIO_BUILD_CONFIG }}
53+
- name: Run tests
54+
run: |
55+
cd ${{ env.OTIO_BUILD_DIR }}
56+
cmake --build . --target ${{ matrix.OTIO_TEST_TARGET }} --config ${{ env.OTIO_BUILD_CONFIG }}
57+
- name: Collect code coverage
58+
if: matrix.os == env.GH_COV_OS && github.actor != env.GH_DEPENDABOT
3159
run: |
32-
mkdir build
33-
mkdir test_otio_inst_dir
34-
cd build
35-
cmake .. -DCMAKE_INSTALL_PREFIX=test_otio_inst_dir
36-
cmake --build . --target install --config release
37-
60+
cd ${{ env.OTIO_BUILD_DIR }}
61+
lcov --capture -b . --directory . --output-file=coverage.info -q
62+
cat coverage.info | sed "s/SF:.*src/SF:src/g" > coverage.filtered.info
63+
lcov --remove coverage.filtered.info '*/usr/*' --output-file=coverage.filtered.info -q
64+
lcov --remove coverage.filtered.info '*/deps/*' --output-file=coverage.filtered.info -q
65+
lcov --remove coverage.filtered.info '*/tests/*' --output-file=coverage.filtered.info -q
66+
lcov --list coverage.filtered.info
67+
# \todo Should the Codecov web pages show the results of the C++ or Python tests?
68+
# - name: Upload coverage to Codecov
69+
# if: matrix.os == env.GH_COV_OS && github.actor != env.GH_DEPENDABOT
70+
# uses: codecov/[email protected]
71+
# with:
72+
# files: ${{ env.OTIO_BUILD_DIR }}/coverage.filtered.info
73+
# flags: unittests
74+
# name: opentimelineio-codecov
75+
# fail_ci_if_error: true
76+
- name: Install
77+
run: |
78+
cd ${{ env.OTIO_BUILD_DIR }}
79+
cmake --build . --target install --config ${{ env.OTIO_BUILD_CONFIG }}
80+
3881
py_build_test:
3982
runs-on: ${{ matrix.os }}
4083
strategy:
@@ -47,11 +90,11 @@ jobs:
4790
OTIO_CXX_BUILD_TMP_DIR: ${{ github.workspace }}/build
4891

4992
steps:
50-
- uses: actions/checkout@v2.3.5
93+
- uses: actions/checkout@v3
5194
with:
5295
submodules: 'recursive'
5396
- name: Set up Python ${{ matrix.python-version }}
54-
uses: actions/setup-python@v2.2.2
97+
uses: actions/setup-python@v3
5598
with:
5699
python-version: ${{ matrix.python-version }}
57100
- name: Install coverage dependency
@@ -80,8 +123,8 @@ jobs:
80123
if: matrix.python-version == env.GH_COV_PY && matrix.os == env.GH_COV_OS && github.actor != env.GH_DEPENDABOT
81124
uses: codecov/[email protected]
82125
with:
83-
flags: unittests
84-
name: opentimelineio-codecov
126+
flags: py-unittests
127+
name: py-opentimelineio-codecov
85128
fail_ci_if_error: true
86129

87130
package_wheels:
@@ -92,7 +135,7 @@ jobs:
92135
os: [ubuntu-latest, windows-latest, macos-latest]
93136
python-build: [cp27*, cp37*, cp38*, cp39*]
94137
steps:
95-
- uses: actions/checkout@v2.3.5
138+
- uses: actions/checkout@v3
96139

97140
# cibuildwheel 1.12.0 gates Python 2.7 wheels builds
98141
# by using two environment variables, DISTUTILS_USE_SDK and MSSdk.
@@ -126,11 +169,11 @@ jobs:
126169
needs: py_build_test
127170
runs-on: ubuntu-latest
128171
steps:
129-
- uses: actions/checkout@v2.3.5
172+
- uses: actions/checkout@v3
130173
with:
131174
submodules: 'recursive'
132175

133-
- uses: actions/setup-python@v2
176+
- uses: actions/setup-python@v3
134177

135178
- name: Install pypa/build
136179
run: python -m pip install build --user

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010
[submodule "src/deps/any"]
1111
path = src/deps/any
1212
url = https://github.com/thelink2012/any.git
13+
[submodule "src/deps/Imath"]
14+
path = src/deps/Imath
15+
url = https://github.com/AcademySoftwareFoundation/Imath

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ set(OTIO_AUTHOR "Contributors to the OpenTimelineIO project")
1515
set(OTIO_AUTHOR_EMAIL "[email protected]")
1616
set(OTIO_LICENSE "Modified Apache 2.0 License")
1717

18+
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "")
19+
1820
project(OpenTimelineIO VERSION ${OTIO_VERSION} LANGUAGES C CXX)
1921

2022
#------------------------------------------------------------------------------
@@ -217,13 +219,23 @@ if (OTIO_AUTOMATIC_SUBMODULES AND NOT DEFINED ENV{TRAVIS})
217219
endif()
218220
endif()
219221

222+
#------------------------------------------------------------------------------
223+
# Setup tests
224+
225+
include(CTest)
226+
set(CTEST_OUTPUT_ON_FAILURE ON)
227+
220228
#------------------------------------------------------------------------------
221229
# Build the dependencies and components
222230

223231
add_subdirectory(src/deps)
224232
add_subdirectory(src/opentime)
225233
add_subdirectory(src/opentimelineio)
226234

235+
if(BUILD_TESTING)
236+
add_subdirectory(tests)
237+
endif()
238+
227239
if(OTIO_PYTHON_INSTALL)
228240
add_subdirectory(src/py-opentimelineio)
229241
endif()

contrib/opentimelineio_contrib/adapters/kdenlive.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@ def read_from_string(input_str):
9292
name=mlt.get('name', 'Kdenlive imported timeline'))
9393

9494
maintractor = mlt.find("tractor[@global_feed='1']")
95+
# global_feed is no longer set in newer kdenlive versions
96+
if maintractor is None:
97+
alltractors = mlt.findall("tractor")
98+
# the last tractor is the main tractor
99+
maintractor = alltractors[-1]
100+
# check all other tractors are used as tracks
101+
for tractor in alltractors[:-1]:
102+
if maintractor.find("track[@producer='%s']" % tractor.attrib['id']) is None:
103+
raise RuntimeError("Can't find main tractor")
104+
95105
for maintrack in maintractor.findall('track'):
96106
if maintrack.get('producer') == 'black_track':
97107
continue

0 commit comments

Comments
 (0)