diff --git a/playbooks/nox/pre27.yaml b/playbooks/nox/pre27.yaml new file mode 100644 index 000000000..ef7a8f460 --- /dev/null +++ b/playbooks/nox/pre27.yaml @@ -0,0 +1,6 @@ +- hosts: all + tasks: + - name: Downgrade virtualenv for python2.7 support + # Assume pip is installed in the same relative path as nox + # and use that to downgrade virtualenv to a version python2.7 supports. + command: "{{ nox_executable | dirname }}/pip install -U virtualenv<20.22.0" diff --git a/zuul.d/python-jobs.yaml b/zuul.d/python-jobs.yaml index 0957c8c4e..6fcf4f9d0 100644 --- a/zuul.d/python-jobs.yaml +++ b/zuul.d/python-jobs.yaml @@ -403,6 +403,7 @@ Run unit tests for a Python project under cPython version 2.7. Uses nox with the ``test`` keyword forcing python 2.7. + pre-run: playbooks/nox/pre27.yaml vars: nox_keyword: tests nox_force_python: "2.7"