Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ docs/_build
.tox
cpp_cov_html/
lcov_html_report/
*.so
*.pyd
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ exclude */.DS_Store
exclude .clang-format
exclude OTIO_VERSION.json
global-exclude *.pyc
global-exclude *.so
global-exclude *.pyd

prune maintainers
prune tsc
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ with OpenTimelineIO due to spaces in the path.

## To build OTIO for Python development:

+ `python -m pip install .`
+ `python -m pip install -e .`

## To build OTIO for both C++ and Python development:

Expand Down
40 changes: 16 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import sys
import platform
import subprocess
import unittest
import tempfile
import shutil

Expand Down Expand Up @@ -46,23 +45,25 @@ def join_args(args):
return ' '.join(map(shlex.quote, args))


class CMakeExtension(Extension):
def __init__(self, name):
Extension.__init__(self, name, sources=[])


class OTIO_build_ext(setuptools.command.build_ext.build_ext):
"""
def initialize_options(self):
super(setuptools.command.build_ext.build_ext, self).initialize_options()
"""

built = False

def run(self):
self.announce('running OTIO build_ext', level=2)
super().run()

def build_extension(self, _ext: Extension):
# This works around the fact that we build _opentime and _otio
# extensions as a one-shot cmake invocation. Usually we'd build each
# separately using build_extension.
self.announce('running OTIO build_ext', level=2)
self.build()
if not self.built:
self.build()
self.built = True

def build(self):
self.build_temp_dir = (
Expand Down Expand Up @@ -256,22 +257,15 @@ class OTIO_build_py(setuptools.command.build_py.build_py):
"""Stamps PROJECT_METADATA into __init__ files."""

def run(self):
setuptools.command.build_py.build_py.run(self)
super().run()

if not self.dry_run:
if not self.dry_run and not self.editable_mode:
# Only run when not in dry-mode (a dry run should not have any side effect)
# and in non-editable mode. We don't want to edit files when in editable
# mode because that could lead to modifications to the source files.
_append_version_info_to_init_scripts(self.build_lib)


def test_otio():
"""Discovers and runs tests"""
try:
# Clear the environment of a preset media linker
del os.environ['OTIO_DEFAULT_MEDIA_LINKER']
except KeyError:
pass
return unittest.TestLoader().discover('tests')


# copied from first paragraph of README.md
LONG_DESCRIPTION = """OpenTimelineIO is an interchange format and API for
editorial cut information. OTIO is not a container format for media, rather it
Expand Down Expand Up @@ -339,8 +333,8 @@ def test_otio():
),

ext_modules=[
CMakeExtension('_opentimelineio'),
CMakeExtension('_opentime'),
Extension('opentimelineio._otio', sources=[]),
Extension('opentimelineio._opentime', sources=[]),
],

package_dir={
Expand Down Expand Up @@ -382,8 +376,6 @@ def test_otio():
]
},

test_suite='setup.test_otio',

# because we need to open() the adapters manifest, we aren't zip-safe
zip_safe=False,

Expand Down