diff options
author | Matthew Watkins <mwatkins@linuxfoundation.org> | 2022-12-06 10:37:59 +0000 |
---|---|---|
committer | Matthew Watkins <mwatkins@linuxfoundation.org> | 2022-12-06 11:33:07 +0000 |
commit | 1a16d1d25ca0f16cb14af1f62847ccea6297b6cc (patch) | |
tree | e268dbdd0ecbfbc9c0b95fcd648fa8659070f65c | |
parent | 035f1c94d8a1845b4a0b6f4dfc1809494f77e977 (diff) |
Fix: Ensure tox is run under Python3
Issue-ID: CCSDK-3820
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
Change-Id: Ic5276c18e29af97e9a201fccba9074bece5e8e23
-rw-r--r-- | jjb/global-templates-python.yaml | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/jjb/global-templates-python.yaml b/jjb/global-templates-python.yaml index 6f3c8363d..df37064c2 100644 --- a/jjb/global-templates-python.yaml +++ b/jjb/global-templates-python.yaml @@ -59,12 +59,25 @@ settings-file: '{mvn-settings}' - shell: | #!/bin/bash - virtualenv $WORKSPACE/venv-tox - source $WORKSPACE/venv-tox/bin/activate - pip install --upgrade pip - pip install --upgrade tox argparse - pip freeze - cd $WORKSPACE/{path} + # shellcheck disable=SC1090 + source ~/lf-env.sh + + lf-activate-venv --python python3.8 --venv-file /tmp/.toxenv \ + tox tox-pyenv virtualenv + + if [[ -d /opt/pyenv ]]; then + echo "---> Setting up pyenv" + export PYENV_ROOT="/opt/pyenv" + export PATH="$PYENV_ROOT/bin:$PATH" + PYTHONPATH="$(pwd)" + export PYTHONPATH + export TOX_TESTENV_PASSENV=PYTHONPATH + fi + + # Useful debugging + python --version + tox --version + tox publishers: |