aboutsummaryrefslogtreecommitdiffstats
path: root/coin_build_instructions.py
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@qt.io>2020-11-30 14:38:03 +0200
committerSimo Fält <simo.falt@qt.io>2020-11-30 13:08:05 +0000
commitf67d44292f0584c0718792653fad4b9746e64595 (patch)
treec64759ae7942773cc1f479faad75e522ef046413 /coin_build_instructions.py
parent030df46c83c12216eb63c280aa3390cc3ab4ea27 (diff)
Remove python2 build and test calls from CI scripts
Change-Id: I3933c92905bc83e2d59f368c2c7fd5380408b1c8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'coin_build_instructions.py')
-rw-r--r--coin_build_instructions.py21
1 files changed, 7 insertions, 14 deletions
diff --git a/coin_build_instructions.py b/coin_build_instructions.py
index 8375913b5..5281f278d 100644
--- a/coin_build_instructions.py
+++ b/coin_build_instructions.py
@@ -112,7 +112,11 @@ def call_setup(python_ver, phase):
if phase in ["BUILD"]:
rmtree(_env, True)
# Pinning the virtualenv before creating one
- run_instruction(["pip", "install", "--user", "virtualenv==20.0.25"], "Failed to pin virtualenv")
+ # Use pip3 if possible while pip seems to install the virtualenv to wrong dir in some OS
+ python3 = "python3"
+ if sys.platform == "win32":
+ python3 = os.path.join(os.getenv("PYTHON3_PATH"), "python.exe")
+ run_instruction([python3, "-m", "pip", "install", "--user", "virtualenv==20.0.25"], "Failed to pin virtualenv")
# installing to user base might not be in PATH by default.
env_path = os.path.join(site.USER_BASE, "bin")
v_env = os.path.join(env_path, "virtualenv")
@@ -161,17 +165,6 @@ def call_setup(python_ver, phase):
env = os.environ
run_instruction(cmd, "Failed to run setup.py for build", initial_env=env)
-def run_build_instructions(phase):
-
- # Uses default python, hopefully we have python2 installed on all hosts
- # Skip building using Python 2 on Windows, because of different MSVC C runtimes (VS2008 vs VS2015+)
- if CI_HOST_OS != "Windows":
- call_setup("", phase)
- # In case of packaging build, we have to build also python3 wheel
-
- if CI_RELEASE_CONF and CI_HOST_OS_VER not in ["RHEL_6_6"]:
- call_setup("3", phase)
-
if __name__ == "__main__":
# Remove some environment variables that impact cmake
@@ -180,7 +173,7 @@ if __name__ == "__main__":
del os.environ[env_var]
if CI_TEST_PHASE in ["ALL", "BUILD"]:
- run_build_instructions("BUILD")
+ call_setup("3","BUILD")
if CI_TEST_PHASE in ["ALL", "WHEEL"]:
- run_build_instructions("WHEEL")
+ call_setup("3","WHEEL")