mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Global: Move PyOpenColorIO to vendor/python so that DCCs don't conflict with their own
This commit is contained in:
parent
ad1453576d
commit
facf4fdc65
2 changed files with 31 additions and 15 deletions
|
|
@ -71,7 +71,6 @@ pysftp = "^0.2.9"
|
|||
dropbox = "^11.20.0"
|
||||
aiohttp-middlewares = "^2.0.0"
|
||||
ayon-python-api = "^0.1"
|
||||
opencolorio = "^2.2.0"
|
||||
Unidecode = "^1.2"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
|
|
@ -131,6 +130,11 @@ version = "6.4.3"
|
|||
package = "PySide2"
|
||||
version = "5.15.2"
|
||||
|
||||
# DCC packages supply their own opencolorio, lets not interfere with theirs
|
||||
[openpype.opencolorio]
|
||||
package = "opencolorio"
|
||||
version = "2.2.1"
|
||||
|
||||
# TODO: we will need to handle different linux flavours here and
|
||||
# also different macos versions too.
|
||||
[openpype.thirdparty.ffmpeg.windows]
|
||||
|
|
|
|||
|
|
@ -67,40 +67,43 @@ def _print(msg: str, message_type: int = 0) -> None:
|
|||
print(f"{header}{msg}")
|
||||
|
||||
|
||||
def install_qtbinding(pyproject, openpype_root, platform_name):
|
||||
_print("Handling Qt binding framework ...")
|
||||
qtbinding_def = pyproject["openpype"]["qtbinding"][platform_name]
|
||||
package = qtbinding_def["package"]
|
||||
version = qtbinding_def.get("version")
|
||||
|
||||
qtbinding_arg = None
|
||||
def _pip_install(openpype_root, package, version=None):
|
||||
arg = None
|
||||
if package and version:
|
||||
qtbinding_arg = f"{package}=={version}"
|
||||
arg = f"{package}=={version}"
|
||||
elif package:
|
||||
qtbinding_arg = package
|
||||
arg = package
|
||||
|
||||
if not qtbinding_arg:
|
||||
_print("Didn't find Qt binding to install")
|
||||
if not arg:
|
||||
_print("Couldn't find package to install")
|
||||
sys.exit(1)
|
||||
|
||||
_print(f"We'll install {qtbinding_arg}")
|
||||
_print(f"We'll install {arg}")
|
||||
|
||||
python_vendor_dir = openpype_root / "vendor" / "python"
|
||||
try:
|
||||
subprocess.run(
|
||||
[
|
||||
sys.executable,
|
||||
"-m", "pip", "install", "--upgrade", qtbinding_arg,
|
||||
"-m", "pip", "install", "--upgrade", arg,
|
||||
"-t", str(python_vendor_dir)
|
||||
],
|
||||
check=True,
|
||||
stdout=subprocess.DEVNULL
|
||||
)
|
||||
except subprocess.CalledProcessError as e:
|
||||
_print("Error during PySide2 installation.", 1)
|
||||
_print(f"Error during {package} installation.", 1)
|
||||
_print(str(e), 1)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def install_qtbinding(pyproject, openpype_root, platform_name):
|
||||
_print("Handling Qt binding framework ...")
|
||||
qtbinding_def = pyproject["openpype"]["qtbinding"][platform_name]
|
||||
package = qtbinding_def["package"]
|
||||
version = qtbinding_def.get("version")
|
||||
_pip_install(openpype_root, package, version)
|
||||
|
||||
# Remove libraries for QtSql which don't have available libraries
|
||||
# by default and Postgre library would require to modify rpath of
|
||||
# dependency
|
||||
|
|
@ -112,6 +115,14 @@ def install_qtbinding(pyproject, openpype_root, platform_name):
|
|||
os.remove(str(filepath))
|
||||
|
||||
|
||||
def install_opencolorio(pyproject, openpype_root):
|
||||
_print("Installing PyOpenColorIO")
|
||||
opencolorio_def = pyproject["openpype"]["opencolorio"]
|
||||
package = opencolorio_def["package"]
|
||||
version = opencolorio_def.get("version")
|
||||
_pip_install(openpype_root, package, version)
|
||||
|
||||
|
||||
def install_thirdparty(pyproject, openpype_root, platform_name):
|
||||
_print("Processing third-party dependencies ...")
|
||||
try:
|
||||
|
|
@ -221,6 +232,7 @@ def main():
|
|||
pyproject = toml.load(openpype_root / "pyproject.toml")
|
||||
platform_name = platform.system().lower()
|
||||
install_qtbinding(pyproject, openpype_root, platform_name)
|
||||
install_opencolorio(pyproject, openpype_root)
|
||||
install_thirdparty(pyproject, openpype_root, platform_name)
|
||||
end_time = time.time_ns()
|
||||
total_time = (end_time - start_time) / 1000000000
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue