mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
e06fe8a52a
Apply black formatting to codebase
28 lines
654 B
Python
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()
|