Start: Add --force-reinstall argument

Forces a reinstall of dependencies in the event that one is corrupted
or broken.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri 2024-08-04 11:14:38 -04:00
parent ab6c3a53b9
commit 34281c2e14

View file

@ -108,6 +108,12 @@ def add_start_args(parser: argparse.ArgumentParser):
action="store_true",
help="Update all pip dependencies",
)
start_group.add_argument(
"-fr",
"--force-reinstall",
action="store_true",
help="Forces a reinstall of dependencies. Only works with --update-deps",
)
start_group.add_argument(
"-nw",
"--nowheel",
@ -198,13 +204,19 @@ if __name__ == "__main__":
subprocess.run(pull_command.split(" "))
if first_run or args.update_deps:
install_command = ["pip", "install", "-U"]
# Force a reinstall of the updated dependency if needed
if args.force_reinstall:
install_command.append("--force-reinstall")
install_features = None if args.nowheel else get_install_features(gpu_lib)
features = f"[{install_features}]" if install_features else ""
features = f".[{install_features}]" if install_features else "."
install_command.append(features)
# pip install .[features]
install_command = f"pip install -U .{features}"
print(f"Running install command: {install_command}")
subprocess.run(install_command.split(" "))
print(f"Running install command: {' '.join(install_command)}")
subprocess.run(install_command)
print()
if args.update_deps: