MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / get_version

Function get_version

setup.py:18–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16
17# Extract the project version from CMake generated ABI header.
18def get_version():
19 VERSION_REGEX = re.compile(
20 r"^\s*#\s*define\s+OCIO_VERSION_FULL_STR\s+\"(.*)\"\s*$", re.MULTILINE)
21
22 here = os.path.abspath(os.path.dirname(__file__))
23
24 with tempfile.TemporaryDirectory() as tmpdir:
25 try:
26 subprocess.check_call(["cmake", here], cwd=tmpdir)
27 path = os.path.join(tmpdir, "include", "OpenColorIO", "OpenColorABI.h")
28 with open(path) as f:
29 match = VERSION_REGEX.search(f.read())
30 return match.group(1)
31 except Exception as e:
32 raise RuntimeError(
33 "Unable to find OpenColorIO version: {}".format(str(e))
34 )
35
36
37# Call CMake find_package from a dummy script and return whether the package

Callers 1

setup.pyFile · 0.85

Calls 2

readMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected