aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@qt.io>2022-03-22 07:34:51 +0200
committerSimo Fält <simo.falt@qt.io>2022-03-22 10:43:28 +0000
commit6f20389eecdd3148b44ede8cd179d324ba79cb4f (patch)
tree22c86e9dacce8a5c2380ba1e9bfcc79bc166e07b
parentf7db5ff297c27c3c2058a937edd4546bd74bdf20 (diff)
Use python 3.8 when running CI integrations in Linux - take 2
Pick-to: 6.2 Change-Id: Ia78ca23984a08ff93dbf9c64ee96706478f8c93d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--build_scripts/utils.py6
-rw-r--r--coin_build_instructions.py7
-rw-r--r--coin_test_instructions.py4
3 files changed, 14 insertions, 3 deletions
diff --git a/build_scripts/utils.py b/build_scripts/utils.py
index 2daad642e..ea3679ffa 100644
--- a/build_scripts/utils.py
+++ b/build_scripts/utils.py
@@ -1187,7 +1187,11 @@ def get_qtci_virtualEnv(python_ver, host, hostArch, targetArch):
env_python = f"{_env}\\Scripts\\python.exe"
env_pip = f"{_env}\\Scripts\\pip.exe"
else:
- if python_ver == "3":
+ _pExe = f"python{python_ver}"
+ try:
+ run_instruction([_pExe, "--version"], f"Failed to guess python version {_pExe}")
+ except Exception as e:
+ print("Exception {type(e).__name__}: {e}")
_pExe = "python3"
return(_pExe, _env, env_pip, env_python)
diff --git a/coin_build_instructions.py b/coin_build_instructions.py
index cb9aca39f..43f789a2e 100644
--- a/coin_build_instructions.py
+++ b/coin_build_instructions.py
@@ -181,9 +181,12 @@ if __name__ == "__main__":
for env_var in ['CC', 'CXX']:
if os.environ.get(env_var):
del os.environ[env_var]
+ python_ver = "3"
+ if CI_TARGET_OS in["Linux"]:
+ python_ver = "3.8"
if CI_TEST_PHASE in ["ALL", "BUILD"]:
- call_setup("3","BUILD")
+ call_setup(python_ver, "BUILD")
if CI_TEST_PHASE in ["ALL", "WHEEL"]:
- call_setup("3","WHEEL")
+ call_setup(python_ver, "WHEEL")
diff --git a/coin_test_instructions.py b/coin_test_instructions.py
index 898d4fd73..732a5ba86 100644
--- a/coin_test_instructions.py
+++ b/coin_test_instructions.py
@@ -93,6 +93,8 @@ def call_testrunner(python_ver, buildnro):
# When the 'python_ver' variable is empty, we are using Python 2
# Pip is always upgraded when CI template is provisioned, upgrading it in later phase may cause perm issue
run_instruction([env_pip, "install", "-r", "requirements.txt"], "Failed to install dependencies")
+ # Install distro to replace missing platform.linux_distribution() in python3.8
+ run_instruction([env_pip, "install", "distro"], "Failed to install distro")
cmd = [env_python, "testrunner.py", "test",
"--blacklist", "build_history/blacklist.txt",
@@ -123,6 +125,8 @@ def run_test_instructions():
call_testrunner("3.6.1", str(testRun))
call_testrunner("3.8.1", str(testRun))
call_testrunner("3.10.0", str(testRun))
+ elif CI_HOST_OS == "Linux":
+ call_testrunner("3.8", str(testRun))
else:
call_testrunner("3", str(testRun))