From 418deca24251fe42f872c67c049400d05ba69546 Mon Sep 17 00:00:00 2001 From: Charles Short Date: Thu, 5 Aug 2021 10:49:27 -0400 Subject: [PATCH] py3: Add support for python3.9 Enable python3.9 in tox.ini and zuul gate. Tested locally by running tox and running in the zuul gate. Story: 2009101 Task: 43105 Signed-off-by: Charles Short Change-Id: I44eaeb134d6b7b54788469fa469b04674aeb90c0 --- .zuul.yaml | 35 +++++++++++++++++++++++++++++++++ cgcs-patch/cgcs-patch/tox.ini | 14 ++++++++++++- patch-alarm/patch-alarm/tox.ini | 23 +++++++++++++++++++++- 3 files changed, 70 insertions(+), 2 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 1a1b3010..41dc75d0 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -12,9 +12,11 @@ - patch-tox-pylint - patch-tox-py27 - patch-tox-py36 + - patch-tox-py39 - patch-alarm-tox-pylint - patch-alarm-tox-py27 - patch-alarm-tox-py36 + - patch-alarm-tox-py39 gate: jobs: - openstack-tox-linters @@ -23,9 +25,11 @@ - patch-tox-pylint - patch-tox-py27 - patch-tox-py36 + - patch-tox-py39 - patch-alarm-tox-pylint - patch-alarm-tox-py27 - patch-alarm-tox-py36 + - patch-alarm-tox-py39 post: jobs: - stx-update-upload-git-mirror @@ -85,6 +89,22 @@ tox_envlist: py36 tox_extra_args: -c cgcs-patch/cgcs-patch/tox.ini +- job: + name: patch-tox-py39 + parent: tox-py39 + nodeset: debian-bullseye + required-projects: + - starlingx/config + - starlingx/fault + - starlingx/root + files: + - cgcs-patch/cgcs-patch/* + vars: + tox_envlist: py39 + python_version: 3.9 + tox_extra_args: -c cgcs-patch/cgcs-patch/tox.ini + + - job: name: patch-alarm-tox-pylint parent: tox @@ -124,6 +144,21 @@ tox_envlist: py36 tox_extra_args: -c patch-alarm/patch-alarm/tox.ini +- job: + name: patch-alarm-tox-py39 + parent: tox-py39 + nodeset: debian-bullseye + required-projects: + - starlingx/config + - starlingx/fault + - starlingx/root + files: + - patch-alarm/patch-alarm/* + vars: + python_version: 3.9 + tox_envlist: py39 + tox_extra_args: -c patch-alarm/patch-alarm/tox.ini + - job: name: flock-devstack-update parent: flock-devstack-base-min diff --git a/cgcs-patch/cgcs-patch/tox.ini b/cgcs-patch/cgcs-patch/tox.ini index 0cda032b..f2a64f6a 100644 --- a/cgcs-patch/cgcs-patch/tox.ini +++ b/cgcs-patch/cgcs-patch/tox.ini @@ -5,7 +5,7 @@ # [tox] -envlist = flake8,py27,py36,pylint,cover +envlist = flake8,py27,py36,py39,pylint,cover minversion = 2.3.2 skipsdist = True @@ -57,6 +57,18 @@ commands = {[testenv:stestr]commands} basepython = python3.6 commands = {[testenv:stestr]commands} +[testenv:py39] +basepython = python3.9 +install_command = pip install \ + -v -v -v \ + -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \ + {opts} {packages} +commands = + find . -name "*.pyc" -delete + stestr run {posargs} + stestr slowest + + [bandit] # B101: Test for use of assert # B104: Test for binding to all interfaces diff --git a/patch-alarm/patch-alarm/tox.ini b/patch-alarm/patch-alarm/tox.ini index 8c29a4a5..deb7b2b7 100644 --- a/patch-alarm/patch-alarm/tox.ini +++ b/patch-alarm/patch-alarm/tox.ini @@ -5,7 +5,7 @@ # [tox] -envlist = flake8,py27,py36,pylint,cover +envlist = flake8,py27,py36,py39,pylint,cover minversion = 2.3.2 skipsdist = True @@ -58,6 +58,27 @@ commands = {[testenv:stestr]commands} basepython = python3.6 commands = {[testenv:stestr]commands} +[testenv:py39] +basepython = python3.9 +install_command = pip install \ + -v -v -v \ + -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \ + {opts} {packages} + {opts} {packages} + +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + -e{[tox]stxdir}/config/sysinv/sysinv/sysinv + -e{[tox]stxdir}/fault/fm-api + -e{[tox]stxdir}/config/tsconfig/tsconfig + -e{[tox]stxdir}/update/cgcs-patch/cgcs-patch +commands = + find . -name "*.pyc" -delete + stestr run {posargs} + stestr slowest + + + [bandit] exclude = tests