Skip to content

Commit

Permalink
Merge pull request #4418 from ynput/bugfix/OP-4513_Deadline-on-MacOS
Browse files Browse the repository at this point in the history
Fix: DL on MacOS
  • Loading branch information
kalisp committed Feb 9, 2023
2 parents a0b01a8 + 3ac0a1c commit 7afbd4b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, major, minor, patch, prerelease, origin=None):
self.prerelease = prerelease

is_valid = True
if not major or not minor or not patch:
if major is None or minor is None or patch is None:
is_valid = False
self.is_valid = is_valid

Expand Down Expand Up @@ -157,7 +157,7 @@ def get_openpype_version_from_path(path, build=True):

# fix path for application bundle on macos
if platform.system().lower() == "darwin":
path = os.path.join(path, "Contents", "MacOS", "lib", "Python")
path = os.path.join(path, "MacOS")

version_file = os.path.join(path, "openpype", "version.py")
if not os.path.isfile(version_file):
Expand Down Expand Up @@ -189,6 +189,11 @@ def get_openpype_executable():
exe_list = config.GetConfigEntryWithDefault("OpenPypeExecutable", "")
dir_list = config.GetConfigEntryWithDefault(
"OpenPypeInstallationDirs", "")

# clean '\ ' for MacOS pasting
if platform.system().lower() == "darwin":
exe_list = exe_list.replace("\\ ", " ")
dir_list = dir_list.replace("\\ ", " ")
return exe_list, dir_list


Expand Down Expand Up @@ -218,8 +223,8 @@ def get_requested_openpype_executable(
requested_version_obj = OpenPypeVersion.from_string(requested_version)
if not requested_version_obj:
print((
">>> Requested version does not match version regex \"{}\""
).format(VERSION_REGEX))
">>> Requested version '{}' does not match version regex '{}'"
).format(requested_version, VERSION_REGEX))
return None

print((
Expand Down Expand Up @@ -272,7 +277,8 @@ def get_requested_openpype_executable(
# Deadline decide.
exe_list = [
os.path.join(version_dir, "openpype_console.exe"),
os.path.join(version_dir, "openpype_console")
os.path.join(version_dir, "openpype_console"),
os.path.join(version_dir, "MacOS", "openpype_console")
]
return FileUtils.SearchFileList(";".join(exe_list))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def get_openpype_version_from_path(path, build=True):
"""
# fix path for application bundle on macos
if platform.system().lower() == "darwin":
path = os.path.join(path, "Contents", "MacOS", "lib", "Python")
path = os.path.join(path, "MacOS")

version_file = os.path.join(path, "openpype", "version.py")
if not os.path.isfile(version_file):
Expand Down Expand Up @@ -107,8 +107,11 @@ def RenderExecutable(self):
"Scanning for compatible requested "
f"version {requested_version}"))
dir_list = self.GetConfigEntry("OpenPypeInstallationDirs")
# clean '\ ' for MacOS pasting
if platform.system().lower() == "darwin":
dir_list = dir_list.replace("\\ ", " ")
install_dir = DirectoryUtils.SearchDirectoryList(dir_list)
if dir:
if install_dir:
sub_dirs = [
f.path for f in os.scandir(install_dir)
if f.is_dir()
Expand All @@ -120,6 +123,9 @@ def RenderExecutable(self):
openpype_versions.append((version, subdir))

exe_list = self.GetConfigEntry("OpenPypeExecutable")
# clean '\ ' for MacOS pasting
if platform.system().lower() == "darwin":
exe_list = exe_list.replace("\\ ", " ")
exe = FileUtils.SearchFileList(exe_list)
if openpype_versions:
# if looking for requested compatible version,
Expand Down Expand Up @@ -161,7 +167,9 @@ def RenderExecutable(self):
os.path.join(
compatible_versions[-1][1], "openpype_console.exe"),
os.path.join(
compatible_versions[-1][1], "openpype_console")
compatible_versions[-1][1], "openpype_console"),
os.path.join(
compatible_versions[-1][1], "MacOS", "openpype_console")
]
exe = FileUtils.SearchFileList(";".join(exe_list))

Expand Down

0 comments on commit 7afbd4b

Please sign in to comment.