From a8b71747ae194f8eed236c491439be8edecdd9f1 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Mon, 27 Jan 2020 14:01:34 -0800 Subject: [PATCH] [stable-2.9] Add constraints for Jinja2 on Python 2.6. (#66826) * Add constraint for Jinja2 on Python 2.6. * Fix constraint in inventory_aws_conformance test. * Add constrraints for template_jinja2_latest test. (cherry picked from commit 965854fbd2107ddc1449d9463c47f1e0f8525727) Co-authored-by: Matt Clay --- changelogs/fragments/ansible-test-jinja2-python-2.6.yml | 2 ++ test/integration/targets/inventory_aws_conformance/runme.sh | 2 +- .../integration/targets/template_jinja2_latest/requirements.txt | 2 ++ test/integration/targets/template_jinja2_latest/runme.sh | 2 +- test/lib/ansible_test/_data/requirements/constraints.txt | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/ansible-test-jinja2-python-2.6.yml create mode 100644 test/integration/targets/template_jinja2_latest/requirements.txt diff --git a/changelogs/fragments/ansible-test-jinja2-python-2.6.yml b/changelogs/fragments/ansible-test-jinja2-python-2.6.yml new file mode 100644 index 00000000000..601cb8fe4db --- /dev/null +++ b/changelogs/fragments/ansible-test-jinja2-python-2.6.yml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-test now limits Jinja2 installs to version 2.10 and earlier on Python 2.6 diff --git a/test/integration/targets/inventory_aws_conformance/runme.sh b/test/integration/targets/inventory_aws_conformance/runme.sh index 0f7413307a6..05772955892 100755 --- a/test/integration/targets/inventory_aws_conformance/runme.sh +++ b/test/integration/targets/inventory_aws_conformance/runme.sh @@ -4,7 +4,7 @@ set -eux source virtualenv.sh -pip install "python-dateutil>=2.1,<2.7.0" jmespath "Jinja2>=2.10" +pip install "python-dateutil>=2.1,<2.7.0" jmespath "Jinja2==2.10" # create boto3 symlinks ln -s "$(pwd)/lib/boto" "$(pwd)/lib/boto3" diff --git a/test/integration/targets/template_jinja2_latest/requirements.txt b/test/integration/targets/template_jinja2_latest/requirements.txt new file mode 100644 index 00000000000..49a806fb667 --- /dev/null +++ b/test/integration/targets/template_jinja2_latest/requirements.txt @@ -0,0 +1,2 @@ +jinja2 < 2.11 ; python_version < '2.7' # jinja2 2.11 and later require python 2.7 or later +jinja2 ; python_version >= '2.7' diff --git a/test/integration/targets/template_jinja2_latest/runme.sh b/test/integration/targets/template_jinja2_latest/runme.sh index e9767ac5494..6a20eb5dc4d 100755 --- a/test/integration/targets/template_jinja2_latest/runme.sh +++ b/test/integration/targets/template_jinja2_latest/runme.sh @@ -4,7 +4,7 @@ set -eux source virtualenv.sh -pip install -U jinja2 +pip install -U -r requirements.txt ANSIBLE_ROLES_PATH=../ export ANSIBLE_ROLES_PATH diff --git a/test/lib/ansible_test/_data/requirements/constraints.txt b/test/lib/ansible_test/_data/requirements/constraints.txt index 2c2f5e9f0f2..94d888a81f7 100644 --- a/test/lib/ansible_test/_data/requirements/constraints.txt +++ b/test/lib/ansible_test/_data/requirements/constraints.txt @@ -2,6 +2,7 @@ coverage >= 4.2, < 5.0.0, != 4.3.2 ; python_version <= '3.7' # features in 4.2+ coverage >= 4.5.4, < 5.0.0 ; python_version > '3.7' # coverage had a bug in < 4.5.4 that would cause unit tests to hang in Python 3.8, coverage 5.0+ incompatible cryptography < 2.2 ; python_version < '2.7' # cryptography 2.2 drops support for python 2.6 deepdiff < 4.0.0 ; python_version < '3' # deepdiff 4.0.0 and later require python 3 +jinja2 < 2.11 ; python_version < '2.7' # jinja2 2.11 and later require python 2.7 or later urllib3 < 1.24 ; python_version < '2.7' # urllib3 1.24 and later require python 2.7 or later pywinrm >= 0.3.0 # message encryption support sphinx < 1.6 ; python_version < '2.7' # sphinx 1.6 and later require python 2.7 or later