[PATCH 4/6] CI: Invoke pip once rather than multiple times

Tom Rini trini at konsulko.com
Wed Feb 5 00:12:07 CET 2025


We can invoke pip once to install the various requirements.txt files
that we need rather than invoking the tool multiple times.

Signed-off-by: Tom Rini <trini at konsulko.com>
---
 .azure-pipelines.yml | 36 ++++++++++++++++++------------------
 .gitlab-ci.yml       | 27 ++++++++++-----------------
 2 files changed, 28 insertions(+), 35 deletions(-)

diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml
index 3e464375b260..9fc9c4e74fd0 100644
--- a/.azure-pipelines.yml
+++ b/.azure-pipelines.yml
@@ -133,11 +133,11 @@ stages:
           export USER=azure
           virtualenv -p /usr/bin/python3 /tmp/venv
           . /tmp/venv/bin/activate
-          pip install -r test/py/requirements.txt
-          pip install -r tools/binman/requirements.txt
-          pip install -r tools/buildman/requirements.txt
-          pip install -r tools/patman/requirements.txt
-          pip install -r tools/u_boot_pylib/requirements.txt
+          pip install -r test/py/requirements.txt \
+            -r tools/binman/requirements.txt \
+            -r tools/buildman/requirements.txt \
+            -r tools/patman/requirements.txt \
+            -r tools/u_boot_pylib/requirements.txt
           export UBOOT_TRAVIS_BUILD_DIR=/tmp/tools-only
           export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
           export PATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}
@@ -167,12 +167,12 @@ stages:
           export USER=azure
           virtualenv -p /usr/bin/python3 /tmp/venv
           . /tmp/venv/bin/activate
-          pip install -r test/py/requirements.txt
-          pip install -r tools/binman/requirements.txt
-          pip install -r tools/buildman/requirements.txt
-          pip install -r tools/patman/requirements.txt
-          pip install -r tools/u_boot_pylib/requirements.txt
-          pip install asteval pylint==2.12.2 pyopenssl
+          pip install -r test/py/requirements.txt \
+            -r tools/binman/requirements.txt \
+            -r tools/buildman/requirements.txt \
+            -r tools/patman/requirements.txt \
+            -r tools/u_boot_pylib/requirements.txt \
+            asteval pylint==2.12.2 pyopenssl
           export PATH=${PATH}:~/.local/bin
           echo "[MASTER]" >> .pylintrc
           echo "load-plugins=pylint.extensions.docparams" >> .pylintrc
@@ -274,11 +274,11 @@ stages:
           fi
           virtualenv -p /usr/bin/python3 /tmp/venv
           . /tmp/venv/bin/activate
-          pip install -r tools/binman/requirements.txt
-          pip install -r tools/buildman/requirements.txt
-          pip install -r test/py/requirements.txt
-          pip install -r tools/u_boot_pylib/requirements.txt
-          pip install pytest-azurepipelines
+          pip install -r tools/binman/requirements.txt \
+            -r tools/buildman/requirements.txt \
+            -r test/py/requirements.txt \
+            -r tools/u_boot_pylib/requirements.txt \
+            pytest-azurepipelines
           tools/buildman/buildman -o \${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e --board \${TEST_PY_BD} \${OVERRIDE}
           cp /opt/grub/grub_x86.efi \${UBOOT_TRAVIS_BUILD_DIR}/
           cp /opt/grub/grub_x64.efi \${UBOOT_TRAVIS_BUILD_DIR}/
@@ -593,8 +593,8 @@ stages:
           git config --global --add safe.directory ${WORK_DIR}
           virtualenv -p /usr/bin/python3 /tmp/venv
           . /tmp/venv/bin/activate
-          pip install -r tools/binman/requirements.txt
-          pip install -r tools/buildman/requirements.txt
+          pip install -r tools/binman/requirements.txt \
+            -r tools/buildman/requirements.txt
           EOF
           cat << "EOF" >> build.sh
           if [[ "${BUILDMAN}" != "" ]]; then
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0308d6d70dfe..dfb8dffc71ec 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -58,10 +58,8 @@ stages:
     # Prepare python environment
     - virtualenv -p /usr/bin/python3 /tmp/venv;
       . /tmp/venv/bin/activate;
-      pip install -r test/py/requirements.txt;
-      pip install -r tools/binman/requirements.txt;
-      pip install -r tools/buildman/requirements.txt;
-      pip install -r tools/u_boot_pylib/requirements.txt;
+      pip install -r test/py/requirements.txt -r tools/binman/requirements.txt
+        -r tools/buildman/requirements.txt -r tools/u_boot_pylib/requirements.txt
 
   after_script:
     - cp -v /tmp/${TEST_PY_BD}/*.{html,css,xml} .
@@ -127,8 +125,8 @@ build all platforms in a single job:
     # Prepare python environment
     - virtualenv -p /usr/bin/python3 /tmp/venv;
       . /tmp/venv/bin/activate;
-      pip install -r tools/binman/requirements.txt;
-      pip install -r tools/buildman/requirements.txt
+      pip install -r tools/binman/requirements.txt
+        -r tools/buildman/requirements.txt
     - ret=0;
       git config --global --add safe.directory "${CI_PROJECT_DIR}";
       ./tools/buildman/buildman -o /tmp -PEWM -x xtensa || ret=$?;
@@ -187,11 +185,9 @@ Run binman, buildman, dtoc, Kconfig and patman testsuites:
       export USER=gitlab;
       virtualenv -p /usr/bin/python3 /tmp/venv;
       . /tmp/venv/bin/activate;
-      pip install -r test/py/requirements.txt;
-      pip install -r tools/binman/requirements.txt;
-      pip install -r tools/buildman/requirements.txt;
-      pip install -r tools/patman/requirements.txt;
-      pip install -r tools/u_boot_pylib/requirements.txt;
+      pip install -r test/py/requirements.txt -r tools/binman/requirements.txt
+        -r tools/buildman/requirements.txt -r tools/patman/requirements.txt
+        -r tools/u_boot_pylib/requirements.txt;
       export UBOOT_TRAVIS_BUILD_DIR=/tmp/tools-only;
       export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
       export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
@@ -212,12 +208,9 @@ Run pylint:
     - git config --global --add safe.directory "${CI_PROJECT_DIR}"
     - virtualenv -p /usr/bin/python3 /tmp/venv
     - . /tmp/venv/bin/activate
-    - pip install -r test/py/requirements.txt
-    - pip install -r tools/binman/requirements.txt
-    - pip install -r tools/buildman/requirements.txt
-    - pip install -r tools/patman/requirements.txt
-    - pip install -r tools/u_boot_pylib/requirements.txt
-    - pip install asteval pylint==2.12.2 pyopenssl
+    - pip install -r test/py/requirements.txt -r tools/binman/requirements.txt
+        -r tools/buildman/requirements.txt -r tools/patman/requirements.txt
+        -r tools/u_boot_pylib/requirements.txt asteval pylint==2.12.2 pyopenssl
     - export PATH=${PATH}:~/.local/bin
     - echo "[MASTER]" >> .pylintrc
     - echo "load-plugins=pylint.extensions.docparams" >> .pylintrc
-- 
2.43.0



More information about the U-Boot mailing list