From 001ad4d7b14720fe61189acb209f3ffc7a50ed83 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 21 Aug 2020 13:58:14 +1000 Subject: [PATCH] tox: drop test-requirements.txt We have several tox environments that don't really share the same dependencies. Currently we put everything into test-requirements.txt, meaning the linter environment gets testinfra and testinfra environment gets things like ansible-lint it's not using. Apart from being a bit faster not installing things, this is helpful for restoring the ansible -devel test. In that case, we have ansible as a project dependency; when installing from git, ansible now installs itself as "ansible-base" ("ansible" is the released pypi package that incorporates collections). So if we install ansible-lint in the testinfra environment, this pulls in ansible ... and then it breaks when tox wants to install our Zuul clone of upstream ansible (you can't have ansible and ansible-base together). Change-Id: I5f3fc93e6ddd611f319fa269e122ed576c9cb378 --- test-requirements.txt | 22 ---------------------- tox.ini | 19 +++++++++++++++---- zuul.d/system-config-run.yaml | 1 + 3 files changed, 16 insertions(+), 26 deletions(-) delete mode 100644 test-requirements.txt diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index a8d9df17ea..0000000000 --- a/test-requirements.txt +++ /dev/null @@ -1,22 +0,0 @@ -# The order of packages is significant, because pip processes them in the order -# of appearance. Changing the order has an impact on the overall integration -# process, which may cause wedges in the gate later. -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 -bashate>=0.2 # Apache-2.0 -PyYAML>=3.10.0 # MIT -ansible-lint>=4.1.0 -openstacksdk -zuul-sphinx>=0.2.3 -testtools -mock -# testinfra 1.17.0 has a broken wheel that won't install under python3 -# testinfra 3.0.0 switched the ansible backend, but broke ipv6 handling -testinfra!=1.17.0,!=3.0.0 -pytest-html # MPL-2.0 -# testinfra's ansible backend actually requires paramiko, but it's not -# specified. After -# https://github.com/philpep/testinfra/pull/454 -# releases we can do testinfra[ansible] here instead -ansible>=2.8.0 -paramiko - diff --git a/tox.ini b/tox.ini index 27db0cbad1..8fd42544dc 100644 --- a/tox.ini +++ b/tox.ini @@ -7,9 +7,16 @@ skipsdist = True basepython = python3 usedevelop = True install_command = pip install {opts} {packages} -deps = -r{toxinidir}/test-requirements.txt [testenv:linters] +deps = + hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 + bashate>=0.2 # Apache-2.0 + PyYAML>=3.10.0 # MIT + ansible-lint>=4.1.0 + openstacksdk + testtools + mock whitelist_externals = bash setenv = ANSIBLE_LIBRARY= {toxinidir}/tools/fake-ansible/library @@ -25,14 +32,18 @@ commands = python3 -m unittest playbooks/roles/install-ansible/files/inventory_plugins/test_yamlgroup.py bash -c "find roles playbooks -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 ansible-lint" -[testenv:venv] -commands = {posargs} - [testenv:docs] deps = -r{toxinidir}/doc/requirements.txt commands = sphinx-build -W -E -b html doc/source doc/build/html [testenv:testinfra] +deps = + # testinfra 1.17.0 has a broken wheel that won't install under python3 + # testinfra 3.0.0 switched the ansible backend, but broke ipv6 handling + testinfra!=1.17.0,!=3.0.0 + ansible-base + pytest-html # MPL-2.0 + # This environment assumes a gate-hosts.yaml file has been written. passenv = TESTINFRA_EXTRA_DATA diff --git a/zuul.d/system-config-run.yaml b/zuul.d/system-config-run.yaml index bc0d6a1945..301813ada9 100644 --- a/zuul.d/system-config-run.yaml +++ b/zuul.d/system-config-run.yaml @@ -62,6 +62,7 @@ - name: focal label: ubuntu-focal files: + - tox.ini - playbooks/ - roles/ - testinfra/