From cf678365af2615fcfc9d60cfd1a4de4add57738a Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 7 Dec 2022 11:17:50 -0800 Subject: [PATCH] Pin tox to <4 in ensure-tox installation Tox v4 just released and has a number of breaking changes. One of which (yet to be properly identified) has completely broken Zuul's tox siblings processing and produces errors like: Traceback (most recent call last): File "", line 107, in File "", line 99, in _ansiballz_main File "", line 47, in invoke_module File "/usr/lib/python3.10/runpy.py", line 224, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/tmp/ansible_tox_install_sibling_packages_payload_0af4x4lc/ansible_tox_install_sibling_packages_payload.zip/ansible/modules/tox_install_sibling_packages.py", line 397, in File "/tmp/ansible_tox_install_sibling_packages_payload_0af4x4lc/ansible_tox_install_sibling_packages_payload.zip/ansible/modules/tox_install_sibling_packages.py", line 328, in main File "/usr/lib/python3.10/configparser.py", line 724, in read_string self.read_file(sfile, source) File "/usr/lib/python3.10/configparser.py", line 719, in read_file self._read(f, source) File "/usr/lib/python3.10/configparser.py", line 1097, in _read raise DuplicateOptionError(sectname, optname, configparser.DuplicateOptionError: While reading from '' [line 45]: option 'root' in section 'testenv:docs' already exists Let's pin tox for now and a change that removes the pin can also fix tox siblings (the change to remove the pin should be self testing thankfully). Also we make the zuul-tox-docs job temporarily non voting as it runs ensure-tox non speculatively out of the opendev/base-jobs repo. We have plenty of tox jobs runing against this changeto show it should work fine. Change-Id: Idcebd397f47cfef718721d2576cb43dbdb70801d --- roles/ensure-tox/tasks/main.yaml | 4 +++- zuul-tests.d/project.yaml | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/roles/ensure-tox/tasks/main.yaml b/roles/ensure-tox/tasks/main.yaml index af87e54e9..e5ecae409 100644 --- a/roles/ensure-tox/tasks/main.yaml +++ b/roles/ensure-tox/tasks/main.yaml @@ -25,7 +25,9 @@ command: '{{ ensure_pip_virtualenv_command }} {{ tox_venv_path }}' - name: Install tox to local venv - command: '{{ tox_venv_path }}/bin/pip install tox' + # We pin tox to version <4 as v4 is not currently compatible with + # zuul's tox siblings processing. + command: '{{ tox_venv_path }}/bin/pip install tox<4' - name: Export installed tox_executable path set_fact: diff --git a/zuul-tests.d/project.yaml b/zuul-tests.d/project.yaml index d9f7a0383..439bfc46a 100644 --- a/zuul-tests.d/project.yaml +++ b/zuul-tests.d/project.yaml @@ -5,7 +5,8 @@ - project: check: jobs: - - zuul-tox-docs + - zuul-tox-docs: + voting: false - tox-py27 - tox-py38: nodeset: ubuntu-focal @@ -17,7 +18,8 @@ nodeset: ubuntu-jammy gate: jobs: - - zuul-tox-docs + - zuul-tox-docs: + voting: false - tox-py27 - tox-py38: nodeset: ubuntu-focal