py3: Add support for python 3.9

Enable python 3.9 in tox and zuul gate.

Story: 2009101
Task: 43104

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I3ebb23574ad34a1078fae3fbbc65ce5457d46c69
This commit is contained in:
Charles Short 2021-08-05 12:48:27 -04:00
parent aa8665cebf
commit 5b62a25ca4
3 changed files with 68 additions and 2 deletions

View File

@ -7,10 +7,12 @@
- openstack-tox-linters - openstack-tox-linters
- kube-cpusets-tox-py27 - kube-cpusets-tox-py27
- kube-cpusets-tox-py36 - kube-cpusets-tox-py36
- kube-cpusets-tox-py39
- kube-cpusets-tox-flake8 - kube-cpusets-tox-flake8
- kube-cpusets-tox-pylint - kube-cpusets-tox-pylint
- kube-memory-tox-py27 - kube-memory-tox-py27
- kube-memory-tox-py36 - kube-memory-tox-py36
- kube-memory-tox-py39
- kube-memory-tox-flake8 - kube-memory-tox-flake8
- kube-memory-tox-pylint - kube-memory-tox-pylint
gate: gate:
@ -18,10 +20,12 @@
- openstack-tox-linters - openstack-tox-linters
- kube-cpusets-tox-py27 - kube-cpusets-tox-py27
- kube-cpusets-tox-py36 - kube-cpusets-tox-py36
- kube-cpusets-tox-py39
- kube-cpusets-tox-flake8 - kube-cpusets-tox-flake8
- kube-cpusets-tox-pylint - kube-cpusets-tox-pylint
- kube-memory-tox-py27 - kube-memory-tox-py27
- kube-memory-tox-py36 - kube-memory-tox-py36
- kube-memory-tox-py39
- kube-memory-tox-flake8 - kube-memory-tox-flake8
- kube-memory-tox-pylint - kube-memory-tox-pylint
post: post:
@ -29,10 +33,12 @@
- stx-monitoring-upload-git-mirror - stx-monitoring-upload-git-mirror
- kube-cpusets-tox-py27 - kube-cpusets-tox-py27
- kube-cpusets-tox-py36 - kube-cpusets-tox-py36
- kube-cpusets-tox-py39
- kube-cpusets-tox-flake8 - kube-cpusets-tox-flake8
- kube-cpusets-tox-pylint - kube-cpusets-tox-pylint
- kube-memory-tox-py27 - kube-memory-tox-py27
- kube-memory-tox-py36 - kube-memory-tox-py36
- kube-memory-tox-py39
- kube-memory-tox-flake8 - kube-memory-tox-flake8
- kube-memory-tox-pylint - kube-memory-tox-pylint
@ -91,6 +97,22 @@
tox_envlist: py36 tox_envlist: py36
tox_extra_args: -c kube-cpusets/kube-cpusets/tox.ini tox_extra_args: -c kube-cpusets/kube-cpusets/tox.ini
- job:
name: kube-cpusets-tox-py39
parent: tox-py39
description: |
Run py39 for kube-cpusets
required-projects:
- starlingx/config
nodeset: debian-bullseye
files:
- kube-cpusets/kube-cpusets/*
vars:
python_version: 3.9
tox_envlist: py39
tox_extra_args: -c kube-cpusets/kube-cpusets/tox.ini
- job: - job:
name: kube-cpusets-tox-py27 name: kube-cpusets-tox-py27
parent: tox parent: tox
@ -147,6 +169,22 @@
tox_envlist: py36 tox_envlist: py36
tox_extra_args: -c kube-memory/kube-memory/tox.ini tox_extra_args: -c kube-memory/kube-memory/tox.ini
- job:
name: kube-memory-tox-py39
parent: tox-py39
description: |
Run py39 test for kube-memory
nodeset: debian-bullseye
required-projects:
- starlingx/config
files:
- kube-memory/kube-memory/*
vars:
python_version: 3.9
tox_envlist: py39
tox_extra_args: -c kube-memory/kube-memory/tox.ini
- job: - job:
name: kube-memory-tox-py27 name: kube-memory-tox-py27
parent: tox parent: tox

View File

@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
[tox] [tox]
envlist = flake8,py27,py36,pylint,cover envlist = flake8,py27,py36,py39,pylint,cover
minversion = 2.3.2 minversion = 2.3.2
skipsdist = True skipsdist = True
stxdir = {toxinidir}/../../.. stxdir = {toxinidir}/../../..
@ -37,19 +37,33 @@ commands =
find . -name "*.pyc" -delete find . -name "*.pyc" -delete
stestr run {posargs} stestr run {posargs}
stestr slowest stestr slowest
[testenv:py27] [testenv:py27]
basepython = python2.7 basepython = python2.7
commands = {[testenv:stestr]commands} commands = {[testenv:stestr]commands}
[testenv:py36] [testenv:py36]
basepython = python3.6 basepython = python3.6
commands = {[testenv:stestr]commands} 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 = {[testenv:stestr]commands}
[bandit] [bandit]
exclude = tests exclude = tests
[testenv:bandit] [testenv:bandit]
basepython = python3 basepython = python3
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
bandit bandit
commands = bandit --ini tox.ini -n 5 -r kube_cpusets commands = bandit --ini tox.ini -n 5 -r kube_cpusets
[flake8] [flake8]
show-source = True show-source = True
ignore = ignore =

View File

@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
[tox] [tox]
envlist = flake8,py27,py36,pylint,cover envlist = flake8,py27,py36,py39,pylint,cover
minversion = 2.3.2 minversion = 2.3.2
skipsdist = True skipsdist = True
stxdir = {toxinidir}/../../.. stxdir = {toxinidir}/../../..
@ -38,12 +38,23 @@ commands =
find . -name "*.pyc" -delete find . -name "*.pyc" -delete
stestr run {posargs} stestr run {posargs}
stestr slowest stestr slowest
[testenv:py27] [testenv:py27]
basepython = python2.7 basepython = python2.7
commands = {[testenv:stestr]commands} commands = {[testenv:stestr]commands}
[testenv:py36] [testenv:py36]
basepython = python3.6 basepython = python3.6
commands = {[testenv:stestr]commands} 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 = {[testenv:stestr]commands}
[bandit] [bandit]
exclude = tests exclude = tests
[testenv:bandit] [testenv:bandit]
@ -51,6 +62,7 @@ basepython = python3
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
bandit bandit
commands = bandit --ini tox.ini -n 5 -r kube_memory commands = bandit --ini tox.ini -n 5 -r kube_memory
[flake8] [flake8]
show-source = True show-source = True
ignore = ignore =
@ -68,12 +80,14 @@ usedevelop = False
#skip_install = True #skip_install = True
commands = commands =
flake8 {posargs} . flake8 {posargs} .
[testenv:pylint] [testenv:pylint]
deps = {[testenv]deps} deps = {[testenv]deps}
pylint pylint
basepython = python3.6 basepython = python3.6
sitepackages = False sitepackages = False
commands = pylint kube_memory --rcfile=./pylint.rc commands = pylint kube_memory --rcfile=./pylint.rc
[testenv:cover] [testenv:cover]
setenv = setenv =
PYTHON=coverage run --parallel-mode PYTHON=coverage run --parallel-mode