1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-06 19:12:30 +01:00

Add automatic requirements installation

This commit is contained in:
Elias Steurer 2022-07-22 12:31:52 +02:00
parent 2d91cfa2bc
commit cda5aeeb85
4 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,10 @@
#!/usr/bin/python3
import os
import sys
import subprocess
def install_requirements():
print("Set up required python modules")
script_path = os.path.dirname(os.path.realpath(__file__))
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", script_path + "/requirements.txt"])

3
Tools/requirements.txt Normal file
View File

@ -0,0 +1,3 @@
pyunpack
py7zr
cmake-format

View File

@ -1,5 +1,9 @@
#!/usr/bin/python3
from install_requirements import install_requirements
install_requirements()
import argparse
import shutil
from platform import system

13
Tools/util.py Normal file
View File

@ -0,0 +1,13 @@
from pathlib import Path
from os import chdir
def cd_repo_root_path() -> str:
# Make sure the script is always started from the same
# ScreenPlay root folder
root_path = Path.cwd()
if root_path.name == "Tools":
root_path = root_path.parent
print(f"Change root directory to: {root_path}")
chdir(root_path)
return root_path