From 68f1b97a7f5c5523afa2bb29ba2ccb3fd806c71c Mon Sep 17 00:00:00 2001 From: Charles Short Date: Wed, 4 Aug 2021 09:12:38 -0400 Subject: [PATCH] py3: Add support for python 3.9 Add support for Debian bullseye which runs python3.9. This was tested by running tox locally on a Debian bullseye VM. Story: 2006796 Task: 42941 Signed-off-by: Charles Short Change-Id: I5568b85a365104fdbca2af7adcf9f289001baea0 --- .zuul.yaml | 16 ++++++++++++++++ bindep.txt | 12 ++++++++++-- fm-rest-api/fm/test-requirements.txt | 2 +- fm-rest-api/fm/tox.ini | 23 ++++++++++++++++++++++- 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index ddcb9f46..88041d72 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -15,6 +15,7 @@ - stx-fault-build - fault-rest-api-py27 - fault-rest-api-py36 + - fault-rest-api-py39 gate: jobs: - openstack-tox-linters @@ -22,6 +23,7 @@ - fault-tox-pylint - fault-rest-api-py27 - fault-rest-api-py36 + - fault-rest-api-py39 post: jobs: - stx-fault-upload-git-mirror @@ -82,6 +84,20 @@ tox_envlist: py36 tox_extra_args: -c fm-rest-api/fm/tox.ini +- job: + name: fault-rest-api-py39 + parent: tox-py39 + description: | + Run py39 test for fm-rest-api + nodeset: debian-bullseye + required-projects: + - starlingx/config + vars: + bindep_profile: test py39 + python_version: 3.9 + tox_envlist: py39 + tox_extra_args: -c fm-rest-api/fm/tox.ini + - job: name: fault-tox-pylint parent: tox diff --git a/bindep.txt b/bindep.txt index 2873110a..3ffe69f3 100644 --- a/bindep.txt +++ b/bindep.txt @@ -1,2 +1,10 @@ -diffutils -rpm +# This is a cross-platform list tracking distribution packages needed for install and tests; +# see https://docs.openstack.org/infra/bindep/ for additional information. + +libffi-dev [platform:dpkg] +libldap2-dev [platform:dpkg] +libxml2-dev [platform:dpkg] +libxslt1-dev [platform:dpkg] +libsasl2-dev [platform:dpkg] +libffi-devel [platform:rpm] +python3-all-dev [platform:dpkg] diff --git a/fm-rest-api/fm/test-requirements.txt b/fm-rest-api/fm/test-requirements.txt index 00adf991..ad8877ba 100644 --- a/fm-rest-api/fm/test-requirements.txt +++ b/fm-rest-api/fm/test-requirements.txt @@ -22,4 +22,4 @@ keystonemiddleware>=4.12.0 # Apache-2.0 pecan>=1.0.0 WSME>=0.5b2 httplib2 -keyring <= 18.0.1 +keyring <= 22.0.1 diff --git a/fm-rest-api/fm/tox.ini b/fm-rest-api/fm/tox.ini index 9ca42d2e..fa993e46 100644 --- a/fm-rest-api/fm/tox.ini +++ b/fm-rest-api/fm/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py36 +envlist = py27,py36,py39 minversion = 2.3 skipsdist = True stxdir = {toxinidir}/../../../ @@ -33,6 +33,18 @@ commands = stestr run {posargs} stestr slowest +[testenv:py39] +basepython = python3.9 +deps = -chttps://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt + -r{toxinidir}/test-requirements.txt + -e{[tox]stxdir}/config/tsconfig/tsconfig + -e{[tox]stxdir}/config/sysinv/cgts-client/cgts-client + -e{[tox]stxdir}/fault/fm-api + -e{[tox]stxdir}/fault/fm-rest-api/fm +commands = + stestr run {posargs} + stestr slowest + [testenv:cover] deps = {[testenv]deps} coverage @@ -46,3 +58,12 @@ commands = coverage html -d cover coverage xml -o cover/coverage.xml coverage report + +[testenv:bindep] +# Do not install any requirements. We want this to be fast and work even if +# system dependencies are missing, since it's used to tell you what system +# dependencies are missing! This also means that bindep must be installed +# separately, outside of the requirements files. +skip_install = True +deps = bindep +commands = bindep test