Skip to content

Commit

Permalink
create venv if it doesnt exist
Browse files Browse the repository at this point in the history
  • Loading branch information
TNTwise committed Nov 20, 2024
1 parent 5ff63c9 commit eba3abd
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def build_resources():
)


def create_venv(python_version="python3.11"):
def create_venv():
print("Creating virtual environment")
command = [python_version, "-m", "venv", "venv"]
subprocess.run(command)
Expand Down Expand Up @@ -135,16 +135,22 @@ def clean():
os.remove("get-pip.py")



def build_venv():
create_venv()
install_pip_in_venv()
install_requirements_in_venv()


if len(sys.argv) > 1:
if sys.argv[1] == "--create_venv" or sys.argv[1] == "--build_exe":
create_venv(python_version=python_version)
install_pip_in_venv()
install_requirements_in_venv()
build_venv()

if not os.path.exists("venv"):
build_venv()

build_gui()
build_resources()

if len(sys.argv) > 1:
if sys.argv[1] == "--build_exe":
build_executable()
Expand Down

0 comments on commit eba3abd

Please sign in to comment.