aboutsummaryrefslogtreecommitdiff
path: root/launch.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-11-01 14:19:24 +0300
committerAUTOMATIC <16777216c@gmail.com>2022-11-01 14:20:15 +0300
commitd35bf649456da2558cbb6f2ea16fa1606022b7e7 (patch)
tree1c98a2089817786cdc0d6dfaf0f08714bfb80249 /launch.py
parentf126986b76a4129061c85cd7213cde05a2f63b33 (diff)
make launch.py run installers for extensions that have ones
add some more classes to safety module for an extension
Diffstat (limited to 'launch.py')
-rw-r--r--launch.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/launch.py b/launch.py
index 958336f2..0d90d553 100644
--- a/launch.py
+++ b/launch.py
@@ -7,6 +7,7 @@ import shlex
import platform
dir_repos = "repositories"
+dir_extensions = "extensions"
python = sys.executable
git = os.environ.get('GIT', "git")
index_url = os.environ.get('INDEX_URL', "")
@@ -101,9 +102,24 @@ def version_check(commit):
else:
print("Not a git clone, can't perform version check.")
except Exception as e:
- print("versipm check failed",e)
+ print("version check failed", e)
+
+
+def run_extensions_installers():
+ if not os.path.isdir(dir_extensions):
+ return
+
+ for dirname_extension in os.listdir(dir_extensions):
+ path_installer = os.path.join(dir_extensions, dirname_extension, "install.py")
+ if not os.path.isfile(path_installer):
+ continue
+
+ try:
+ print(run(f'"{python}" "{path_installer}"', errdesc=f"Error running install.py for extension {dirname_extension}"))
+ except Exception as e:
+ print(e, file=sys.stderr)
+
-
def prepare_enviroment():
torch_command = os.environ.get('TORCH_COMMAND', "pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113")
requirements_file = os.environ.get('REQS_FILE', "requirements_versions.txt")
@@ -189,6 +205,8 @@ def prepare_enviroment():
run_pip(f"install -r {requirements_file}", "requirements for Web UI")
+ run_extensions_installers()
+
if update_check:
version_check(commit)