From 585bf1d014b87d31f585a6aea51aefd52d049172 Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Mon, 16 Dec 2024 15:20:03 +0000 Subject: [PATCH] ruff --- installation_and_upgrade/IBEX_upgrade.py | 8 ++++---- .../ibex_install_utils/tasks/system_tasks.py | 11 +++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/installation_and_upgrade/IBEX_upgrade.py b/installation_and_upgrade/IBEX_upgrade.py index 1eba95a..bac772f 100644 --- a/installation_and_upgrade/IBEX_upgrade.py +++ b/installation_and_upgrade/IBEX_upgrade.py @@ -16,7 +16,7 @@ from ibex_install_utils.user_prompt import UserPrompt -def _get_latest_release_path(release_dir): +def _get_latest_release_path(release_dir: str) -> str: regex = re.compile(r"^\d+\.\d+\.\d+$") releases = [ @@ -32,7 +32,7 @@ def _get_latest_release_path(release_dir): return os.path.join(release_dir, f"{current_release}") -def _get_latest_existing_dir_path(release_dir, component): +def _get_latest_existing_dir_path(release_dir: str, component: str) -> str: regex = re.compile(r"^\d+\.\d+\.\d+$") releases = [ @@ -171,8 +171,8 @@ def _get_latest_existing_dir_path(release_dir, component): ) except UserStop: print( - "To specify the directory you want use --server_dir, --client_dir, and --genie_python3_dir " - "when running the IBEX_upgrade.py script." + "To specify the directory you want use --server_dir, --client_dir, and" + " --genie_python3_dir when running the IBEX_upgrade.py script." ) sys.exit(2) diff --git a/installation_and_upgrade/ibex_install_utils/tasks/system_tasks.py b/installation_and_upgrade/ibex_install_utils/tasks/system_tasks.py index 9dcc346..7210fea 100644 --- a/installation_and_upgrade/ibex_install_utils/tasks/system_tasks.py +++ b/installation_and_upgrade/ibex_install_utils/tasks/system_tasks.py @@ -1,6 +1,5 @@ import glob import os -import platform import shutil import subprocess import time @@ -434,7 +433,7 @@ def install_or_upgrade_vc_redist(self) -> None: print(f"Installing vc_redist for arch: {arch}") - files_to_run = [f"vc_redist.x64.exe"] + files_to_run = ["vc_redist.x64.exe"] if arch == "x86": files_to_run.insert(0, "vc_redist.x86.exe") for file in files_to_run: @@ -444,8 +443,8 @@ def install_or_upgrade_vc_redist(self) -> None: VAR_DIR, "logs", "deploy", f"vc_redist_log{time.strftime('%Y%m%d%H%M%S')}.txt" ) - # AdminRunner doesn't seem to work here, saying it can't find a handle, so just run as a - # normal command as the process itself prompts for admin. + # AdminRunner doesn't seem to work here, saying it can't find a handle, so just + # run as a normal command as the process itself prompts for admin. RunProcess( working_dir=str(exe_file.parent), executable_file=exe_file.name, @@ -460,8 +459,8 @@ def install_or_upgrade_vc_redist(self) -> None: expected_return_codes=[0], ).run() - # vc_redist helpfully finishes with errorlevel 0 before actually copying the files over. - # therefore we'll sleep for 5 seconds here + # vc_redist helpfully finishes with errorlevel 0 before actually + # copying the files over, therefore we'll sleep for 5 seconds here print("waiting for install to finish") sleep(5)