From cc04a676f7871658f0d0b23891c4ae7218924bac Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Mon, 13 Jan 2020 13:09:33 -0800 Subject: [PATCH] Add test constraint for setuptools. (#66426) * Add test constraint for setuptools. * Update pip test to work on centos6 container. --- changelogs/fragments/ansible-test-setuptools-constraint.yml | 2 ++ .../targets/inventory_kubevirt_conformance/constraints.txt | 1 + .../targets/inventory_kubevirt_conformance/runme.sh | 2 +- test/integration/targets/pip/tasks/pip.yml | 6 +++++- test/lib/ansible_test/_data/requirements/constraints.txt | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/ansible-test-setuptools-constraint.yml create mode 100644 test/integration/targets/inventory_kubevirt_conformance/constraints.txt diff --git a/changelogs/fragments/ansible-test-setuptools-constraint.yml b/changelogs/fragments/ansible-test-setuptools-constraint.yml new file mode 100644 index 00000000000000..8fb0d0551f17bb --- /dev/null +++ b/changelogs/fragments/ansible-test-setuptools-constraint.yml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-test no longer tries to install ``setuptools`` 45+ on Python 2.x since those versions are unsupported diff --git a/test/integration/targets/inventory_kubevirt_conformance/constraints.txt b/test/integration/targets/inventory_kubevirt_conformance/constraints.txt new file mode 100644 index 00000000000000..c44f44e9dee5d6 --- /dev/null +++ b/test/integration/targets/inventory_kubevirt_conformance/constraints.txt @@ -0,0 +1 @@ +setuptools < 45 ; python_version <= '2.7' # setuptools 45 and later require python 3.5 or later diff --git a/test/integration/targets/inventory_kubevirt_conformance/runme.sh b/test/integration/targets/inventory_kubevirt_conformance/runme.sh index 390f80cb547cb9..47e0fb7162a8a6 100755 --- a/test/integration/targets/inventory_kubevirt_conformance/runme.sh +++ b/test/integration/targets/inventory_kubevirt_conformance/runme.sh @@ -9,7 +9,7 @@ fi set -eux source virtualenv.sh -pip install openshift +pip install openshift -c constraints.txt ./server.py & diff --git a/test/integration/targets/pip/tasks/pip.yml b/test/integration/targets/pip/tasks/pip.yml index 3dd451a6308848..19bd5d813876a4 100644 --- a/test/integration/targets/pip/tasks/pip.yml +++ b/test/integration/targets/pip/tasks/pip.yml @@ -496,7 +496,11 @@ - name: install distribute in the virtualenv pip: - name: distribute + # using -c for constraints is not supported as long as tests are executed using the centos6 container + # since the pip version in the venv is not upgraded and is too old (6.0.8) + name: + - distribute + - setuptools<45 # setuptools 45 and later require python 3.5 or later virtualenv: "{{ output_dir }}/pipenv" state: present diff --git a/test/lib/ansible_test/_data/requirements/constraints.txt b/test/lib/ansible_test/_data/requirements/constraints.txt index 4d8d4e58c41e30..09225c32b30242 100644 --- a/test/lib/ansible_test/_data/requirements/constraints.txt +++ b/test/lib/ansible_test/_data/requirements/constraints.txt @@ -37,6 +37,7 @@ lxml < 4.3.0 ; python_version < '2.7' # lxml 4.3.0 and later require python 2.7 pyvmomi < 6.0.0 ; python_version < '2.7' # pyvmomi 6.0.0 and later require python 2.7 or later pyone == 1.1.9 # newer versions do not pass current integration tests botocore >= 1.10.0 # adds support for the following AWS services: secretsmanager, fms, and acm-pca +setuptools < 45 ; python_version <= '2.7' # setuptools 45 and later require python 3.5 or later # freeze pylint and its requirements for consistent test results astroid == 2.2.5