Skip to content

Commit

Permalink
Fix Python glob bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaScheller committed Mar 21, 2024
1 parent 69c1009 commit 19680b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .github/scripts/maya.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,15 @@ def install_autodesk_product(product, version, install_dir_path):
maya_usd_sdk_extract_rpm_file_name = [f for f in os.listdir(maya_usd_sdk_extract_dir_path) if f.endswith(".rpm")][0]
maya_usd_sdk_extract_rpm_file_path = os.path.join(maya_usd_sdk_extract_dir_path, maya_usd_sdk_extract_rpm_file_name)
command = ["rpm", "-e", maya_usd_sdk_extract_rpm_file_name.replace(".rpm", "")]
process = subprocess.check_call(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
process = subprocess.check_call(command )
command = ["rpm", "-i", "--prefix", maya_usd_sdk_extract_dir_path, maya_usd_sdk_extract_rpm_file_path]
process = subprocess.check_call(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
maya_usd_sdk_extract_usd_dir_path = glob.glob("**{sep}mayausd{sep}USD".format(sep=os.path.sep), root_dir=maya_usd_sdk_extract_dir_path, recursive=True)[0]
process = subprocess.check_call(command)
maya_usd_sdk_extract_usd_dir_path = glob.glob("{root_dir}{sep}**{sep}mayausd{sep}USD".format(root_dir=maya_usd_sdk_extract_dir_path, sep=os.path.sep), recursive=True)[0]
maya_usd_sdk_extract_usd_dir_path = os.path.join(maya_usd_sdk_extract_dir_path, maya_usd_sdk_extract_usd_dir_path)
os.rename(maya_usd_sdk_extract_usd_dir_path, maya_usd_sdk_install_dir_path)
os.chmod(maya_usd_sdk_install_dir_path, 0o777)
# Maya USD SDK devkit
maya_usd_sdk_devkit_zip_file_path = glob.glob("**{}devkit.zip".format(os.path.sep), root_dir=maya_usd_sdk_install_dir_path, recursive=True)
maya_usd_sdk_devkit_zip_file_path = glob.glob("{root_dir}{sep}**{sep}devkit.zip".format(root_dir=maya_usd_sdk_extract_dir_path, sep=os.path.sep), recursive=True)
maya_usd_sdk_devkit_zip_file_path = os.path.join(maya_usd_sdk_install_dir_path, maya_usd_sdk_devkit_zip_file_path[0])
with zipfile.ZipFile(maya_usd_sdk_devkit_zip_file_path, 'r') as zip_file:
zip_file.extractall(maya_usd_sdk_devkit_install_dir_path)
Expand Down Expand Up @@ -247,12 +247,12 @@ def install_autodesk_product(product, version, install_dir_path):
logging.info("Installing Maya USD SDK")
command = ["msiexec", "/i", os.path.join(maya_usd_sdk_extract_dir_path, "MayaUSD.msi"), "/quiet", "/passive", "INSTALLDIR={}".format(maya_usd_sdk_extract_dir_path)]
process = subprocess.check_call(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
maya_usd_sdk_extract_usd_dir_path = glob.glob("**{sep}mayausd{sep}USD".format(sep=os.path.sep), root_dir=maya_usd_sdk_extract_dir_path, recursive=True)[0]
maya_usd_sdk_extract_usd_dir_path = glob.glob("{root_dir}{sep}**{sep}mayausd{sep}USD".format(root_dir=maya_usd_sdk_extract_dir_path, sep=os.path.sep), recursive=True)[0]
maya_usd_sdk_extract_usd_dir_path = os.path.join(maya_usd_sdk_extract_dir_path, maya_usd_sdk_extract_usd_dir_path)
os.rename(maya_usd_sdk_extract_usd_dir_path, maya_usd_sdk_install_dir_path)
# Maya USD DevKit
logging.info("Installing Maya USD SDK DevKit")
maya_usd_sdk_devkit_zip_file_path = glob.glob("**{}devkit.zip".format(os.path.sep), root_dir=maya_usd_sdk_install_dir_path, recursive=True)
maya_usd_sdk_devkit_zip_file_path = glob.glob("{root_dir}{sep}**{sep}devkit.zip".format(root_dir=maya_usd_sdk_extract_dir_path, sep=os.path.sep), recursive=True)
maya_usd_sdk_devkit_zip_file_path = os.path.join(maya_usd_sdk_install_dir_path, maya_usd_sdk_devkit_zip_file_path[0])
with zipfile.ZipFile(maya_usd_sdk_devkit_zip_file_path, 'r') as zip_file:
zip_file.extractall(maya_usd_sdk_devkit_install_dir_path)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_maya.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
sudo apt-get install -y build-essential cmake
sudo apt-get install -y python3 python3-pip
sudo pip3 install requests
- name: Install maya
- name: Install Maya
run: |
repo_root=$(cd .; pwd)
sudo --preserve-env python3 .github/scripts/maya.py --install --install_maya_product_name ${{ matrix.maya_product_name }} --install_maya_product_version ${{ matrix.maya_product_version }} --install_directory $repo_root/dependency
Expand Down

0 comments on commit 19680b9

Please sign in to comment.