aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--coin_build_instructions.py21
-rw-r--r--coin_test_instructions.py12
2 files changed, 13 insertions, 20 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")
diff --git a/coin_test_instructions.py b/coin_test_instructions.py
index 30d808e25..c4a19fa9b 100644
--- a/coin_test_instructions.py
+++ b/coin_test_instructions.py
@@ -67,7 +67,11 @@ def call_testrunner(python_ver, buildnro):
_pExe, _env, env_pip, env_python = get_qtci_virtualEnv(python_ver, CI_HOST_OS, CI_HOST_ARCH, CI_TARGET_ARCH)
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.
# 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")
@@ -104,11 +108,7 @@ def run_test_instructions():
os.chdir(CI_ENV_AGENT_DIR)
testRun = 0
- # We didn't build for Python 2 in win
- if CI_HOST_OS != "Windows":
- call_testrunner("", str(testRun))
- testRun =+ 1
- # We know that second build was with python3
+
if CI_RELEASE_CONF:
# In win machines, there are additional python versions to test with
if CI_HOST_OS == "Windows":