crafty-4/app/classes/shared/installer.py
Zedifus e06fe8a52a Black codebase
Apply black formatting to codebase
2022-03-23 02:50:12 +00:00

28 lines
654 B
Python

import sys
import subprocess
class install:
@staticmethod
def is_venv():
return hasattr(sys, "real_prefix") or (
hasattr(sys, "base_prefix") and sys.base_prefix != sys.prefix
)
def do_install(self):
# are we in a venv?
if not self.is_venv():
print("Crafty Requires a venv to install")
sys.exit(1)
# do our pip install
subprocess.check_call(
[sys.executable, "-m", "pip", "install", "-r", "requirements.txt"]
)
print("Crafty has installed it's dependencies, please restart Crafty")
sys.exit(0)
installer = install()