From dbac164421e2ef04458bf50b12b151f5d7b6eaa5 Mon Sep 17 00:00:00 2001 From: tntwise Date: Wed, 21 Aug 2024 00:48:32 +0000 Subject: [PATCH] use venv for all building --- build.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 1bd4150e..ec90f8fb 100644 --- a/build.py +++ b/build.py @@ -39,14 +39,23 @@ def install_requirements_in_venv(): "-r", "requirements.txt", ] - subprocess.run(command) - + + else: + command = [ + "venv/bin/python3", + "-m", + "pip", + "install", + "-r", + "requirements.txt", + ] + subprocess.run(command) def build_executable(): if getPlatform() == "linux" or getPlatform() == "darwin": command = [ - "python3", + "venv/bin/python3", "-m", "PyInstaller", "main.py", @@ -54,7 +63,6 @@ def build_executable(): "--noconfirm", "--noupx", ] - subprocess.run(command) if getPlatform() == "win32": command = [ r".\venv\Scripts\python.exe", @@ -66,8 +74,7 @@ def build_executable(): "--noupx", ] - subprocess.run(command) - # copy("backend","dist\\main\\backend") + subprocess.run(command) create_venv()