Drop support for python 2

Also adds support for py3.6 and py3.7 check and gate jobs.

Co-authored-by: xuanyandong <xuanyandong@inspur.com>
Co-authored-by: Brian Rosmaita <rosmaita.fossdev@gmail.com>

Closes-bug: #1853372

Change-Id: Ia978b692ade23ee6482957f41b17cb879c96fea7
This commit is contained in:
xuanyandong 2019-10-26 14:31:46 +08:00 committed by Brian Rosmaita
parent d240091c32
commit 658de38c20
6 changed files with 63 additions and 21 deletions

View File

@ -1,5 +1,6 @@
- job:
name: python-cinderclient-functional
name: python-cinderclient-functional-base
abstract: true
parent: devstack
run: playbooks/python-cinderclient-functional.yaml
post-run: playbooks/post.yaml
@ -12,19 +13,47 @@
USE_PYTHON3: true
VOLUME_BACKING_FILE_SIZE: 16G
- job:
name: python-cinderclient-functional-py36
parent: python-cinderclient-functional-base
vars:
python_version: 3.6
tox_envlist: functional-py36
- job:
name: python-cinderclient-functional-py37
parent: python-cinderclient-functional-base
# Just to be clear what's going on here: which python is used by
# tox is controlled by tox.ini. But, that python needs to
# actually be available on the node running the job in order for
# the job to succeed. At this point, we can assume that 3.6 will
# be available everywhere (this is guaranteed by openstack-infra).
# But 3.7 is still problematic (don't ask me why). So for this
# job that we want running in py3.7, we need to (a) specify a
# nodeset for which py3.7 is available, and (b) tell the job to
# make sure it's available (i.e., install it if necessary).
# (a) is handled by the 'nodeset' specification below.
# (b) is handled by the setting the 'python_version' variable
# below, although by itself that doesn't do anything: it also
# requires that the 'ensure-python' role is included in the
# job playbook.
nodeset: openstack-single-node-bionic
vars:
python_version: 3.7
tox_envlist: functional-py37
- project:
templates:
- check-requirements
- lib-forward-testing
- lib-forward-testing-python3
- openstack-cover-jobs
- openstack-lower-constraints-jobs
- openstack-python-jobs
- openstack-python3-train-jobs
- openstack-python3-ussuri-jobs
- publish-openstack-docs-pti
- release-notes-jobs-python3
check:
jobs:
- python-cinderclient-functional
- python-cinderclient-functional-py36
- python-cinderclient-functional-py37
- openstack-tox-pylint:
voting: false

View File

@ -4,5 +4,4 @@
# These are needed for docs generation
openstackdocstheme>=1.20.0 # Apache-2.0
reno>=2.5.0 # Apache-2.0
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD
sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2 # BSD

View File

@ -1,5 +1,6 @@
- hosts: all
roles:
- ensure-python
- run-devstack
# Run bindep and test-setup after devstack so that they won't interfere
- role: bindep
@ -9,6 +10,5 @@
- get-os-environment
- ensure-tox
- role: tox
tox_envlist: functional
tox_install_siblings: false
environment: "{{ os_env_vars }}"

View File

@ -0,0 +1,7 @@
---
upgrade:
- |
Python 2.7 support has been dropped. Beginning with release 6.0.0,
the minimum version of Python supported by python-cinderclient is
Python 3.6. The last version of python-cinderclient to support
Python 2.7 is the 5.x series from the Train release.

View File

@ -15,8 +15,6 @@ classifier =
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7

31
tox.ini
View File

@ -1,10 +1,15 @@
[tox]
distribute = False
envlist = py27,py37,pep8
minversion = 2.0
envlist = py36,py37,pep8
minversion = 3.1.0
skipsdist = True
skip_missing_interpreters = true
# this allows tox to infer the base python from the environment name
# and override any basepython configured in this file
ignore_basepython_conflict=true
[testenv]
basepython = python3
usedevelop = True
install_command = pip install {opts} {packages}
setenv =
@ -25,11 +30,9 @@ commands = find . -type f -name "*.pyc" -delete
whitelist_externals = find
[testenv:pep8]
basepython = python3
commands = flake8
[testenv:pylint]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
@ -38,11 +41,9 @@ commands = bash tools/lintstack.sh
whitelist_externals = bash
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:cover]
basepython = python3
setenv =
{[testenv]setenv}
PYTHON=coverage run --source cinderclient --parallel-mode
@ -53,7 +54,6 @@ commands =
coverage xml -o cover/coverage.xml
[testenv:docs]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
@ -61,7 +61,6 @@ deps =
commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs]
basepython = python3
deps =
{[testenv:docs]deps}
commands =
@ -73,7 +72,6 @@ whitelist_externals =
cp
[testenv:releasenotes]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
@ -81,24 +79,35 @@ deps =
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:functional]
basepython = python3
commands = stestr run {posargs}
setenv =
{[testenv]setenv}
OS_TEST_PATH = ./cinderclient/tests/functional
OS_VOLUME_API_VERSION = 3
# must define this here so it can be inherited by the -py3* environments
OS_CINDERCLIENT_EXEC_DIR = {envdir}/bin
# The OS_CACERT environment variable should be passed to the test
# environments to specify a CA bundle file to use in verifying a
# TLS (https) server certificate.
passenv = OS_*
[testenv:functional-py36]
setenv = {[testenv:functional]setenv}
passenv = {[testenv:functional]passenv}
commands = {[testenv:functional]commands}
[testenv:functional-py37]
setenv = {[testenv:functional]setenv}
passenv = {[testenv:functional]passenv}
commands = {[testenv:functional]commands}
[flake8]
show-source = True
ignore = H404,H405,E122,E123,E128,E251
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt