@@ -14,9 +14,9 @@ class WheelInfo:
1414 """
1515
1616 module : str
17- windows_whl : str
18- linux_x64_whl : str
19- linux_aarch_whl : str
17+ windows_whl : str = ""
18+ linux_x64_whl : str = ""
19+ linux_aarch_whl : str = ""
2020
2121
2222class WheelInstaller :
@@ -34,34 +34,36 @@ def __init__(self, info: WheelInfo, extension_module="cesium.omniverse"):
3434 :raises ValueError: If any arguments are null or empty strings.
3535 """
3636 self ._logger = logging .getLogger (__name__ )
37-
38- if (
39- str_is_empty_or_none (info .windows_whl )
40- or str_is_empty_or_none (info .linux_x64_whl )
41- or str_is_empty_or_none (info .linux_aarch_whl )
42- ):
43- raise ValueError (f"One or more wheels is missing for { info .module } ." )
44-
4537 self ._info = info
4638
4739 manager = app .get_app ().get_extension_manager ()
4840 ext_id = manager .get_extension_id_by_module (extension_module )
4941 self ._vendor_directory_path = Path (manager .get_extension_path (ext_id )).joinpath ("vendor" )
5042
43+ def _get_wheel_for_platform (self ) -> str :
44+ """
45+ Gets the appropriate wheel filename for the current platform.
46+ """
47+ if platform .system () == "Windows" :
48+ return self ._info .windows_whl
49+
50+ machine = platform .machine ()
51+ if machine .startswith ("arm" ) or machine .startswith ("aarch" ):
52+ return self ._info .linux_aarch_whl
53+
54+ return self ._info .linux_x64_whl
55+
5156 def install (self ) -> bool :
5257 """
5358 Installs the correct wheel for the current platform.
5459
5560 :return: ``True`` if the installation was successful.
5661 """
57-
58- if platform .system () == "Windows" :
59- return self ._perform_install (self ._info .windows_whl )
60- else :
61- machine = platform .machine ()
62- if machine .startswith ("arm" ) or machine .startswith ("aarch" ):
63- return self ._perform_install (self ._info .linux_aarch_whl )
64- return self ._perform_install (self ._info .linux_x64_whl )
62+ wheel = self ._get_wheel_for_platform ()
63+ if str_is_empty_or_none (wheel ):
64+ self ._logger .error (f"No wheel available for { self ._info .module } on this platform" )
65+ return False
66+ return self ._perform_install (wheel )
6567
6668 def _perform_install (self , wheel_file_name : str ) -> bool :
6769 """
0 commit comments