Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
rerpha committed Dec 16, 2024
1 parent c916506 commit 585bf1d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions installation_and_upgrade/IBEX_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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 = [
Expand Down Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import glob
import os
import platform
import shutil
import subprocess
import time
Expand Down Expand Up @@ -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:
Expand All @@ -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,
Expand All @@ -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)

Expand Down

0 comments on commit 585bf1d

Please sign in to comment.