-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into globe-anchors
- Loading branch information
Showing
13 changed files
with
148 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .install_lxml import * # noqa: F401 F403 | ||
from .wheel_installer import WheelInfo, WheelInstaller # noqa: F401 F403 | ||
from .vendor_install import perform_vendor_install # noqa: F401 F403 |
54 changes: 0 additions & 54 deletions
54
exts/cesium.omniverse/cesium/omniverse/install/install_lxml.py
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
exts/cesium.omniverse/cesium/omniverse/install/vendor_install.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import logging | ||
from typing import List | ||
from .wheel_installer import WheelInfo, WheelInstaller | ||
|
||
|
||
def perform_vendor_install(): | ||
logger = logging.getLogger(__name__) | ||
|
||
# Only vendor wheels for the main Cesium Omniverse extension should be placed here. | ||
# This action needs to be mirrored for each extension. | ||
vendor_wheels: List[WheelInfo] = [ | ||
WheelInfo( | ||
module="lxml", | ||
windows_whl="lxml-4.9.2-cp310-cp310-win_amd64.whl", | ||
linux_x64_whl=( | ||
"lxml-4.9.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl" | ||
), | ||
linux_aarch_whl=( | ||
"lxml-4.9.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl" | ||
), | ||
) | ||
] | ||
|
||
for w in vendor_wheels: | ||
installer = WheelInstaller(w) | ||
|
||
if not installer.install(): | ||
logger.error(f"Could not install wheel for {w.module}") |
83 changes: 83 additions & 0 deletions
83
exts/cesium.omniverse/cesium/omniverse/install/wheel_installer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
from dataclasses import dataclass | ||
import logging | ||
from pathlib import Path | ||
import platform | ||
import omni.kit.app as app | ||
import omni.kit.pipapi | ||
from ..utils.utils import str_is_empty_or_none | ||
|
||
|
||
@dataclass | ||
class WheelInfo: | ||
""" | ||
Data class containing the module and wheel file names for each platform. | ||
""" | ||
|
||
module: str | ||
windows_whl: str | ||
linux_x64_whl: str | ||
linux_aarch_whl: str | ||
|
||
|
||
class WheelInstaller: | ||
""" | ||
Class for installing wheel files bundled with the extension. | ||
""" | ||
|
||
def __init__(self, info: WheelInfo, extension_module="cesium.omniverse"): | ||
""" | ||
Creates a new instance of a wheel installer for installing a python package. | ||
:param info: A WheelInfo data class containing the information for wheel installation. | ||
:param extension_module: The full module for the extension, if a different extension is using this class. | ||
:raises ValueError: If any arguments are null or empty strings. | ||
""" | ||
self._logger = logging.getLogger(__name__) | ||
|
||
if ( | ||
str_is_empty_or_none(info.windows_whl) | ||
or str_is_empty_or_none(info.linux_x64_whl) | ||
or str_is_empty_or_none(info.linux_aarch_whl) | ||
): | ||
raise ValueError(f"One or more wheels is missing for {info.module}.") | ||
|
||
self._info = info | ||
|
||
manager = app.get_app().get_extension_manager() | ||
ext_id = manager.get_extension_id_by_module(extension_module) | ||
self._vendor_directory_path = Path(manager.get_extension_path(ext_id)).joinpath("vendor") | ||
|
||
def install(self) -> bool: | ||
""" | ||
Installs the correct wheel for the current platform. | ||
:return: ``True`` if the installation was successful. | ||
""" | ||
|
||
if platform.system() == "Windows": | ||
return self._perform_install(self._info.windows_whl) | ||
else: | ||
machine = platform.machine() | ||
if machine.startswith("arm") or machine.startswith("aarch"): | ||
return self._perform_install(self._info.linux_aarch_whl) | ||
return self._perform_install(self._info.linux_x64_whl) | ||
|
||
def _perform_install(self, wheel_file_name: str) -> bool: | ||
""" | ||
Performs the actual installation of the wheel file. | ||
:param wheel_file_name: The file name of the wheel to install. | ||
:return: ``True`` if the installation was successful. | ||
""" | ||
|
||
path = self._vendor_directory_path.joinpath(wheel_file_name) | ||
|
||
return omni.kit.pipapi.install( | ||
package=str(path), | ||
module=self._info.module, | ||
use_online_index=False, | ||
ignore_cache=True, | ||
ignore_import_check=False, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
exts/cesium.powertools/cesium/powertools/georefhelper/proj.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file added
BIN
+5.8 MB
...wertools/vendor/pyproj-3.6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Binary file not shown.
Binary file added
BIN
+7.5 MB
...powertools/vendor/pyproj-3.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Binary file not shown.
Binary file not shown.