From 52a5183b7bea4a591ecaa8fe63cf424f4bfc4e6f Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Wed, 31 Mar 2021 21:40:39 +0200 Subject: [PATCH 01/23] add script to download and extract dependencies --- README.md | 6 +- poetry.lock | 32 ++++++- pyproject.toml | 31 +++++- tools/fetch_thirdparty_libs.ps1 | 21 ++++ tools/fetch_thirdparty_libs.py | 165 ++++++++++++++++++++++++++++++++ tools/fetch_thirdparty_libs.sh | 129 +++++++++++++++++++++++++ 6 files changed, 378 insertions(+), 6 deletions(-) create mode 100644 tools/fetch_thirdparty_libs.ps1 create mode 100644 tools/fetch_thirdparty_libs.py create mode 100755 tools/fetch_thirdparty_libs.sh diff --git a/README.md b/README.md index 456655bfb9..d6c98974e0 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,8 @@ git clone --recurse-submodules git@github.com:pypeclub/pype.git #### To build Pype: 1) Run `.\tools\create_env.ps1` to create virtual environment in `.\venv` -2) Run `.\tools\build.ps1` to build pype executables in `.\build\` +2) Run `.\tools\fetch_thirdparty_libs.ps1` to download third-party dependencies like ffmpeg and oiio. Those will be included in build. +3) Run `.\tools\build.ps1` to build pype executables in `.\build\` To create distributable Pype versions, run `./tools/create_zip.ps1` - that will create zip file with name `pype-vx.x.x.zip` parsed from current pype repository and @@ -105,7 +106,8 @@ pyenv local 3.7.9 #### To build Pype: 1) Run `.\tools\create_env.sh` to create virtual environment in `.\venv` -2) Run `.\tools\build.sh` to build Pype executables in `.\build\` +2) Run `.\tools\fetch_thirdparty_libs.sh` to download third-party dependencies like ffmpeg and oiio. Those will be included in build. +3) Run `.\tools\build.sh` to build Pype executables in `.\build\` ### Linux diff --git a/poetry.lock b/poetry.lock index e6c08b8ae9..1a0637dc47 100644 --- a/poetry.lock +++ b/poetry.lock @@ -296,6 +296,18 @@ category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +[[package]] +name = "enlighten" +version = "1.9.0" +description = "Enlighten Progress Bar" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +blessed = ">=1.17.7" +prefixed = ">=0.3.2" + [[package]] name = "evdev" version = "1.4.0" @@ -637,7 +649,7 @@ view = ["PySide2 (>=5.11,<6.0)"] [package.source] type = "legacy" -url = "https://d.r1.wbsprt.com/pype.club/distribute" +url = "https://distribute.openpype.io/wheels" reference = "pype" [[package]] @@ -696,6 +708,14 @@ importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} [package.extras] dev = ["pre-commit", "tox"] +[[package]] +name = "prefixed" +version = "0.3.2" +description = "Prefixed alternative numeric library" +category = "main" +optional = false +python-versions = "*" + [[package]] name = "protobuf" version = "3.15.6" @@ -1391,7 +1411,7 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pyt [metadata] lock-version = "1.1" python-versions = "3.7.*" -content-hash = "4905515073ad2bf2a8517d513d68e48669b6a829f24e540b2dd60bc70cbea26b" +content-hash = "b356e327dbaa1aa38dbf1463901f64539f2c8d07be8d8a017e83b8a1554dbff9" [metadata.files] acre = [] @@ -1636,6 +1656,10 @@ docutils = [ {file = "docutils-0.16-py2.py3-none-any.whl", hash = "sha256:0c5b78adfbf7762415433f5515cd5c9e762339e23369dbe8000d84a4bf4ab3af"}, {file = "docutils-0.16.tar.gz", hash = "sha256:c2de3a60e9e7d07be26b7f2b00ca0309c207e06c100f9cc2a94931fc75a478fc"}, ] +enlighten = [ + {file = "enlighten-1.9.0-py2.py3-none-any.whl", hash = "sha256:5c59e41505702243c6b26437403e371d2a146ac72de5f706376f738ea8f32659"}, + {file = "enlighten-1.9.0.tar.gz", hash = "sha256:539cc308ccc0c3bfb50feb1b2da94c1a1ac21e80fe95e984221de8966d48f428"}, +] evdev = [ {file = "evdev-1.4.0.tar.gz", hash = "sha256:8782740eb1a86b187334c07feb5127d3faa0b236e113206dfe3ae8f77fb1aaf1"}, ] @@ -1896,6 +1920,10 @@ pluggy = [ {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, ] +prefixed = [ + {file = "prefixed-0.3.2-py2.py3-none-any.whl", hash = "sha256:5e107306462d63f2f03c529dbf11b0026fdfec621a9a008ca639d71de22995c3"}, + {file = "prefixed-0.3.2.tar.gz", hash = "sha256:ca48277ba5fa8346dd4b760847da930c7b84416387c39e93affef086add2c029"}, +] protobuf = [ {file = "protobuf-3.15.6-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:1771ef20e88759c4d81db213e89b7a1fc53937968e12af6603c658ee4bcbfa38"}, {file = "protobuf-3.15.6-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:1a66261a402d05c8ad8c1fde8631837307bf8d7e7740a4f3941fc3277c2e1528"}, diff --git a/pyproject.toml b/pyproject.toml index b6ca6574c4..589342da05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,7 @@ jinxed = [ { version = "^1.0.1", markers = "sys_platform == 'linux'" } ] python3-xlib = { version="*", markers = "sys_platform == 'linux'"} +enlighten = "^1.9.0" [tool.poetry.dev-dependencies] flake8 = "^3.7" @@ -61,8 +62,8 @@ sphinx-rtd-theme = "*" sphinxcontrib-websupport = "*" sphinx-qt-documentation = "*" recommonmark = "*" -tqdm = "*" wheel = "*" +enlighten = "*" # cool terminal progress bars [tool.poetry.urls] "Bug Tracker" = "https://github.com/pypeclub/pype/issues" @@ -70,8 +71,34 @@ wheel = "*" [[tool.poetry.source]] name = "pype" -url = "https://d.r1.wbsprt.com/pype.club/distribute/" +url = "https://distribute.openpype.io/wheels/" [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" + +[pype] + +[pype.thirdparty.ffmpeg.windows] +url = "https://distribute.openpype.io/thirdparty/ffmpeg-4.13-windows.zip" +hash = "43988ebcba98313635f06f2ca7e2dd52670710ebceefaa77107321b1def30472" + +[pype.thirdparty.ffmpeg.linux] +url = "https://distribute.openpype.io/thirdparty/ffmpeg-20200504-linux.tgz" +hash = "sha256:..." + +[pype.thirdparty.ffmpeg.darwin] +url = "https://distribute.openpype.io/thirdparty/ffmpeg-20200504-darwin.tgz" +hash = "sha256:..." + +[pype.thirdparty.oiio.windows] +url = "https://distribute.openpype.io/thirdparty/oiio_tools-2.2.0-windows.zip" +hash = "fd2e00278e01e85dcee7b4a6969d1a16f13016ec16700fb0366dbb1b1f3c37ad" + +[pype.thirdparty.oiio.linux] +url = "https://distribute.openpype.io/thirdparty/oiio-2.2.0-linux.tgz" +hash = "sha256:..." + +[pype.thirdparty.oiio.darwin] +url = "https://distribute.openpype.io/thirdparty/oiio-2.2.0-darwin.tgz" +hash = "sha256:..." \ No newline at end of file diff --git a/tools/fetch_thirdparty_libs.ps1 b/tools/fetch_thirdparty_libs.ps1 new file mode 100644 index 0000000000..7eed5a22db --- /dev/null +++ b/tools/fetch_thirdparty_libs.ps1 @@ -0,0 +1,21 @@ +<# +.SYNOPSIS + Download and extract third-party dependencies for Pype. + +.DESCRIPTION + This will download third-party dependencies specified in pyproject.toml + and extract them to vendor/bin folder. + #> + +.EXAMPLE + +PS> .\fetch_thirdparty_libs.ps1 + +#> +$current_dir = Get-Location +$script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent +$pype_root = (Get-Item $script_dir).parent.FullName +Set-Location -Path $pype_root + +& poetry run python "$($pype_root)\tools\fetch_thirdparty_libs.py" +Set-Location -Path $current_dir diff --git a/tools/fetch_thirdparty_libs.py b/tools/fetch_thirdparty_libs.py new file mode 100644 index 0000000000..cda4d3a6fd --- /dev/null +++ b/tools/fetch_thirdparty_libs.py @@ -0,0 +1,165 @@ +# -*- coding: utf-8 -*- +"""Fetch, verify and process third-party dependencies of Pype. + +Those should be defined in `pyproject.toml` in Pype sources root. + +""" +import os +import sys +import toml +import shutil +from pathlib import Path +from urllib.parse import urlparse +import requests +import enlighten +import platform +import blessed +import tempfile +import math +import hashlib +import tarfile +import zipfile +import time + + +term = blessed.Terminal() +manager = enlighten.get_manager() +hash_buffer_size = 65536 + + +def sha256_sum(filename: Path): + """Calculate sha256 hash for given file. + + Args: + filename (Path): path to file. + + Returns: + str: hex hash. + + """ + _hash = hashlib.sha256() + with open(filename, 'rb', buffering=0) as f: + buffer = bytearray(128*1024) + mv = memoryview(buffer) + for n in iter(lambda: f.readinto(mv), 0): + _hash.update(mv[:n]) + return _hash.hexdigest() + + +def _print(msg: str, message_type: int = 0) -> None: + """Print message to console. + + Args: + msg (str): message to print + message_type (int): type of message (0 info, 1 error, 2 note) + + """ + if message_type == 0: + header = term.aquamarine3(">>> ") + elif message_type == 1: + header = term.orangered2("!!! ") + elif message_type == 2: + header = term.tan1("... ") + else: + header = term.darkolivegreen3("--- ") + + print("{}{}".format(header, msg)) + + +_print("Processing third-party dependencies ...") +start_time = time.time_ns() +pype_root = Path(os.path.dirname(__file__)).parent +pyproject = toml.load(pype_root / "pyproject.toml") +platform_name = platform.system().lower() + +try: + thirdparty = pyproject["pype"]["thirdparty"] +except AttributeError: + _print("No third-party libraries specified in pyproject.toml", 1) + sys.exit(1) + +for k, v in thirdparty.items(): + _print(f"processing {k}") + destination_path = pype_root / "vendor" / "bin" / k / platform_name + url = v.get(platform_name).get("url") + + + if not v.get(platform_name): + _print(("missing definition for current " + f"platform [ {platform_name} ]"), 1) + sys.exit(1) + + parsed_url = urlparse(url) + + # check if file is already extracted in /vendor/bin + if destination_path.exists(): + _print("destination path already exists, deleting ...", 2) + if destination_path.is_dir(): + try: + shutil.rmtree(destination_path) + except OSError as e: + _print("cannot delete folder.", 1) + raise SystemExit(e) + + # download file + _print(f"Downloading {url} ...") + with tempfile.TemporaryDirectory() as temp_dir: + temp_file = Path(temp_dir) / Path(parsed_url.path).name + + r = requests.get(url, stream=True) + content_len = int(r.headers.get('Content-Length', '0')) or None + with manager.counter(color='green', + total=content_len and math.ceil(content_len / 2 ** 20), # noqa: E501 + unit='MiB', leave=False) as counter: + with open(temp_file, 'wb', buffering=2 ** 24) as file_handle: + for chunk in r.iter_content(chunk_size=2 ** 20): + file_handle.write(chunk) + counter.update() + + # get file with checksum + _print("Calculating sha256 ...", 2) + calc_checksum = sha256_sum(temp_file) + if v.get(platform_name).get("hash") != calc_checksum: + _print("Downloaded files checksum invalid.") + sys.exit(1) + + _print("File OK", 3) + if not destination_path.exists(): + destination_path.mkdir(parents=True) + + # extract to destination + archive_type = temp_file.suffix.lstrip(".") + _print(f"Extracting {archive_type} file to {destination_path}") + if archive_type in ['zip']: + zip_file = zipfile.ZipFile(temp_file) + zip_file.extractall(destination_path) + zip_file.close() + + elif archive_type in [ + 'tar', 'tgz', 'tar.gz', 'tar.xz', 'tar.bz2' + ]: + if archive_type == 'tar': + tar_type = 'r:' + elif archive_type.endswith('xz'): + tar_type = 'r:xz' + elif archive_type.endswith('gz'): + tar_type = 'r:gz' + elif archive_type.endswith('bz2'): + tar_type = 'r:bz2' + else: + tar_type = 'r:*' + try: + tar_file = tarfile.open(temp_file, tar_type) + except tarfile.ReadError: + raise SystemExit( + "corrupted archive: also consider to download the " + "archive manually, add its path to the url, run " + "`./pype deploy`" + ) + tar_file.extractall(destination_path) + tar_file.close() + _print("Extraction OK", 3) + +end_time = time.time_ns() +total_time = (end_time - start_time) / 1000000000 +_print(f"Downloading and extracting took {total_time} secs.") diff --git a/tools/fetch_thirdparty_libs.sh b/tools/fetch_thirdparty_libs.sh new file mode 100755 index 0000000000..e305b4b3e4 --- /dev/null +++ b/tools/fetch_thirdparty_libs.sh @@ -0,0 +1,129 @@ +#!/usr/bin/env bash + +# Run Pype Tray + + +art () { + cat <<-EOF + ____________ + /\\ ___ \\ + \\ \\ \\/_\\ \\ + \\ \\ _____/ ______ ___ ___ ___ + \\ \\ \\___/ /\\ \\ \\ \\\\ \\\\ \\ + \\ \\____\\ \\ \\_____\\ \\__\\\\__\\\\__\\ + \\/____/ \\/_____/ . PYPE Club . + +EOF +} + +# Colors for terminal + +RST='\033[0m' # Text Reset + +# Regular Colors +Black='\033[0;30m' # Black +Red='\033[0;31m' # Red +Green='\033[0;32m' # Green +Yellow='\033[0;33m' # Yellow +Blue='\033[0;34m' # Blue +Purple='\033[0;35m' # Purple +Cyan='\033[0;36m' # Cyan +White='\033[0;37m' # White + +# Bold +BBlack='\033[1;30m' # Black +BRed='\033[1;31m' # Red +BGreen='\033[1;32m' # Green +BYellow='\033[1;33m' # Yellow +BBlue='\033[1;34m' # Blue +BPurple='\033[1;35m' # Purple +BCyan='\033[1;36m' # Cyan +BWhite='\033[1;37m' # White + +# Bold High Intensity +BIBlack='\033[1;90m' # Black +BIRed='\033[1;91m' # Red +BIGreen='\033[1;92m' # Green +BIYellow='\033[1;93m' # Yellow +BIBlue='\033[1;94m' # Blue +BIPurple='\033[1;95m' # Purple +BICyan='\033[1;96m' # Cyan +BIWhite='\033[1;97m' # White + + +############################################################################## +# Detect required version of python +# Globals: +# colors +# PYTHON +# Arguments: +# None +# Returns: +# None +############################################################################### +detect_python () { + echo -e "${BIGreen}>>>${RST} Using python \c" + local version_command="import sys;print('{0}.{1}'.format(sys.version_info[0], sys.version_info[1]))" + local python_version="$(python3 <<< ${version_command})" + oIFS="$IFS" + IFS=. + set -- $python_version + IFS="$oIFS" + if [ "$1" -ge "3" ] && [ "$2" -ge "6" ] ; then + if [ "$2" -gt "7" ] ; then + echo -e "${BIWhite}[${RST} ${BIRed}$1.$2 ${BIWhite}]${RST} - ${BIRed}FAILED${RST} ${BIYellow}Version is new and unsupported, use${RST} ${BIPurple}3.7.x${RST}"; return 1; + else + echo -e "${BIWhite}[${RST} ${BIGreen}$1.$2${RST} ${BIWhite}]${RST}" + fi + PYTHON="python3" + else + command -v python3 >/dev/null 2>&1 || { echo -e "${BIRed}$1.$2$ - ${BIRed}FAILED${RST} ${BIYellow}Version is old and unsupported${RST}"; return 1; } + fi +} + +############################################################################## +# Clean pyc files in specified directory +# Globals: +# None +# Arguments: +# Optional path to clean +# Returns: +# None +############################################################################### +clean_pyc () { + local path + path=$pype_root + echo -e "${BIGreen}>>>${RST} Cleaning pyc at [ ${BIWhite}$path${RST} ] ... \c" + find "$path" -regex '^.*\(__pycache__\|\.py[co]\)$' -delete + echo -e "${BIGreen}DONE${RST}" +} + +############################################################################## +# Return absolute path +# Globals: +# None +# Arguments: +# Path to resolve +# Returns: +# None +############################################################################### +realpath () { + echo $(cd $(dirname "$1"); pwd)/$(basename "$1") +} + +# Main +main () { + echo -e "${BGreen}" + art + echo -e "${RST}" + detect_python || return 1 + + # Directories + pype_root=$(realpath $(dirname $(dirname "${BASH_SOURCE[0]}"))) + pushd "$pype_root" > /dev/null || return > /dev/null + + echo -e "${BIGreen}>>>${RST} Running Pype tool ..." + poetry run python3 "$pype_root/tools/fetch_thirdparty_libs.py" +} + +main \ No newline at end of file From 91e8bfc941693d5ec84b5339658869b9cbcab38e Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Wed, 31 Mar 2021 21:50:07 +0200 Subject: [PATCH 02/23] hound --- tools/fetch_thirdparty_libs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/fetch_thirdparty_libs.py b/tools/fetch_thirdparty_libs.py index cda4d3a6fd..5d38d69767 100644 --- a/tools/fetch_thirdparty_libs.py +++ b/tools/fetch_thirdparty_libs.py @@ -39,7 +39,7 @@ def sha256_sum(filename: Path): """ _hash = hashlib.sha256() with open(filename, 'rb', buffering=0) as f: - buffer = bytearray(128*1024) + buffer = bytearray(128 * 1024) mv = memoryview(buffer) for n in iter(lambda: f.readinto(mv), 0): _hash.update(mv[:n]) @@ -83,7 +83,6 @@ for k, v in thirdparty.items(): destination_path = pype_root / "vendor" / "bin" / k / platform_name url = v.get(platform_name).get("url") - if not v.get(platform_name): _print(("missing definition for current " f"platform [ {platform_name} ]"), 1) From 3254e55144bbd2ce48ddf896e99941aac0f3ab7e Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Tue, 6 Apr 2021 11:41:57 +0200 Subject: [PATCH 03/23] merge develop --- openpype/modules/ftrack/python2_vendor/arrow | 1 + openpype/modules/ftrack/python2_vendor/ftrack-python-api | 1 + repos/avalon-core | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) create mode 160000 openpype/modules/ftrack/python2_vendor/arrow create mode 160000 openpype/modules/ftrack/python2_vendor/ftrack-python-api diff --git a/openpype/modules/ftrack/python2_vendor/arrow b/openpype/modules/ftrack/python2_vendor/arrow new file mode 160000 index 0000000000..b746fedf72 --- /dev/null +++ b/openpype/modules/ftrack/python2_vendor/arrow @@ -0,0 +1 @@ +Subproject commit b746fedf7286c3755a46f07ab72f4c414cd41fc0 diff --git a/openpype/modules/ftrack/python2_vendor/ftrack-python-api b/openpype/modules/ftrack/python2_vendor/ftrack-python-api new file mode 160000 index 0000000000..d277f474ab --- /dev/null +++ b/openpype/modules/ftrack/python2_vendor/ftrack-python-api @@ -0,0 +1 @@ +Subproject commit d277f474ab016e7b53479c36af87cb861d0cc53e diff --git a/repos/avalon-core b/repos/avalon-core index 911a29a44d..bbba8765c4 160000 --- a/repos/avalon-core +++ b/repos/avalon-core @@ -1 +1 @@ -Subproject commit 911a29a44d5e6a128f4326deb1155184fe811fd7 +Subproject commit bbba8765c431ee124590e4f12d2e56db4d62eacd From 51b8b61365524e1702838db799a20ca2197e51c0 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Tue, 6 Apr 2021 11:46:38 +0200 Subject: [PATCH 04/23] rebrand to OpenPype --- pyproject.toml | 14 +++++++------- tools/fetch_thirdparty_libs.ps1 | 8 ++++---- tools/fetch_thirdparty_libs.py | 18 +++++++----------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 589342da05..bc808b5b9f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,28 +77,28 @@ url = "https://distribute.openpype.io/wheels/" requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" -[pype] +[openpype] -[pype.thirdparty.ffmpeg.windows] +[openpype.thirdparty.ffmpeg.windows] url = "https://distribute.openpype.io/thirdparty/ffmpeg-4.13-windows.zip" hash = "43988ebcba98313635f06f2ca7e2dd52670710ebceefaa77107321b1def30472" -[pype.thirdparty.ffmpeg.linux] +[openpype.thirdparty.ffmpeg.linux] url = "https://distribute.openpype.io/thirdparty/ffmpeg-20200504-linux.tgz" hash = "sha256:..." -[pype.thirdparty.ffmpeg.darwin] +[openpype.thirdparty.ffmpeg.darwin] url = "https://distribute.openpype.io/thirdparty/ffmpeg-20200504-darwin.tgz" hash = "sha256:..." -[pype.thirdparty.oiio.windows] +[openpype.thirdparty.oiio.windows] url = "https://distribute.openpype.io/thirdparty/oiio_tools-2.2.0-windows.zip" hash = "fd2e00278e01e85dcee7b4a6969d1a16f13016ec16700fb0366dbb1b1f3c37ad" -[pype.thirdparty.oiio.linux] +[openpype.thirdparty.oiio.linux] url = "https://distribute.openpype.io/thirdparty/oiio-2.2.0-linux.tgz" hash = "sha256:..." -[pype.thirdparty.oiio.darwin] +[openpype.thirdparty.oiio.darwin] url = "https://distribute.openpype.io/thirdparty/oiio-2.2.0-darwin.tgz" hash = "sha256:..." \ No newline at end of file diff --git a/tools/fetch_thirdparty_libs.ps1 b/tools/fetch_thirdparty_libs.ps1 index 7eed5a22db..f79cfdd267 100644 --- a/tools/fetch_thirdparty_libs.ps1 +++ b/tools/fetch_thirdparty_libs.ps1 @@ -1,6 +1,6 @@ <# .SYNOPSIS - Download and extract third-party dependencies for Pype. + Download and extract third-party dependencies for OpenPype. .DESCRIPTION This will download third-party dependencies specified in pyproject.toml @@ -14,8 +14,8 @@ PS> .\fetch_thirdparty_libs.ps1 #> $current_dir = Get-Location $script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent -$pype_root = (Get-Item $script_dir).parent.FullName -Set-Location -Path $pype_root +$openpype_root = (Get-Item $script_dir).parent.FullName +Set-Location -Path $openpype_root -& poetry run python "$($pype_root)\tools\fetch_thirdparty_libs.py" +& poetry run python "$($openpype_root)\tools\fetch_thirdparty_libs.py" Set-Location -Path $current_dir diff --git a/tools/fetch_thirdparty_libs.py b/tools/fetch_thirdparty_libs.py index 5d38d69767..75ee052950 100644 --- a/tools/fetch_thirdparty_libs.py +++ b/tools/fetch_thirdparty_libs.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -"""Fetch, verify and process third-party dependencies of Pype. +"""Fetch, verify and process third-party dependencies of OpenPype. -Those should be defined in `pyproject.toml` in Pype sources root. +Those should be defined in `pyproject.toml` in OpenPype sources root. """ import os @@ -68,19 +68,19 @@ def _print(msg: str, message_type: int = 0) -> None: _print("Processing third-party dependencies ...") start_time = time.time_ns() -pype_root = Path(os.path.dirname(__file__)).parent -pyproject = toml.load(pype_root / "pyproject.toml") +openpype_root = Path(os.path.dirname(__file__)).parent +pyproject = toml.load(openpype_root / "pyproject.toml") platform_name = platform.system().lower() try: - thirdparty = pyproject["pype"]["thirdparty"] + thirdparty = pyproject["openpype"]["thirdparty"] except AttributeError: _print("No third-party libraries specified in pyproject.toml", 1) sys.exit(1) for k, v in thirdparty.items(): _print(f"processing {k}") - destination_path = pype_root / "vendor" / "bin" / k / platform_name + destination_path = openpype_root / "vendor" / "bin" / k / platform_name url = v.get(platform_name).get("url") if not v.get(platform_name): @@ -150,11 +150,7 @@ for k, v in thirdparty.items(): try: tar_file = tarfile.open(temp_file, tar_type) except tarfile.ReadError: - raise SystemExit( - "corrupted archive: also consider to download the " - "archive manually, add its path to the url, run " - "`./pype deploy`" - ) + raise SystemExit("corrupted archive") tar_file.extractall(destination_path) tar_file.close() _print("Extraction OK", 3) From b6b322d5316bceadb15fdc374ab6b3b958a8a26b Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Mon, 12 Apr 2021 19:50:52 +0200 Subject: [PATCH 05/23] update poetry.lock --- poetry.lock | 141 +++++++++++++++++++++++----------------------------- 1 file changed, 62 insertions(+), 79 deletions(-) diff --git a/poetry.lock b/poetry.lock index ba09315806..ea6eb54667 100644 --- a/poetry.lock +++ b/poetry.lock @@ -80,7 +80,7 @@ python-dateutil = ">=2.7.0" [[package]] name = "astroid" -version = "2.5.2" +version = "2.5.3" description = "An abstract syntax tree for Python with inference support." category = "dev" optional = false @@ -404,7 +404,7 @@ uritemplate = ">=3.0.0,<4dev" [[package]] name = "google-auth" -version = "1.28.0" +version = "1.28.1" description = "Google Authentication Library" category = "main" optional = false @@ -552,7 +552,7 @@ i18n = ["Babel (>=0.8)"] [[package]] name = "jinxed" -version = "1.0.1" +version = "1.1.0" description = "Jinxed Terminal Library" category = "main" optional = false @@ -726,7 +726,7 @@ python-versions = "*" [[package]] name = "protobuf" -version = "3.15.7" +version = "3.15.8" description = "Protocol Buffers" category = "main" optional = false @@ -1297,22 +1297,9 @@ category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" -[[package]] -name = "tqdm" -version = "4.60.0" -description = "Fast, Extensible Progress Meter" -category = "dev" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" - -[package.extras] -dev = ["py-make (>=0.1.0)", "twine", "wheel"] -notebook = ["ipywidgets (>=6)"] -telegram = ["requests"] - [[package]] name = "typed-ast" -version = "1.4.2" +version = "1.4.3" description = "a fork of Python 2 and 3 ast modules with type comment support" category = "dev" optional = false @@ -1419,7 +1406,7 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pyt [metadata] lock-version = "1.1" python-versions = "3.7.*" -content-hash = "a8c9915ce3096b74b9328a632911a759780844d368fa1d6d0fbd7c5d7d4536cf" +content-hash = "877e76b7a9aa8a18f0ecef19c721fde469d90d28d871d8a4a7b33d85b3b15e36" [metadata.files] acre = [] @@ -1483,8 +1470,8 @@ arrow = [ {file = "arrow-0.17.0.tar.gz", hash = "sha256:ff08d10cda1d36c68657d6ad20d74fbea493d980f8b2d45344e00d6ed2bf6ed4"}, ] astroid = [ - {file = "astroid-2.5.2-py3-none-any.whl", hash = "sha256:cd80bf957c49765dce6d92c43163ff9d2abc43132ce64d4b1b47717c6d2522df"}, - {file = "astroid-2.5.2.tar.gz", hash = "sha256:6b0ed1af831570e500e2437625979eaa3b36011f66ddfc4ce930128610258ca9"}, + {file = "astroid-2.5.3-py3-none-any.whl", hash = "sha256:bea3f32799fbb8581f58431c12591bc20ce11cbc90ad82e2ea5717d94f2080d5"}, + {file = "astroid-2.5.3.tar.gz", hash = "sha256:ad63b8552c70939568966811a088ef0bc880f99a24a00834abd0e3681b514f91"}, ] async-timeout = [ {file = "async-timeout-3.0.1.tar.gz", hash = "sha256:0c3c816a028d47f659d6ff5c745cb2acf1f966da1fe5c19c77a70282b25f4c5f"}, @@ -1695,8 +1682,8 @@ google-api-python-client = [ {file = "google_api_python_client-1.12.8-py2.py3-none-any.whl", hash = "sha256:3c4c4ca46b5c21196bec7ee93453443e477d82cbfa79234d1ce0645f81170eaf"}, ] google-auth = [ - {file = "google-auth-1.28.0.tar.gz", hash = "sha256:9bd436d19ab047001a1340720d2b629eb96dd503258c524921ec2af3ee88a80e"}, - {file = "google_auth-1.28.0-py2.py3-none-any.whl", hash = "sha256:dcaba3aa9d4e0e96fd945bf25a86b6f878fcb05770b67adbeb50a63ca4d28a5e"}, + {file = "google-auth-1.28.1.tar.gz", hash = "sha256:70b39558712826e41f65e5f05a8d879361deaf84df8883e5dd0ec3d0da6ab66e"}, + {file = "google_auth-1.28.1-py2.py3-none-any.whl", hash = "sha256:186fe2564634d67fbbb64f3daf8bc8c9cecbb2a7f535ed1a8a71795e50db8d87"}, ] google-auth-httplib2 = [ {file = "google-auth-httplib2-0.1.0.tar.gz", hash = "sha256:a07c39fd632becacd3f07718dfd6021bf396978f03ad3ce4321d060015cc30ac"}, @@ -1743,8 +1730,8 @@ jinja2 = [ {file = "Jinja2-2.11.3.tar.gz", hash = "sha256:a6d58433de0ae800347cab1fa3043cebbabe8baa9d29e668f1c768cb87a333c6"}, ] jinxed = [ - {file = "jinxed-1.0.1-py2.py3-none-any.whl", hash = "sha256:602f2cb3523c1045456f7b6d79ac19297fd8e933ae3bd9159845dc857f2d519c"}, - {file = "jinxed-1.0.1.tar.gz", hash = "sha256:bc523c74fe676c99ccc69c68c2dcd7d4d2d7b2541f6dbef74ef211aedd8ad0d3"}, + {file = "jinxed-1.1.0-py2.py3-none-any.whl", hash = "sha256:6a61ccf963c16aa885304f27e6e5693783676897cea0c7f223270c8b8e78baf8"}, + {file = "jinxed-1.1.0.tar.gz", hash = "sha256:d8f1731f134e9e6b04d95095845ae6c10eb15cb223a5f0cabdea87d4a279c305"}, ] jsonschema = [ {file = "jsonschema-3.2.0-py2.py3-none-any.whl", hash = "sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163"}, @@ -1935,26 +1922,26 @@ prefixed = [ {file = "prefixed-0.3.2.tar.gz", hash = "sha256:ca48277ba5fa8346dd4b760847da930c7b84416387c39e93affef086add2c029"}, ] protobuf = [ - {file = "protobuf-3.15.7-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a14141d5c967362d2eedff8825d2b69cc36a5b3ed6b1f618557a04e58a3cf787"}, - {file = "protobuf-3.15.7-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:d54d78f621852ec4fdd1484d1263ca04d4bf5ffdf7abffdbb939e444b6ff3385"}, - {file = "protobuf-3.15.7-cp35-cp35m-macosx_10_9_intel.whl", hash = "sha256:462085acdb410b06335315fe7e63cb281a1902856e0f4657f341c283cedc1d56"}, - {file = "protobuf-3.15.7-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:849c92ce112e1ef648705c29ce044248e350f71d9d54a2026830623198f0bd38"}, - {file = "protobuf-3.15.7-cp35-cp35m-win32.whl", hash = "sha256:1f6083382f7714700deadf3014e921711e2f807de7f27e40c32b744701ae5b99"}, - {file = "protobuf-3.15.7-cp35-cp35m-win_amd64.whl", hash = "sha256:e17f60f00081adcb32068ee0bb51e418f6474acf83424244ff3512ffd2166385"}, - {file = "protobuf-3.15.7-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:6c75e563c6fb2ca5b8f21dd75c15659aa2c4a0025b9da3a7711ae661cd6a488d"}, - {file = "protobuf-3.15.7-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:d939f41b4108350841c4790ebbadb61729e1363522fdb8434eb4e6f2065d0db1"}, - {file = "protobuf-3.15.7-cp36-cp36m-win32.whl", hash = "sha256:24f14c09d4c0a3641f1b0e9b552d026361de65b01686fdd3e5fdf8f9512cd79b"}, - {file = "protobuf-3.15.7-cp36-cp36m-win_amd64.whl", hash = "sha256:1247170191bcb2a8d978d11a58afe391004ec6c2184e4d961baf8102d43ff500"}, - {file = "protobuf-3.15.7-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:364cadaeec0756afdc099cbd88cb5659bd1bb7d547168d063abcb0272ccbb2f6"}, - {file = "protobuf-3.15.7-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:0c3a6941b1e6e6e22d812a8e5c46bfe83082ea60d262a46f2cfb22d9b9fb17db"}, - {file = "protobuf-3.15.7-cp37-cp37m-win32.whl", hash = "sha256:eb5668f3f6a83b6603ca2e09be5b20de89521ea5914aabe032cce981e4129cc8"}, - {file = "protobuf-3.15.7-cp37-cp37m-win_amd64.whl", hash = "sha256:1001e671cf8476edce7fb72778358d026390649cc35a79d47b2a291684ccfbb2"}, - {file = "protobuf-3.15.7-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:a5ba7dd6f97964655aa7b234c95d80886425a31b7010764f042cdeb985314d18"}, - {file = "protobuf-3.15.7-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:46674bd6fcf8c63b4b9869ba579685db67cf51ae966443dd6bd9a8fa00fcef62"}, - {file = "protobuf-3.15.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4c4399156fb27e3768313b7a59352c861a893252bda6fb9f3643beb3ebb7047e"}, - {file = "protobuf-3.15.7-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:85cd29faf056036167d87445d5a5059034c298881c044e71a73d3b61a4be1c23"}, - {file = "protobuf-3.15.7-py2.py3-none-any.whl", hash = "sha256:22054432b923c0086f9cf1e1c0c52d39bf3c6e31014ea42eec2dabc22ee26d78"}, - {file = "protobuf-3.15.7.tar.gz", hash = "sha256:2d03fc2591543cd2456d0b72230b50c4519546a8d379ac6fd3ecd84c6df61e5d"}, + {file = "protobuf-3.15.8-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:fad4f971ec38d8df7f4b632c819bf9bbf4f57cfd7312cf526c69ce17ef32436a"}, + {file = "protobuf-3.15.8-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:f17b352d7ce33c81773cf81d536ca70849de6f73c96413f17309f4b43ae7040b"}, + {file = "protobuf-3.15.8-cp35-cp35m-macosx_10_9_intel.whl", hash = "sha256:4a054b0b5900b7ea7014099e783fb8c4618e4209fffcd6050857517b3f156e18"}, + {file = "protobuf-3.15.8-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:efa4c4d4fc9ba734e5e85eaced70e1b63fb3c8d08482d839eb838566346f1737"}, + {file = "protobuf-3.15.8-cp35-cp35m-win32.whl", hash = "sha256:07eec4e2ccbc74e95bb9b3afe7da67957947ee95bdac2b2e91b038b832dd71f0"}, + {file = "protobuf-3.15.8-cp35-cp35m-win_amd64.whl", hash = "sha256:f9cadaaa4065d5dd4d15245c3b68b967b3652a3108e77f292b58b8c35114b56c"}, + {file = "protobuf-3.15.8-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:2dc0e8a9e4962207bdc46a365b63a3f1aca6f9681a5082a326c5837ef8f4b745"}, + {file = "protobuf-3.15.8-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:f80afc0a0ba13339bbab25ca0409e9e2836b12bb012364c06e97c2df250c3343"}, + {file = "protobuf-3.15.8-cp36-cp36m-win32.whl", hash = "sha256:c5566f956a26cda3abdfacc0ca2e21db6c9f3d18f47d8d4751f2209d6c1a5297"}, + {file = "protobuf-3.15.8-cp36-cp36m-win_amd64.whl", hash = "sha256:dab75b56a12b1ceb3e40808b5bd9dfdaef3a1330251956e6744e5b6ed8f8830b"}, + {file = "protobuf-3.15.8-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:3053f13207e7f13dc7be5e9071b59b02020172f09f648e85dc77e3fcb50d1044"}, + {file = "protobuf-3.15.8-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:1f0b5d156c3df08cc54bc2c8b8b875648ea4cd7ebb2a9a130669f7547ec3488c"}, + {file = "protobuf-3.15.8-cp37-cp37m-win32.whl", hash = "sha256:90270fe5732c1f1ff664a3bd7123a16456d69b4e66a09a139a00443a32f210b8"}, + {file = "protobuf-3.15.8-cp37-cp37m-win_amd64.whl", hash = "sha256:f42c2f5fb67da5905bfc03733a311f72fa309252bcd77c32d1462a1ad519521e"}, + {file = "protobuf-3.15.8-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f6077db37bfa16494dca58a4a02bfdacd87662247ad6bc1f7f8d13ff3f0013e1"}, + {file = "protobuf-3.15.8-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:510e66491f1a5ac5953c908aa8300ec47f793130097e4557482803b187a8ee05"}, + {file = "protobuf-3.15.8-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5ff9fa0e67fcab442af9bc8d4ec3f82cb2ff3be0af62dba047ed4187f0088b7d"}, + {file = "protobuf-3.15.8-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:1c0e9e56202b9dccbc094353285a252e2b7940b74fdf75f1b4e1b137833fabd7"}, + {file = "protobuf-3.15.8-py2.py3-none-any.whl", hash = "sha256:a0a08c6b2e6d6c74a6eb5bf6184968eefb1569279e78714e239d33126e753403"}, + {file = "protobuf-3.15.8.tar.gz", hash = "sha256:0277f62b1e42210cafe79a71628c1d553348da81cbd553402a7f7549c50b11d0"}, ] py = [ {file = "py-1.10.0-py2.py3-none-any.whl", hash = "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a"}, @@ -2282,41 +2269,37 @@ toml = [ {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, ] -tqdm = [ - {file = "tqdm-4.60.0-py2.py3-none-any.whl", hash = "sha256:daec693491c52e9498632dfbe9ccfc4882a557f5fa08982db1b4d3adbe0887c3"}, - {file = "tqdm-4.60.0.tar.gz", hash = "sha256:ebdebdb95e3477ceea267decfc0784859aa3df3e27e22d23b83e9b272bf157ae"}, -] typed-ast = [ - {file = "typed_ast-1.4.2-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:7703620125e4fb79b64aa52427ec192822e9f45d37d4b6625ab37ef403e1df70"}, - {file = "typed_ast-1.4.2-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:c9aadc4924d4b5799112837b226160428524a9a45f830e0d0f184b19e4090487"}, - {file = "typed_ast-1.4.2-cp35-cp35m-manylinux2014_aarch64.whl", hash = "sha256:9ec45db0c766f196ae629e509f059ff05fc3148f9ffd28f3cfe75d4afb485412"}, - {file = "typed_ast-1.4.2-cp35-cp35m-win32.whl", hash = "sha256:85f95aa97a35bdb2f2f7d10ec5bbdac0aeb9dafdaf88e17492da0504de2e6400"}, - {file = "typed_ast-1.4.2-cp35-cp35m-win_amd64.whl", hash = "sha256:9044ef2df88d7f33692ae3f18d3be63dec69c4fb1b5a4a9ac950f9b4ba571606"}, - {file = "typed_ast-1.4.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:c1c876fd795b36126f773db9cbb393f19808edd2637e00fd6caba0e25f2c7b64"}, - {file = "typed_ast-1.4.2-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:5dcfc2e264bd8a1db8b11a892bd1647154ce03eeba94b461effe68790d8b8e07"}, - {file = "typed_ast-1.4.2-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:8db0e856712f79c45956da0c9a40ca4246abc3485ae0d7ecc86a20f5e4c09abc"}, - {file = "typed_ast-1.4.2-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:d003156bb6a59cda9050e983441b7fa2487f7800d76bdc065566b7d728b4581a"}, - {file = "typed_ast-1.4.2-cp36-cp36m-win32.whl", hash = "sha256:4c790331247081ea7c632a76d5b2a265e6d325ecd3179d06e9cf8d46d90dd151"}, - {file = "typed_ast-1.4.2-cp36-cp36m-win_amd64.whl", hash = "sha256:d175297e9533d8d37437abc14e8a83cbc68af93cc9c1c59c2c292ec59a0697a3"}, - {file = "typed_ast-1.4.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:cf54cfa843f297991b7388c281cb3855d911137223c6b6d2dd82a47ae5125a41"}, - {file = "typed_ast-1.4.2-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:b4fcdcfa302538f70929eb7b392f536a237cbe2ed9cba88e3bf5027b39f5f77f"}, - {file = "typed_ast-1.4.2-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:987f15737aba2ab5f3928c617ccf1ce412e2e321c77ab16ca5a293e7bbffd581"}, - {file = "typed_ast-1.4.2-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:37f48d46d733d57cc70fd5f30572d11ab8ed92da6e6b28e024e4a3edfb456e37"}, - {file = "typed_ast-1.4.2-cp37-cp37m-win32.whl", hash = "sha256:36d829b31ab67d6fcb30e185ec996e1f72b892255a745d3a82138c97d21ed1cd"}, - {file = "typed_ast-1.4.2-cp37-cp37m-win_amd64.whl", hash = "sha256:8368f83e93c7156ccd40e49a783a6a6850ca25b556c0fa0240ed0f659d2fe496"}, - {file = "typed_ast-1.4.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:963c80b583b0661918718b095e02303d8078950b26cc00b5e5ea9ababe0de1fc"}, - {file = "typed_ast-1.4.2-cp38-cp38-manylinux1_i686.whl", hash = "sha256:e683e409e5c45d5c9082dc1daf13f6374300806240719f95dc783d1fc942af10"}, - {file = "typed_ast-1.4.2-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:84aa6223d71012c68d577c83f4e7db50d11d6b1399a9c779046d75e24bed74ea"}, - {file = "typed_ast-1.4.2-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:a38878a223bdd37c9709d07cd357bb79f4c760b29210e14ad0fb395294583787"}, - {file = "typed_ast-1.4.2-cp38-cp38-win32.whl", hash = "sha256:a2c927c49f2029291fbabd673d51a2180038f8cd5a5b2f290f78c4516be48be2"}, - {file = "typed_ast-1.4.2-cp38-cp38-win_amd64.whl", hash = "sha256:c0c74e5579af4b977c8b932f40a5464764b2f86681327410aa028a22d2f54937"}, - {file = "typed_ast-1.4.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:07d49388d5bf7e863f7fa2f124b1b1d89d8aa0e2f7812faff0a5658c01c59aa1"}, - {file = "typed_ast-1.4.2-cp39-cp39-manylinux1_i686.whl", hash = "sha256:240296b27397e4e37874abb1df2a608a92df85cf3e2a04d0d4d61055c8305ba6"}, - {file = "typed_ast-1.4.2-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:d746a437cdbca200622385305aedd9aef68e8a645e385cc483bdc5e488f07166"}, - {file = "typed_ast-1.4.2-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:14bf1522cdee369e8f5581238edac09150c765ec1cb33615855889cf33dcb92d"}, - {file = "typed_ast-1.4.2-cp39-cp39-win32.whl", hash = "sha256:cc7b98bf58167b7f2db91a4327da24fb93368838eb84a44c472283778fc2446b"}, - {file = "typed_ast-1.4.2-cp39-cp39-win_amd64.whl", hash = "sha256:7147e2a76c75f0f64c4319886e7639e490fee87c9d25cb1d4faef1d8cf83a440"}, - {file = "typed_ast-1.4.2.tar.gz", hash = "sha256:9fc0b3cb5d1720e7141d103cf4819aea239f7d136acf9ee4a69b047b7986175a"}, + {file = "typed_ast-1.4.3-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:2068531575a125b87a41802130fa7e29f26c09a2833fea68d9a40cf33902eba6"}, + {file = "typed_ast-1.4.3-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:c907f561b1e83e93fad565bac5ba9c22d96a54e7ea0267c708bffe863cbe4075"}, + {file = "typed_ast-1.4.3-cp35-cp35m-manylinux2014_aarch64.whl", hash = "sha256:1b3ead4a96c9101bef08f9f7d1217c096f31667617b58de957f690c92378b528"}, + {file = "typed_ast-1.4.3-cp35-cp35m-win32.whl", hash = "sha256:dde816ca9dac1d9c01dd504ea5967821606f02e510438120091b84e852367428"}, + {file = "typed_ast-1.4.3-cp35-cp35m-win_amd64.whl", hash = "sha256:777a26c84bea6cd934422ac2e3b78863a37017618b6e5c08f92ef69853e765d3"}, + {file = "typed_ast-1.4.3-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f8afcf15cc511ada719a88e013cec87c11aff7b91f019295eb4530f96fe5ef2f"}, + {file = "typed_ast-1.4.3-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:52b1eb8c83f178ab787f3a4283f68258525f8d70f778a2f6dd54d3b5e5fb4341"}, + {file = "typed_ast-1.4.3-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:01ae5f73431d21eead5015997ab41afa53aa1fbe252f9da060be5dad2c730ace"}, + {file = "typed_ast-1.4.3-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:c190f0899e9f9f8b6b7863debfb739abcb21a5c054f911ca3596d12b8a4c4c7f"}, + {file = "typed_ast-1.4.3-cp36-cp36m-win32.whl", hash = "sha256:398e44cd480f4d2b7ee8d98385ca104e35c81525dd98c519acff1b79bdaac363"}, + {file = "typed_ast-1.4.3-cp36-cp36m-win_amd64.whl", hash = "sha256:bff6ad71c81b3bba8fa35f0f1921fb24ff4476235a6e94a26ada2e54370e6da7"}, + {file = "typed_ast-1.4.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0fb71b8c643187d7492c1f8352f2c15b4c4af3f6338f21681d3681b3dc31a266"}, + {file = "typed_ast-1.4.3-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:760ad187b1041a154f0e4d0f6aae3e40fdb51d6de16e5c99aedadd9246450e9e"}, + {file = "typed_ast-1.4.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:5feca99c17af94057417d744607b82dd0a664fd5e4ca98061480fd8b14b18d04"}, + {file = "typed_ast-1.4.3-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:95431a26309a21874005845c21118c83991c63ea800dd44843e42a916aec5899"}, + {file = "typed_ast-1.4.3-cp37-cp37m-win32.whl", hash = "sha256:aee0c1256be6c07bd3e1263ff920c325b59849dc95392a05f258bb9b259cf39c"}, + {file = "typed_ast-1.4.3-cp37-cp37m-win_amd64.whl", hash = "sha256:9ad2c92ec681e02baf81fdfa056fe0d818645efa9af1f1cd5fd6f1bd2bdfd805"}, + {file = "typed_ast-1.4.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b36b4f3920103a25e1d5d024d155c504080959582b928e91cb608a65c3a49e1a"}, + {file = "typed_ast-1.4.3-cp38-cp38-manylinux1_i686.whl", hash = "sha256:067a74454df670dcaa4e59349a2e5c81e567d8d65458d480a5b3dfecec08c5ff"}, + {file = "typed_ast-1.4.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7538e495704e2ccda9b234b82423a4038f324f3a10c43bc088a1636180f11a41"}, + {file = "typed_ast-1.4.3-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:af3d4a73793725138d6b334d9d247ce7e5f084d96284ed23f22ee626a7b88e39"}, + {file = "typed_ast-1.4.3-cp38-cp38-win32.whl", hash = "sha256:f2362f3cb0f3172c42938946dbc5b7843c2a28aec307c49100c8b38764eb6927"}, + {file = "typed_ast-1.4.3-cp38-cp38-win_amd64.whl", hash = "sha256:dd4a21253f42b8d2b48410cb31fe501d32f8b9fbeb1f55063ad102fe9c425e40"}, + {file = "typed_ast-1.4.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f328adcfebed9f11301eaedfa48e15bdece9b519fb27e6a8c01aa52a17ec31b3"}, + {file = "typed_ast-1.4.3-cp39-cp39-manylinux1_i686.whl", hash = "sha256:2c726c276d09fc5c414693a2de063f521052d9ea7c240ce553316f70656c84d4"}, + {file = "typed_ast-1.4.3-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:cae53c389825d3b46fb37538441f75d6aecc4174f615d048321b716df2757fb0"}, + {file = "typed_ast-1.4.3-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:b9574c6f03f685070d859e75c7f9eeca02d6933273b5e69572e5ff9d5e3931c3"}, + {file = "typed_ast-1.4.3-cp39-cp39-win32.whl", hash = "sha256:209596a4ec71d990d71d5e0d312ac935d86930e6eecff6ccc7007fe54d703808"}, + {file = "typed_ast-1.4.3-cp39-cp39-win_amd64.whl", hash = "sha256:9c6d1a54552b5330bc657b7ef0eae25d00ba7ffe85d9ea8ae6540d2197a3788c"}, + {file = "typed_ast-1.4.3.tar.gz", hash = "sha256:fb1bbeac803adea29cedd70781399c99138358c26d05fcbd23c13016b7f5ec65"}, ] typing-extensions = [ {file = "typing_extensions-3.7.4.3-py2-none-any.whl", hash = "sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f"}, From 95a9dc228f695ebb931a55527a02d026450def33 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 13 Apr 2021 10:08:54 +0200 Subject: [PATCH 06/23] added ffmpeg 4.4 for linux and darwin --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 447e532fc8..016fc32b18 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,12 +85,12 @@ url = "https://distribute.openpype.io/thirdparty/ffmpeg-4.13-windows.zip" hash = "43988ebcba98313635f06f2ca7e2dd52670710ebceefaa77107321b1def30472" [openpype.thirdparty.ffmpeg.linux] -url = "https://distribute.openpype.io/thirdparty/ffmpeg-20200504-linux.tgz" -hash = "sha256:..." +url = "https://distribute.openpype.io/thirdparty/ffmpeg-4.4-linux.tar.xz" +hash = "acc7fa366ae2c35b69b72d7a92a29daa6f31739dbf365fb64ef6220e9a16fa37" [openpype.thirdparty.ffmpeg.darwin] -url = "https://distribute.openpype.io/thirdparty/ffmpeg-20200504-darwin.tgz" -hash = "sha256:..." +url = "https://distribute.openpype.io/thirdparty/ffmpeg-4.4-macos.tar.xz" +hash = "b8088a399cd387dfeb0b951a1ca1d477d3dd96a67fdd79927b1ef083d6d6c7a9" [openpype.thirdparty.oiio.windows] url = "https://distribute.openpype.io/thirdparty/oiio_tools-2.2.0-windows.zip" From 3fe692e8fa3cabff85ba46c79439678a42259629 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 13 Apr 2021 10:44:59 +0200 Subject: [PATCH 07/23] set oiio and ffmpeg environments in the start --- start.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/start.py b/start.py index a892d3de8e..f963c3be7a 100644 --- a/start.py +++ b/start.py @@ -95,6 +95,7 @@ Attributes: import os import re import sys +import platform import traceback import subprocess import site @@ -144,6 +145,31 @@ def set_openpype_global_environments() -> None: if "QT_AUTO_SCREEN_SCALE_FACTOR" not in os.environ: os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1" + # --- Set environment variables to vendorized binaries(FFmpeg and OIIO) --- + # TODO add validations of existing binaries + # Prepare path to bin vendor directory + bin_vendor_dir = os.path.join( + os.path.dirname(os.path.abspath(__file__)), + "vendor", + "bin" + ) + # Prepare platform name + platform_name = platform.system().lower() + + # FFmpeg path + ffmpeg_path_parts = [bin_vendor_dir, "ffmpeg", platform_name] + # Windows version has executables in `bin` directory + if platform_name == "windows": + ffmpeg_path_parts.append("bin") + + ffmpeg_path = os.path.join(ffmpeg_path_parts) + + os.environ["OPENPYPE_FFMPEG_PATH"] = ffmpeg_path + + # OIIO path + oiio_path = os.path.join(bin_vendor_dir, "oiio", platform_name) + os.environ["OPENPYPE_OIIO_PATH"] = oiio_path + def run(arguments: list, env: dict = None) -> int: """Use correct executable to run stuff. From 8f5089cfd23370728d040241eec9d0596629887b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 13 Apr 2021 10:45:17 +0200 Subject: [PATCH 08/23] use OPENPYPE_FFMPEG_PATH instead of FFMPEG_PATH --- openpype/lib/ffmpeg_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openpype/lib/ffmpeg_utils.py b/openpype/lib/ffmpeg_utils.py index ba9f24c5d7..de02455f9a 100644 --- a/openpype/lib/ffmpeg_utils.py +++ b/openpype/lib/ffmpeg_utils.py @@ -9,10 +9,10 @@ log = logging.getLogger("FFmpeg utils") def get_ffmpeg_tool_path(tool="ffmpeg"): - """Find path to ffmpeg tool in FFMPEG_PATH paths. + """Find path to ffmpeg tool in OPENPYPE_FFMPEG_PATH paths. - Function looks for tool in paths set in FFMPEG_PATH environment. If tool - exists then returns it's full path. + Function looks for tool in paths set in OPENPYPE_FFMPEG_PATH environment. + If tool exists then returns it's full path. Args: tool (string): tool name @@ -21,7 +21,7 @@ def get_ffmpeg_tool_path(tool="ffmpeg"): (str): tool name itself when tool path was not found. (FFmpeg path may be set in PATH environment variable) """ - dir_paths = get_paths_from_environ("FFMPEG_PATH") + dir_paths = get_paths_from_environ("OPENPYPE_FFMPEG_PATH") for dir_path in dir_paths: for file_name in os.listdir(dir_path): base, _ext = os.path.splitext(file_name) From 5c0332c83ca6962c1afed49f8d3e87e2b1728dee Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 13 Apr 2021 11:11:33 +0200 Subject: [PATCH 09/23] added ffmpeg 4.4 windows version --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 016fc32b18..2329464997 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -81,8 +81,8 @@ build-backend = "poetry.core.masonry.api" [openpype] [openpype.thirdparty.ffmpeg.windows] -url = "https://distribute.openpype.io/thirdparty/ffmpeg-4.13-windows.zip" -hash = "43988ebcba98313635f06f2ca7e2dd52670710ebceefaa77107321b1def30472" +url = "https://distribute.openpype.io/thirdparty/ffmpeg-4.4-windows.zip" +hash = "dd51ba29d64ee238e7c4c3c7301b19754c3f0ee2e2a729c20a0e2789e72db925" [openpype.thirdparty.ffmpeg.linux] url = "https://distribute.openpype.io/thirdparty/ffmpeg-4.4-linux.tar.xz" From 8c65591948c4ac2a34181137dc5b97761f7157d3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 13 Apr 2021 11:24:29 +0200 Subject: [PATCH 10/23] replaced tar.xz with tgz files --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2329464997..6a24dfb524 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,12 +85,12 @@ url = "https://distribute.openpype.io/thirdparty/ffmpeg-4.4-windows.zip" hash = "dd51ba29d64ee238e7c4c3c7301b19754c3f0ee2e2a729c20a0e2789e72db925" [openpype.thirdparty.ffmpeg.linux] -url = "https://distribute.openpype.io/thirdparty/ffmpeg-4.4-linux.tar.xz" -hash = "acc7fa366ae2c35b69b72d7a92a29daa6f31739dbf365fb64ef6220e9a16fa37" +url = "https://distribute.openpype.io/thirdparty/ffmpeg-4.4-linux.tgz" +hash = "10b9beda57cfbb69b9ed0ce896c0c8d99227b26ca8b9f611040c4752e365cbe9" [openpype.thirdparty.ffmpeg.darwin] -url = "https://distribute.openpype.io/thirdparty/ffmpeg-4.4-macos.tar.xz" -hash = "b8088a399cd387dfeb0b951a1ca1d477d3dd96a67fdd79927b1ef083d6d6c7a9" +url = "https://distribute.openpype.io/thirdparty/ffmpeg-4.4-macos.tgz" +hash = "95f43568338c275f80dc0cab1e1836a2e2270f856f0e7b204440d881dd74fbdb" [openpype.thirdparty.oiio.windows] url = "https://distribute.openpype.io/thirdparty/oiio_tools-2.2.0-windows.zip" From 82cbcd7b43aec3de8533f74cc679440b0400f3c5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 13 Apr 2021 11:28:29 +0200 Subject: [PATCH 11/23] fix ffmpeg path join --- start.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start.py b/start.py index f963c3be7a..09ffb521c9 100644 --- a/start.py +++ b/start.py @@ -162,7 +162,7 @@ def set_openpype_global_environments() -> None: if platform_name == "windows": ffmpeg_path_parts.append("bin") - ffmpeg_path = os.path.join(ffmpeg_path_parts) + ffmpeg_path = os.path.join(*ffmpeg_path_parts) os.environ["OPENPYPE_FFMPEG_PATH"] = ffmpeg_path From a24c0d1a378088622ab2185ce69573283aa743a4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 13 Apr 2021 11:28:39 +0200 Subject: [PATCH 12/23] removed FFMPEG_PATH from default environments --- openpype/settings/defaults/system_settings/general.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/openpype/settings/defaults/system_settings/general.json b/openpype/settings/defaults/system_settings/general.json index d93d2a0c3a..2568e8b6a8 100644 --- a/openpype/settings/defaults/system_settings/general.json +++ b/openpype/settings/defaults/system_settings/general.json @@ -2,15 +2,9 @@ "studio_name": "Studio name", "studio_code": "stu", "environment": { - "FFMPEG_PATH": { - "windows": "{OPENPYPE_ROOT}/vendor/bin/ffmpeg_exec/windows/bin", - "darwin": "{OPENPYPE_ROOT}/vendor/bin/ffmpeg_exec/darwin/bin", - "linux": ":{OPENPYPE_ROOT}/vendor/bin/ffmpeg_exec/linux" - }, "OPENPYPE_OCIO_CONFIG": "{STUDIO_SOFT}/OpenColorIO-Configs", "__environment_keys__": { "global": [ - "FFMPEG_PATH", "OPENPYPE_OCIO_CONFIG" ] } From f538e741633a089a5f204c8b21740585025eaf02 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 13 Apr 2021 12:43:18 +0200 Subject: [PATCH 13/23] start.py has defined global variable BUILD_ROOT --- start.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/start.py b/start.py index 09ffb521c9..551b2a9dee 100644 --- a/start.py +++ b/start.py @@ -101,10 +101,17 @@ import subprocess import site from pathlib import Path -# add dependencies folder to sys.pat for frozen code -if getattr(sys, 'frozen', False): +# BUILD_ROOT is variable pointing to build (or code) directory +if not getattr(sys, 'frozen', False): + # Code root defined by `start.py` directory + BUILD_ROOT = os.path.dirname(os.path.abspath(__file__)) +else: + BUILD_ROOT = os.path.dirname(sys.executable) + + # add dependencies folder to sys.pat for frozen code frozen_libs = os.path.normpath( - os.path.join(os.path.dirname(sys.executable), "dependencies")) + os.path.join(BUILD_ROOT, "dependencies") + ) sys.path.append(frozen_libs) # add stuff from `/dependencies` to PYTHONPATH. pythonpath = os.getenv("PYTHONPATH", "") From 4793f8dea3516d52c269467cdaf06166dd61bd48 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 13 Apr 2021 12:43:49 +0200 Subject: [PATCH 14/23] use BUILD_ROOT in start.py code --- start.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/start.py b/start.py index 551b2a9dee..5f1f95940d 100644 --- a/start.py +++ b/start.py @@ -155,11 +155,7 @@ def set_openpype_global_environments() -> None: # --- Set environment variables to vendorized binaries(FFmpeg and OIIO) --- # TODO add validations of existing binaries # Prepare path to bin vendor directory - bin_vendor_dir = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "vendor", - "bin" - ) + bin_vendor_dir = os.path.join(BUILD_ROOT, "vendor", "bin") # Prepare platform name platform_name = platform.system().lower() @@ -498,16 +494,12 @@ def _bootstrap_from_code(use_version): # run through repos and add them to `sys.path` and `PYTHONPATH` # set root if getattr(sys, 'frozen', False): - openpype_root = os.path.normpath( - os.path.dirname(sys.executable)) + openpype_root = os.path.normpath(BUILD_ROOT) local_version = bootstrap.get_version(Path(openpype_root)) print(f" - running version: {local_version}") assert local_version else: - openpype_root = os.path.normpath( - os.path.dirname( - os.path.dirname( - os.path.realpath(igniter.__file__)))) + openpype_root = os.path.normpath(BUILD_ROOT) # get current version of OpenPype local_version = bootstrap.get_local_live_version() @@ -602,10 +594,7 @@ def boot(): # ------------------------------------------------------------------------ # set OPENPYPE_ROOT to running location until proper version can be # determined. - if getattr(sys, 'frozen', False): - os.environ["OPENPYPE_ROOT"] = os.path.dirname(sys.executable) - else: - os.environ["OPENPYPE_ROOT"] = os.path.dirname(__file__) + os.environ["OPENPYPE_ROOT"] = BUILD_ROOT # Get openpype path from database and set it to environment so openpype can # find its versions there and bootstrap them. From c4af254d65b7ec2f20633f24d5e53c703087ffcc Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 14 Apr 2021 14:25:53 +0200 Subject: [PATCH 15/23] don't set environment variables for ffmpeg and oiio --- start.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/start.py b/start.py index 0a31490832..a2a03f112c 100644 --- a/start.py +++ b/start.py @@ -95,7 +95,6 @@ Attributes: import os import re import sys -import platform import traceback import subprocess import site @@ -155,27 +154,6 @@ def set_openpype_global_environments() -> None: if "QT_AUTO_SCREEN_SCALE_FACTOR" not in os.environ: os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1" - # --- Set environment variables to vendorized binaries(FFmpeg and OIIO) --- - # TODO add validations of existing binaries - # Prepare path to bin vendor directory - bin_vendor_dir = os.path.join(BUILD_ROOT, "vendor", "bin") - # Prepare platform name - platform_name = platform.system().lower() - - # FFmpeg path - ffmpeg_path_parts = [bin_vendor_dir, "ffmpeg", platform_name] - # Windows version has executables in `bin` directory - if platform_name == "windows": - ffmpeg_path_parts.append("bin") - - ffmpeg_path = os.path.join(*ffmpeg_path_parts) - - os.environ["OPENPYPE_FFMPEG_PATH"] = ffmpeg_path - - # OIIO path - oiio_path = os.path.join(bin_vendor_dir, "oiio", platform_name) - os.environ["OPENPYPE_OIIO_PATH"] = oiio_path - def run(arguments: list, env: dict = None) -> int: """Use correct executable to run stuff. From 391a1e024403d4f4fda16d0ccfb4eda478444094 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 14 Apr 2021 15:05:15 +0200 Subject: [PATCH 16/23] added function get_vendor_bin_path to get binary path --- openpype/lib/ffmpeg_utils.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/openpype/lib/ffmpeg_utils.py b/openpype/lib/ffmpeg_utils.py index de02455f9a..67fbc9f4b3 100644 --- a/openpype/lib/ffmpeg_utils.py +++ b/openpype/lib/ffmpeg_utils.py @@ -1,6 +1,7 @@ import os import logging import json +import platform import subprocess from . import get_paths_from_environ @@ -8,6 +9,29 @@ from . import get_paths_from_environ log = logging.getLogger("FFmpeg utils") +def get_vendor_bin_path(bin_app): + """Path to OpenPype vendorized binaries. + + Vendorized executables are expected in specific hierarchy inside build or + in code source. + + "{OPENPYPE_ROOT}/vendor/bin/{name of vendorized app}/{platform}" + + Args: + bin_app (str): Name of vendorized application. + + Returns: + str: Path to vendorized binaries folder. + """ + return os.path.join( + os.environ["OPENPYPE_ROOT"], + "vendor", + "bin", + bin_app, + platform.system().lower() + ) + + def get_ffmpeg_tool_path(tool="ffmpeg"): """Find path to ffmpeg tool in OPENPYPE_FFMPEG_PATH paths. From 8e2b7edc69263dc5a231d1d627d9c8071bd11f2b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 14 Apr 2021 15:06:58 +0200 Subject: [PATCH 17/23] modified ffmpeg path getter --- openpype/lib/ffmpeg_utils.py | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/openpype/lib/ffmpeg_utils.py b/openpype/lib/ffmpeg_utils.py index 67fbc9f4b3..edb2e903f5 100644 --- a/openpype/lib/ffmpeg_utils.py +++ b/openpype/lib/ffmpeg_utils.py @@ -4,8 +4,6 @@ import json import platform import subprocess -from . import get_paths_from_environ - log = logging.getLogger("FFmpeg utils") @@ -31,27 +29,21 @@ def get_vendor_bin_path(bin_app): platform.system().lower() ) - -def get_ffmpeg_tool_path(tool="ffmpeg"): - """Find path to ffmpeg tool in OPENPYPE_FFMPEG_PATH paths. - Function looks for tool in paths set in OPENPYPE_FFMPEG_PATH environment. - If tool exists then returns it's full path. +def get_ffmpeg_tool_path(tool="ffmpeg"): + """Path to vendorized FFmpeg executable. Args: - tool (string): tool name + tool (string): Tool name (ffmpeg, ffprobe, ...). + Default is "ffmpeg". Returns: - (str): tool name itself when tool path was not found. (FFmpeg path - may be set in PATH environment variable) + str: Full path to ffmpeg executable. """ - dir_paths = get_paths_from_environ("OPENPYPE_FFMPEG_PATH") - for dir_path in dir_paths: - for file_name in os.listdir(dir_path): - base, _ext = os.path.splitext(file_name) - if base.lower() == tool.lower(): - return os.path.join(dir_path, tool) - return tool + ffmpeg_dir = get_vendor_bin_path("ffmpeg") + if platform.system().lower() == "windows": + ffmpeg_dir = os.path.join(ffmpeg_dir, "bin") + return os.path.join(ffmpeg_dir, tool) def ffprobe_streams(path_to_file, logger=None): From 222e13033272cbf389e9255dad4cba56b36b2011 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 14 Apr 2021 15:08:16 +0200 Subject: [PATCH 18/23] added oiio tools path getter --- openpype/lib/ffmpeg_utils.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/openpype/lib/ffmpeg_utils.py b/openpype/lib/ffmpeg_utils.py index edb2e903f5..3b923cb608 100644 --- a/openpype/lib/ffmpeg_utils.py +++ b/openpype/lib/ffmpeg_utils.py @@ -30,6 +30,17 @@ def get_vendor_bin_path(bin_app): ) +def get_oiio_tools_path(tool="oiiotool"): + """Path to vendorized OpenImageIO tool executables. + + Args: + tool (string): Tool name (oiiotool, maketx, ...). + Default is "oiiotool". + """ + oiio_dir = get_vendor_bin_path("oiio") + return os.path.join(oiio_dir, tool) + + def get_ffmpeg_tool_path(tool="ffmpeg"): """Path to vendorized FFmpeg executable. From 23229d01c07718808423a29885dbb38496d6eb3c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 14 Apr 2021 15:09:46 +0200 Subject: [PATCH 19/23] import new functions to lib init --- openpype/lib/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openpype/lib/__init__.py b/openpype/lib/__init__.py index 2c1c70e663..bbb33189a1 100644 --- a/openpype/lib/__init__.py +++ b/openpype/lib/__init__.py @@ -117,6 +117,8 @@ from .path_tools import ( ) from .ffmpeg_utils import ( + get_vendor_bin_path, + get_oiio_tools_path, get_ffmpeg_tool_path, ffprobe_streams ) @@ -199,8 +201,10 @@ __all__ = [ "get_version_from_path", "get_last_version_from_path", - "ffprobe_streams", + "get_vendor_bin_path", + "get_oiio_tools_path", "get_ffmpeg_tool_path", + "ffprobe_streams", "terminal", From f9232e239792e600ab275eeab7703570e6fdf567 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 14 Apr 2021 15:12:13 +0200 Subject: [PATCH 20/23] renamed ffmpeg_utils to vendor_bin_utils --- openpype/lib/__init__.py | 24 +++++++++---------- .../{ffmpeg_utils.py => vendor_bin_utils.py} | 0 2 files changed, 12 insertions(+), 12 deletions(-) rename openpype/lib/{ffmpeg_utils.py => vendor_bin_utils.py} (100%) diff --git a/openpype/lib/__init__.py b/openpype/lib/__init__.py index bbb33189a1..b601733ffe 100644 --- a/openpype/lib/__init__.py +++ b/openpype/lib/__init__.py @@ -39,6 +39,13 @@ from .env_tools import ( get_global_environments ) +from .vendor_bin_utils import ( + get_vendor_bin_path, + get_oiio_tools_path, + get_ffmpeg_tool_path, + ffprobe_streams +) + from .python_module_tools import ( modules_from_path, recursive_bases_from_class, @@ -116,13 +123,6 @@ from .path_tools import ( get_last_version_from_path ) -from .ffmpeg_utils import ( - get_vendor_bin_path, - get_oiio_tools_path, - get_ffmpeg_tool_path, - ffprobe_streams -) - from .editorial import ( is_overlapping_otio_ranges, otio_range_to_frame_range, @@ -145,6 +145,11 @@ __all__ = [ "get_paths_from_environ", "get_global_environments", + "get_vendor_bin_path", + "get_oiio_tools_path", + "get_ffmpeg_tool_path", + "ffprobe_streams", + "modules_from_path", "recursive_bases_from_class", "classes_from_module", @@ -201,11 +206,6 @@ __all__ = [ "get_version_from_path", "get_last_version_from_path", - "get_vendor_bin_path", - "get_oiio_tools_path", - "get_ffmpeg_tool_path", - "ffprobe_streams", - "terminal", "merge_dict", diff --git a/openpype/lib/ffmpeg_utils.py b/openpype/lib/vendor_bin_utils.py similarity index 100% rename from openpype/lib/ffmpeg_utils.py rename to openpype/lib/vendor_bin_utils.py From 203c32183d7d7469ad0df26a0433fd633c277538 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 14 Apr 2021 15:14:50 +0200 Subject: [PATCH 21/23] replaced usage of OPENPYPE_OIIO_PATH env with get_oiio_tools_path function --- openpype/lib/plugin_tools.py | 7 ++++--- openpype/plugins/publish/extract_scanline_exr.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openpype/lib/plugin_tools.py b/openpype/lib/plugin_tools.py index eb024383d3..b9427f06be 100644 --- a/openpype/lib/plugin_tools.py +++ b/openpype/lib/plugin_tools.py @@ -9,6 +9,7 @@ import tempfile from .execute import run_subprocess from .profiles_filtering import filter_profiles +from .vendor_bin_utils import get_oiio_tools_path from openpype.settings import get_project_settings @@ -235,7 +236,7 @@ def oiio_supported(): Returns: (bool) """ - oiio_path = os.getenv("OPENPYPE_OIIO_PATH", "") + oiio_path = get_oiio_tools_path() if not oiio_path or not os.path.exists(oiio_path): log.debug("OIIOTool is not configured or not present at {}". format(oiio_path)) @@ -269,7 +270,7 @@ def decompress(target_dir, file_url, (int(input_frame_end) > int(input_frame_start)) oiio_cmd = [] - oiio_cmd.append(os.getenv("OPENPYPE_OIIO_PATH")) + oiio_cmd.append(get_oiio_tools_path()) oiio_cmd.append("--compression none") @@ -328,7 +329,7 @@ def should_decompress(file_url): """ if oiio_supported(): output = run_subprocess([ - os.getenv("OPENPYPE_OIIO_PATH"), + get_oiio_tools_path(), "--info", "-v", file_url]) return "compression: \"dwaa\"" in output or \ "compression: \"dwab\"" in output diff --git a/openpype/plugins/publish/extract_scanline_exr.py b/openpype/plugins/publish/extract_scanline_exr.py index 404aa65ac2..a7f7de5188 100644 --- a/openpype/plugins/publish/extract_scanline_exr.py +++ b/openpype/plugins/publish/extract_scanline_exr.py @@ -45,7 +45,7 @@ class ExtractScanlineExr(pyblish.api.InstancePlugin): stagingdir = os.path.normpath(repre.get("stagingDir")) - oiio_tool_path = os.getenv("OPENPYPE_OIIO_PATH", "") + oiio_tool_path = openpype.lib.get_oiio_tools_path() if not os.path.exists(oiio_tool_path): self.log.error( "OIIO tool not found in {}".format(oiio_tool_path)) From a03d7bafcb13207ce61fc153f11c29f061546971 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 14 Apr 2021 15:49:54 +0200 Subject: [PATCH 22/23] fix end of line --- openpype/settings/defaults/system_settings/general.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/settings/defaults/system_settings/general.json b/openpype/settings/defaults/system_settings/general.json index e4f060dc83..2568e8b6a8 100644 --- a/openpype/settings/defaults/system_settings/general.json +++ b/openpype/settings/defaults/system_settings/general.json @@ -14,4 +14,4 @@ "darwin": [], "linux": [] } -} +} \ No newline at end of file From dbc8268bce1b2321dd8f64562c0d25a127cefe5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= <33513211+antirotor@users.noreply.github.com> Date: Wed, 14 Apr 2021 16:12:45 +0200 Subject: [PATCH 23/23] fix comment is ps1 --- tools/fetch_thirdparty_libs.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/fetch_thirdparty_libs.ps1 b/tools/fetch_thirdparty_libs.ps1 index f79cfdd267..d1b914fac2 100644 --- a/tools/fetch_thirdparty_libs.ps1 +++ b/tools/fetch_thirdparty_libs.ps1 @@ -5,7 +5,6 @@ .DESCRIPTION This will download third-party dependencies specified in pyproject.toml and extract them to vendor/bin folder. - #> .EXAMPLE