From 6a2635e32d73a5f9c0b71ec3306b40a8663321e4 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Wed, 24 Feb 2021 20:45:03 +0900 Subject: [PATCH] Preparation for Django 3.0 and 3.1 support (1) This commit enables non-voting unit test jobs with Django 3.0/3.1. PendingDeprecationWarning is added to PYTHONWARNINGS in tox.ini. PendingDeprecationWarning in Django 3.0+ includes deprecation warnings on what will be dropped in Django 4.0 and they cannot be addressed as long as we use Django 2.2. Change-Id: I44e511ddc1d93fc3e2b68393b88c5f2cd1360854 --- .zuul.d/django-jobs.yaml | 23 +++++++++++++++++------ tox.ini | 8 +++++--- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.zuul.d/django-jobs.yaml b/.zuul.d/django-jobs.yaml index 0dc6c19e63..0d66360b97 100644 --- a/.zuul.d/django-jobs.yaml +++ b/.zuul.d/django-jobs.yaml @@ -17,15 +17,21 @@ pre-run: playbooks/horizon-tox-django/pre.yaml run: playbooks/horizon-tox-django/run.yaml vars: - tox_envlist: py36 + tox_envlist: py38 required-projects: - name: openstack/horizon - job: - name: horizon-tox-python3-django22 + name: horizon-tox-python3-django30 parent: horizon-tox-python3-django vars: - django_version: '>=2.2,<3.0' + django_version: '>=3.0,<3.1' + +- job: + name: horizon-tox-python3-django31 + parent: horizon-tox-python3-django + vars: + django_version: '>=3.1,<3.2' - project-template: name: horizon-non-primary-django-jobs @@ -37,10 +43,15 @@ # to run tests with different versions of Django. # We specify a job in openstack-python3-wallaby-jobs(-horizon) # to keep this project template as it is used in horizon plugins. - - openstack-tox-py38 # NOTE: We keep it as a template even though it is not used now. - # - horizon-tox-python3-django22 + - openstack-tox-py38 + - horizon-tox-python3-django30: + voting: false + - horizon-tox-python3-django31: + voting: false gate: jobs: - openstack-tox-py38 - # - horizon-tox-python3-django22 + # Skip these until the django3.x jobs become voting. + # - horizon-tox-python3-django30 + # - horizon-tox-python3-django31 diff --git a/tox.ini b/tox.ini index e69b8312b3..de7d778f59 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.1 -envlist = pep8,py36,py38,releasenotes,npm +envlist = pep8,py36,py38,releasenotes,npm,py3-dj{30,31} skipsdist = True # Automatic envs (pyXX) will only use the python version appropriate to that # env and ignore basepython inherited from [testenv] if we set @@ -13,8 +13,8 @@ usedevelop = True setenv = VIRTUAL_ENV = {envdir} PYTHONDONTWRITEBYTECODE = 1 - PYTHONWARNINGS = once - py{3,36,37}:PYTHONWARNINGS = once,ignore::ImportWarning:backports + PYTHONWARNINGS = once,ignore::PendingDeprecationWarning + py{3,36,37}:PYTHONWARNINGS = once,ignore::PendingDeprecationWarning,ignore::ImportWarning:backports whitelist_externals = bash @@ -24,6 +24,8 @@ deps = -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt commands = + dj30: pip install django>=3.0,<3.1 + dj31: pip install django>=3.1,<3.2 find . -type f -name "*.pyc" -delete bash {toxinidir}/tools/unit_tests.sh {toxinidir} {posargs}