Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e551029
add windows and mac builds to ci
ssteinbach Jan 21, 2021
29686e3
fall back to mac 10.15
ssteinbach Jan 21, 2021
1a839ea
split lcov target out from the ci-postbuild target
ssteinbach Feb 12, 2021
b0e560d
Specify which build does C++ coverage w/ lcov
ssteinbach Feb 12, 2021
b36754f
use == syntax instead of contains
ssteinbach Feb 12, 2021
dd74941
move the env config out to the top level
ssteinbach Feb 12, 2021
0468291
Skip autogen tests on windows (slashes)
ssteinbach Feb 12, 2021
df626f8
sanitize paths when writing autogen docs
ssteinbach Feb 13, 2021
7247c1e
try escaping the slash in the replacement
ssteinbach Feb 13, 2021
e91e65e
manifest paths need same treatment
ssteinbach Feb 13, 2021
8cd7001
switch to tempfile.TemporaryDirectory
ssteinbach Feb 17, 2021
644ec3e
another conversion to TemporaryDirectory
ssteinbach Feb 17, 2021
2c0714f
more tempfile cleanup
ssteinbach Feb 17, 2021
072a5c0
whoops missed import
ssteinbach Feb 17, 2021
bc0b554
testing if this is specific to the generators xml
ssteinbach Feb 18, 2021
29c8012
only remove windows slashes from sanitized paths
ssteinbach Feb 18, 2021
dfc66bd
only run windows ci while I iterate
ssteinbach Feb 18, 2021
eeb94fb
run the broken test
ssteinbach Feb 18, 2021
e2a6ea0
remove BOM from example xml file
ssteinbach Feb 18, 2021
85c958c
replace more unit test tempfile handling to be more windows compatible
ssteinbach Feb 18, 2021
bc66af1
only run XGES unit tests on linux
ssteinbach Feb 18, 2021
6ebee23
turning MacOS and Linux builds back on.
ssteinbach Feb 18, 2021
215de62
Also disable xges for python < 3.
ssteinbach Feb 22, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

name: OpenTimelineIO

# for configuring which build will be a C++ coverage build / coverage report
env:
GH_COV_PY: 3.7
GH_COV_OS: ubuntu-latest

on:
push:
branches: [ master ]
Expand All @@ -11,16 +16,16 @@ on:

jobs:
build:

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [2.7, 3.7, 3.8]

env:
OTIO_CXX_COVERAGE_BUILD: ON
OTIO_CXX_BUILD_TMP_DIR: ${{ github.workspace }}/build

steps:
- uses: actions/checkout@v2
with:
Expand All @@ -29,19 +34,27 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install build dependencies
- name: Install coverage dependency
if: matrix.python-version == env.GH_COV_PY && matrix.os == env.GH_COV_OS
run: |
sudo apt-get install lcov
- name: Install python build dependencies
run: |
python -m pip install --upgrade pip setuptools wheel flake8>=3.5 check-manifest
- name: Run check-manifest and lint check
run: make ci-prebuild
- name: Build and Install
run: |
# compile and install into virtualenv/virtual machine (verbosely)
pip install .[dev] -v
- name: Run tests and generate coverage report
- name: Run tests w/ python coverage
run: make ci-postbuild
# (only on ubuntu/pyhton3.7)
- name: Generate C++ coverage report
if: matrix.python-version == env.GH_COV_PY && matrix.os == env.GH_COV_OS
run: make lcov
- name: Upload coverage to Codecov
if: matrix.python-version == env.GH_COV_PY && matrix.os == env.GH_COV_OS
uses: codecov/codecov-action@v1
with:
flags: unittests
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ test-contrib: python-version
# CI
###################################
ci-prebuild: manifest lint
ci-postbuild: coverage lcov
ci-postbuild: coverage
###################################

python-version:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,19 @@
#

import os
import tempfile
import unittest

import opentimelineio as otio


# handle python2 vs python3 difference
try:
from tempfile import TemporaryDirectory # noqa: F401
import tempfile
except ImportError:
# XXX: python2.7 only
from backports import tempfile

# Reference data
SAMPLE_DATA_DIR = os.path.join(os.path.dirname(__file__), "sample_data")
HLS_EXAMPLE_PATH = os.path.join(SAMPLE_DATA_DIR, "v1_prog_index.m3u8")
Expand Down Expand Up @@ -162,13 +169,15 @@ def test_media_pl_from_mem(self):
track.append(segment1)

# Write out and validate the playlist
media_pl_tmp_path = tempfile.mkstemp(suffix=".m3u8", text=True)[1]
otio.adapters.write_to_file(t, media_pl_tmp_path)

with open(media_pl_tmp_path) as f:
pl_string = f.read()
with tempfile.TemporaryDirectory() as temp_dir:
media_pl_tmp_path = os.path.join(
temp_dir,
"test_media_pl_from_mem.m3u8"
)
otio.adapters.write_to_file(t, media_pl_tmp_path)

os.remove(media_pl_tmp_path)
with open(media_pl_tmp_path) as f:
pl_string = f.read()

# Compare against the reference value
self.assertEqual(pl_string, MEM_PLAYLIST_REF_VALUE)
Expand Down Expand Up @@ -243,21 +252,22 @@ def test_media_roundtrip(self):
self._validate_sample_playlist(timeline)

# Write out and validate both playlists have the same lines
media_pl_tmp_path = tempfile.mkstemp(suffix=".m3u8", text=True)[1]
otio.adapters.write_to_file(timeline, media_pl_tmp_path)

# Read in both playlists
with open(hls_path) as f:
reference_lines = f.readlines()
with tempfile.TemporaryDirectory() as temp_dir:
media_pl_tmp_path = os.path.join(
temp_dir,
"test_media_roundtrip.m3u8"
)
otio.adapters.write_to_file(timeline, media_pl_tmp_path)

with open(media_pl_tmp_path) as f:
adapter_out_lines = f.readlines()
# Read in both playlists
with open(hls_path) as f:
reference_lines = f.readlines()

# Using otio as well
in_timeline = otio.adapters.read_from_file(media_pl_tmp_path)
with open(media_pl_tmp_path) as f:
adapter_out_lines = f.readlines()

# Remove the temp out file
os.remove(media_pl_tmp_path)
# Using otio as well
in_timeline = otio.adapters.read_from_file(media_pl_tmp_path)

# Strip newline chars
reference_lines = [line.strip('\n') for line in reference_lines]
Expand Down Expand Up @@ -287,12 +297,15 @@ def test_media_segment_size(self):
timeline_streaming_md['max_segment_duration'] = seg_max_duration

# Write out the playlist
media_pl_tmp_path = tempfile.mkstemp(suffix=".m3u8", text=True)[1]
otio.adapters.write_to_file(timeline, media_pl_tmp_path)
with tempfile.TemporaryDirectory() as temp_dir:
media_pl_tmp_path = os.path.join(
temp_dir,
"test_media_segment_size.m3u8"
)
otio.adapters.write_to_file(timeline, media_pl_tmp_path)

# Read in the playlist
in_timeline = otio.adapters.read_from_file(media_pl_tmp_path)
os.remove(media_pl_tmp_path)
# Read in the playlist
in_timeline = otio.adapters.read_from_file(media_pl_tmp_path)

# Pick a duration that segments won't exceed but is less than max
seg_upper_duration = otio.opentime.RationalTime(7, 1)
Expand Down Expand Up @@ -339,15 +352,18 @@ def test_iframe_segment_size(self):
track_hls_metadata['EXT-X-I-FRAMES-ONLY'] = None

# Write out the playlist
media_pl_tmp_path = tempfile.mkstemp(suffix=".m3u8", text=True)[1]
otio.adapters.write_to_file(timeline, media_pl_tmp_path)
with tempfile.TemporaryDirectory() as temp_dir:
media_pl_tmp_path = os.path.join(
temp_dir,
"test_iframe_segment_size.m3u8"
)
otio.adapters.write_to_file(timeline, media_pl_tmp_path)

# Read in the playlist
in_timeline = otio.adapters.read_from_file(media_pl_tmp_path)
with open(media_pl_tmp_path) as f:
pl_lines = f.readlines()
pl_lines = [line.strip('\n') for line in pl_lines]
os.remove(media_pl_tmp_path)
# Read in the playlist
in_timeline = otio.adapters.read_from_file(media_pl_tmp_path)
with open(media_pl_tmp_path) as f:
pl_lines = f.readlines()
pl_lines = [line.strip('\n') for line in pl_lines]

# validate the TARGETDURATION value is correct
self.assertTrue('#EXT-X-TARGETDURATION:6' in pl_lines)
Expand Down Expand Up @@ -420,16 +436,15 @@ def test_simple_master_pl_from_mem(self):
t.tracks.append(atrack)

# Write out and validate the playlist
media_pl_tmp_path = tempfile.mkstemp(
suffix="master.m3u8",
text=True
)[1]
otio.adapters.write_to_file(t, media_pl_tmp_path)

with open(media_pl_tmp_path) as f:
pl_string = f.read()
with tempfile.TemporaryDirectory() as temp_dir:
media_pl_tmp_path = os.path.join(
temp_dir,
"master.m3u8"
)
otio.adapters.write_to_file(t, media_pl_tmp_path)

os.remove(media_pl_tmp_path)
with open(media_pl_tmp_path) as f:
pl_string = f.read()

# Drop blank lines before comparing
pl_string = '\n'.join((line for line in pl_string.split('\n') if line))
Expand Down Expand Up @@ -483,16 +498,15 @@ def test_master_pl_with_iframe_pl_from_mem(self):
t.tracks.append(atrack)

# Write out and validate the playlist
media_pl_tmp_path = tempfile.mkstemp(
suffix="master.m3u8",
text=True
)[1]
otio.adapters.write_to_file(t, media_pl_tmp_path)

with open(media_pl_tmp_path) as f:
pl_string = f.read()
with tempfile.TemporaryDirectory() as temp_dir:
media_pl_tmp_path = os.path.join(
temp_dir,
"master.m3u8"
)
otio.adapters.write_to_file(t, media_pl_tmp_path)

os.remove(media_pl_tmp_path)
with open(media_pl_tmp_path) as f:
pl_string = f.read()

# Drop blank lines before comparing
pl_string = '\n'.join(line for line in pl_string.split('\n') if line)
Expand Down Expand Up @@ -568,16 +582,15 @@ def test_master_pl_complex_from_mem(self):
t.tracks.append(atrack)

# Write out and validate the playlist
media_pl_tmp_path = tempfile.mkstemp(
suffix="master.m3u8",
text=True
)[1]
otio.adapters.write_to_file(t, media_pl_tmp_path)

with open(media_pl_tmp_path) as f:
pl_string = f.read()
with tempfile.TemporaryDirectory() as temp_dir:
media_pl_tmp_path = os.path.join(
temp_dir,
"master.m3u8"
)
otio.adapters.write_to_file(t, media_pl_tmp_path)

os.remove(media_pl_tmp_path)
with open(media_pl_tmp_path) as f:
pl_string = f.read()

# Drop blank lines before comparing
pl_string = '\n'.join(line for line in pl_string.split('\n') if line)
Expand Down Expand Up @@ -610,16 +623,15 @@ def test_master_playlist_hint_metadata(self):
)

# Write out and validate the playlist
media_pl_tmp_path = tempfile.mkstemp(
suffix="master.m3u8",
text=True
)[1]
otio.adapters.write_to_file(timeline, media_pl_tmp_path)

with open(media_pl_tmp_path) as f:
pl_string = f.read()
with tempfile.TemporaryDirectory() as temp_dir:
media_pl_tmp_path = os.path.join(
temp_dir,
"test_media_pl_from_mem.m3u8"
)
otio.adapters.write_to_file(timeline, media_pl_tmp_path)

os.remove(media_pl_tmp_path)
with open(media_pl_tmp_path) as f:
pl_string = f.read()

# ensure metadata that wasn't supposed to didn't leak out
for line in pl_string.split('\n'):
Expand Down Expand Up @@ -696,16 +708,15 @@ def test_explicit_master_pl_from_mem(self):
track.append(segment1)

# Write out and validate the playlist
master_pl_tmp_path = tempfile.mkstemp(
suffix='master.m3u8',
text=True
)[1]
otio.adapters.write_to_file(t, master_pl_tmp_path)

with open(master_pl_tmp_path) as f:
pl_string = f.read()
with tempfile.TemporaryDirectory() as temp_dir:
master_pl_tmp_path = os.path.join(
temp_dir,
"master.m3u8"
)
otio.adapters.write_to_file(t, master_pl_tmp_path)

os.remove(master_pl_tmp_path)
with open(master_pl_tmp_path) as f:
pl_string = f.read()

# Drop blank lines before comparing
pl_string = '\n'.join((line for line in pl_string.split('\n') if line))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#

import os
import platform
import sys
import tempfile
import unittest
from fractions import Fraction
Expand Down Expand Up @@ -1018,6 +1020,10 @@ def assertXgesTimelineMarkerListEqual(self, ges_el, marker_list):
timeline, "markers", "GESMarkerList", marker_list)


@unittest.skipIf(
platform.system() != 'Linux' or sys.version_info[0] < 3,
"XGES only suppported on Linux in Python3."
)
class AdaptersXGESTest(
unittest.TestCase, otio_test_utils.OTIOAssertions,
CustomOtioAssertions, CustomXgesAssertions):
Expand Down
16 changes: 11 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ class _Ctx(object):
_ctx.debug = False


INSTALL_REQUIRES = [
'pyaaf2==1.4.0',
]
# python2 dependencies
if sys.version_info[0] < 3:
INSTALL_REQUIRES.append(
"backports.tempfile",
)


def cmake_version_check():
if platform.system() == "Windows":
required_minimum_version = '3.17.0'
Expand Down Expand Up @@ -389,11 +399,7 @@ def test_otio():
'opentimelineview': 'src/opentimelineview',
},

install_requires=(
[
'pyaaf2==1.4.0',
]
),
install_requires=INSTALL_REQUIRES,
entry_points={
'console_scripts': [
'otioview = opentimelineview.console:main',
Expand Down
Loading