From 6e5577633a5a529101e5de6f0c2327c02a429099 Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Sat, 15 Oct 2022 09:05:52 +1000 Subject: [PATCH] Fix: Use lf-activate-venv to reuse venv The venv created for tox is unavailable when the semantics of the script is split across files, therefore ensure venv is created with --venv-file option and set. Issue-ID: RELENG-4485 Change-Id: I18c0d255cc7bd282fca20bb31b02ba41c8a74c85 Signed-off-by: Anil Belur --- releasenotes/notes/fix-venv-tox-9a480bedd07463ba.yaml | 9 +++++++++ shell/rtd-verify.sh | 8 +++++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/fix-venv-tox-9a480bedd07463ba.yaml diff --git a/releasenotes/notes/fix-venv-tox-9a480bedd07463ba.yaml b/releasenotes/notes/fix-venv-tox-9a480bedd07463ba.yaml new file mode 100644 index 00000000..df8cb01f --- /dev/null +++ b/releasenotes/notes/fix-venv-tox-9a480bedd07463ba.yaml @@ -0,0 +1,9 @@ +--- +issues: + - | + line 48: tox: command not found +fixes: + - | + The venv created for tox is unavailable when the semantics of the + script are split across files, therefore ensure venv is created with + --venv-file option and set. diff --git a/shell/rtd-verify.sh b/shell/rtd-verify.sh index e91dd71c..7c9091f5 100644 --- a/shell/rtd-verify.sh +++ b/shell/rtd-verify.sh @@ -34,12 +34,14 @@ for submod in $(git config -f .gitmodules --get-regexp '^submodule\.(.+)\.url' | done +# shellcheck disable=SC1090 +. ~/lf-env.sh + +lf-activate-venv --python python3.8 --venv-file /tmp/.toxenv tox tox-pyenv virtualenv + # When a new commands are added in lftools, the docs verify job needs to # run the new command which requires installing the lftools dev version if [[ $JOB_NAME == "lf-infra-lftools-rtd-verify-any" ]]; then - # shellcheck disable=SC1090 - source ~/lf-env.sh - lf-activate-venv pip pip install -e . fi -- 2.16.6