From ce0d85b6590ad1db11a51d1d0e1b4da4cbb72035 Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Mon, 10 Jul 2017 16:29:04 +0300 Subject: [PATCH] Run pre-build tasks only when the appropriate cmd gets supplied --- setup.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 266f040..4c97e84 100644 --- a/setup.py +++ b/setup.py @@ -55,6 +55,9 @@ import glob from shutil import copyfile from subprocess import call +# Commands that run the pre-build tasks +EXEC_PRE_COMMANDS = ["py2exe", "install", "bdist", "build"] + PY2EXE = len(sys.argv) >= 2 and sys.argv[1] == "py2exe" if PY2EXE: @@ -216,9 +219,10 @@ def windows_setup(): return normal_setup() -# Execute pre-build stuff -create_scripts() -build_translations() +# Execute pre-build tasks +if any(command in sys.argv for command in EXEC_PRE_COMMANDS): + create_scripts() + build_translations() if os.name == "nt": params = windows_setup()