mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-07 03:22:33 +01:00
Add automatic requirements installation
This commit is contained in:
parent
2d91cfa2bc
commit
cda5aeeb85
10
Tools/install_requirements.py
Normal file
10
Tools/install_requirements.py
Normal 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
3
Tools/requirements.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
pyunpack
|
||||||
|
py7zr
|
||||||
|
cmake-format
|
@ -1,5 +1,9 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
from install_requirements import install_requirements
|
||||||
|
|
||||||
|
install_requirements()
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import shutil
|
import shutil
|
||||||
from platform import system
|
from platform import system
|
||||||
|
13
Tools/util.py
Normal file
13
Tools/util.py
Normal 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
|
Loading…
Reference in New Issue
Block a user