From efd00b03455644b18eaf2b6dcd07f6d55b95b39e Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Tue, 15 Apr 2025 12:10:26 -0600 Subject: python: Use and refer to the venv module rather than virtualenv Using some form of sandbox with Python modules is a long standing best practice with the language. There are a number of ways to have a Python sandbox be created. At this point in time, it seems the Python community is moving towards using the "venv" module provided with Python rather than a separate tool. To match that we make the following changes: - Refer to a "Python sandbox" rather than virtualenv in comments, etc. - Install the python3-venv module in our container and not virtualenv. - In our CI files, invoke "python -m venv" rather than "virtualenv". - In documentation, tell users to install python3-venv and not virtualenv. Signed-off-by: Tom Rini --- .gitlab-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 145bdad83bf..e94b23df9f8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,7 +57,7 @@ stages: export BINMAN_INDIRS=/tmp; fi # Prepare python environment - - virtualenv -p /usr/bin/python3 /tmp/venv; + - python3 -m venv /tmp/venv; . /tmp/venv/bin/activate; pip install -r test/py/requirements.txt -r tools/binman/requirements.txt -r tools/buildman/requirements.txt -r tools/u_boot_pylib/requirements.txt @@ -124,7 +124,7 @@ build all platforms in a single job: - ${HOST} script: # Prepare python environment - - virtualenv -p /usr/bin/python3 /tmp/venv; + - python3 -m venv /tmp/venv; . /tmp/venv/bin/activate; pip install -r tools/binman/requirements.txt -r tools/buildman/requirements.txt @@ -155,7 +155,7 @@ check for new CONFIG symbols outside Kconfig: docs: extends: .testsuites script: - - virtualenv -p /usr/bin/python3 /tmp/venvhtml + - python3 -m venv /tmp/venvhtml - . /tmp/venvhtml/bin/activate - pip install -r doc/sphinx/requirements.txt - make htmldocs KDOC_WERROR=1 @@ -184,7 +184,7 @@ Run binman, buildman, dtoc, Kconfig and patman testsuites: git config --global user.email trini@konsulko.com; git config --global --add safe.directory "${CI_PROJECT_DIR}"; export USER=gitlab; - virtualenv -p /usr/bin/python3 /tmp/venv; + python3 -m venv /tmp/venv; . /tmp/venv/bin/activate; pip install -r test/py/requirements.txt -r tools/binman/requirements.txt -r tools/buildman/requirements.txt -r tools/patman/requirements.txt @@ -210,7 +210,7 @@ Run pylint: extends: .testsuites script: - git config --global --add safe.directory "${CI_PROJECT_DIR}" - - virtualenv -p /usr/bin/python3 /tmp/venv + - python3 -m venv /tmp/venv - . /tmp/venv/bin/activate - pip install -r test/py/requirements.txt -r tools/binman/requirements.txt -r tools/buildman/requirements.txt -r tools/patman/requirements.txt -- cgit v1.2.3