aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@qt.io>2020-05-08 12:01:48 +0300
committerSimo Fält <simo.falt@qt.io>2020-05-13 14:08:42 +0300
commita18a30476efc78596b590caddeb8932f862b47b4 (patch)
tree73f52bd39f9ac07be974767987e66540024bf64b
parent7c45be58950b620805dafe6e6a1281d3cdba5200 (diff)
Install pip packages from requirements.txt files
Change-Id: I16beba02a12c6c1f656e7a92696e9a6741989a39 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--coin_build_instructions.py7
-rw-r--r--coin_test_instructions.py6
-rw-r--r--requirements.txt10
3 files changed, 14 insertions, 9 deletions
diff --git a/coin_build_instructions.py b/coin_build_instructions.py
index 7d4d07289..5c3033b04 100644
--- a/coin_build_instructions.py
+++ b/coin_build_instructions.py
@@ -113,13 +113,8 @@ def call_setup(python_ver, phase):
run_instruction(["pip", "install", "--user", "virtualenv==20.0.20"], "Failed to pin virtualenv")
run_instruction(["virtualenv", "-p", _pExe, _env], "Failed to create virtualenv")
# When the 'python_ver' variable is empty, we are using Python 2
- # setuptools from v45+ removed the support for Python 2, so we pin an old release
# Pip is always upgraded when CI template is provisioned, upgrading it in later phase may cause perm issue
- upgrade_pip = True if CI_HOST_OS == "Linux" else False
- install_pip_dependencies(env_pip, ["pip"], upgrade_pip)
- install_pip_dependencies(env_pip, ["numpy" if python_ver else "numpy==1.16.6",
- "setuptools" if python_ver else "setuptools==44.0.0",
- "sphinx", "six", "wheel"])
+ run_instruction([env_pip, "install", "-r", "requirements.txt"], "Failed to install dependencies")
cmd = [env_python, "-u", "setup.py"]
if phase in ["BUILD"]:
diff --git a/coin_test_instructions.py b/coin_test_instructions.py
index 0bc0be783..c3752cb9f 100644
--- a/coin_test_instructions.py
+++ b/coin_test_instructions.py
@@ -67,9 +67,9 @@ def call_testrunner(python_ver, buildnro):
# Pinning the virtualenv before creating one
run_instruction(["pip", "install", "--user", "virtualenv==20.0.20"], "Failed to pin virtualenv")
run_instruction(["virtualenv", "-p", _pExe, _env], "Failed to create virtualenv")
- upgrade_pip = True if CI_HOST_OS == "Linux" else False
- install_pip_dependencies(env_pip, ["pip"], upgrade_pip)
- install_pip_dependencies(env_pip, ["numpy", "PyOpenGL", "setuptools", "six", "pyinstaller==3.6", "wheel"])
+ # 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")
cmd = [env_python, "testrunner.py", "test",
"--blacklist", "build_history/blacklist.txt",
"--buildno=" + buildnro]
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 000000000..32b1991dd
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,10 @@
+numpy==1.16.6; python_version < '3'
+numpy; python_version >= '3'
+# setuptools from v45+ removed the support for Python 2, so we pin an old release
+setuptools==44.0.0; python_version < '3'
+setuptools; python_version >= '3'
+sphinx
+six
+wheel
+PyOpenGL
+pyinstaller==3.6