Skip to content

Commit 658de38

Browse files
xuanyandongostackbrian
authored andcommitted
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
1 parent d240091 commit 658de38

6 files changed

Lines changed: 63 additions & 21 deletions

File tree

.zuul.yaml

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
- job:
2-
name: python-cinderclient-functional
2+
name: python-cinderclient-functional-base
3+
abstract: true
34
parent: devstack
45
run: playbooks/python-cinderclient-functional.yaml
56
post-run: playbooks/post.yaml
@@ -12,19 +13,47 @@
1213
USE_PYTHON3: true
1314
VOLUME_BACKING_FILE_SIZE: 16G
1415

16+
- job:
17+
name: python-cinderclient-functional-py36
18+
parent: python-cinderclient-functional-base
19+
vars:
20+
python_version: 3.6
21+
tox_envlist: functional-py36
22+
23+
- job:
24+
name: python-cinderclient-functional-py37
25+
parent: python-cinderclient-functional-base
26+
# Just to be clear what's going on here: which python is used by
27+
# tox is controlled by tox.ini. But, that python needs to
28+
# actually be available on the node running the job in order for
29+
# the job to succeed. At this point, we can assume that 3.6 will
30+
# be available everywhere (this is guaranteed by openstack-infra).
31+
# But 3.7 is still problematic (don't ask me why). So for this
32+
# job that we want running in py3.7, we need to (a) specify a
33+
# nodeset for which py3.7 is available, and (b) tell the job to
34+
# make sure it's available (i.e., install it if necessary).
35+
# (a) is handled by the 'nodeset' specification below.
36+
# (b) is handled by the setting the 'python_version' variable
37+
# below, although by itself that doesn't do anything: it also
38+
# requires that the 'ensure-python' role is included in the
39+
# job playbook.
40+
nodeset: openstack-single-node-bionic
41+
vars:
42+
python_version: 3.7
43+
tox_envlist: functional-py37
44+
1545
- project:
1646
templates:
1747
- check-requirements
18-
- lib-forward-testing
1948
- lib-forward-testing-python3
2049
- openstack-cover-jobs
2150
- openstack-lower-constraints-jobs
22-
- openstack-python-jobs
23-
- openstack-python3-train-jobs
51+
- openstack-python3-ussuri-jobs
2452
- publish-openstack-docs-pti
2553
- release-notes-jobs-python3
2654
check:
2755
jobs:
28-
- python-cinderclient-functional
56+
- python-cinderclient-functional-py36
57+
- python-cinderclient-functional-py37
2958
- openstack-tox-pylint:
3059
voting: false

doc/requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
# These are needed for docs generation
55
openstackdocstheme>=1.20.0 # Apache-2.0
66
reno>=2.5.0 # Apache-2.0
7-
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
8-
sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD
7+
sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2 # BSD

playbooks/python-cinderclient-functional.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
- hosts: all
22
roles:
3+
- ensure-python
34
- run-devstack
45
# Run bindep and test-setup after devstack so that they won't interfere
56
- role: bindep
@@ -9,6 +10,5 @@
910
- get-os-environment
1011
- ensure-tox
1112
- role: tox
12-
tox_envlist: functional
1313
tox_install_siblings: false
1414
environment: "{{ os_env_vars }}"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
upgrade:
3+
- |
4+
Python 2.7 support has been dropped. Beginning with release 6.0.0,
5+
the minimum version of Python supported by python-cinderclient is
6+
Python 3.6. The last version of python-cinderclient to support
7+
Python 2.7 is the 5.x series from the Train release.

setup.cfg

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ classifier =
1515
License :: OSI Approved :: Apache Software License
1616
Operating System :: POSIX :: Linux
1717
Programming Language :: Python
18-
Programming Language :: Python :: 2
19-
Programming Language :: Python :: 2.7
2018
Programming Language :: Python :: 3
2119
Programming Language :: Python :: 3.6
2220
Programming Language :: Python :: 3.7

tox.ini

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
[tox]
22
distribute = False
3-
envlist = py27,py37,pep8
4-
minversion = 2.0
3+
envlist = py36,py37,pep8
4+
minversion = 3.1.0
55
skipsdist = True
6+
skip_missing_interpreters = true
7+
# this allows tox to infer the base python from the environment name
8+
# and override any basepython configured in this file
9+
ignore_basepython_conflict=true
610

711
[testenv]
12+
basepython = python3
813
usedevelop = True
914
install_command = pip install {opts} {packages}
1015
setenv =
@@ -25,11 +30,9 @@ commands = find . -type f -name "*.pyc" -delete
2530
whitelist_externals = find
2631

2732
[testenv:pep8]
28-
basepython = python3
2933
commands = flake8
3034

3135
[testenv:pylint]
32-
basepython = python3
3336
deps =
3437
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
3538
-r{toxinidir}/requirements.txt
@@ -38,11 +41,9 @@ commands = bash tools/lintstack.sh
3841
whitelist_externals = bash
3942

4043
[testenv:venv]
41-
basepython = python3
4244
commands = {posargs}
4345

4446
[testenv:cover]
45-
basepython = python3
4647
setenv =
4748
{[testenv]setenv}
4849
PYTHON=coverage run --source cinderclient --parallel-mode
@@ -53,15 +54,13 @@ commands =
5354
coverage xml -o cover/coverage.xml
5455

5556
[testenv:docs]
56-
basepython = python3
5757
deps =
5858
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
5959
-r{toxinidir}/requirements.txt
6060
-r{toxinidir}/doc/requirements.txt
6161
commands = sphinx-build -W -b html doc/source doc/build/html
6262

6363
[testenv:pdf-docs]
64-
basepython = python3
6564
deps =
6665
{[testenv:docs]deps}
6766
commands =
@@ -73,32 +72,42 @@ whitelist_externals =
7372
cp
7473

7574
[testenv:releasenotes]
76-
basepython = python3
7775
deps =
7876
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
7977
-r{toxinidir}/requirements.txt
8078
-r{toxinidir}/doc/requirements.txt
8179
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
8280

8381
[testenv:functional]
84-
basepython = python3
8582
commands = stestr run {posargs}
8683
setenv =
8784
{[testenv]setenv}
8885
OS_TEST_PATH = ./cinderclient/tests/functional
8986
OS_VOLUME_API_VERSION = 3
87+
# must define this here so it can be inherited by the -py3* environments
88+
OS_CINDERCLIENT_EXEC_DIR = {envdir}/bin
89+
9090
# The OS_CACERT environment variable should be passed to the test
9191
# environments to specify a CA bundle file to use in verifying a
9292
# TLS (https) server certificate.
9393
passenv = OS_*
9494

95+
[testenv:functional-py36]
96+
setenv = {[testenv:functional]setenv}
97+
passenv = {[testenv:functional]passenv}
98+
commands = {[testenv:functional]commands}
99+
100+
[testenv:functional-py37]
101+
setenv = {[testenv:functional]setenv}
102+
passenv = {[testenv:functional]passenv}
103+
commands = {[testenv:functional]commands}
104+
95105
[flake8]
96106
show-source = True
97107
ignore = H404,H405,E122,E123,E128,E251
98108
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
99109

100110
[testenv:lower-constraints]
101-
basepython = python3
102111
deps =
103112
-c{toxinidir}/lower-constraints.txt
104113
-r{toxinidir}/test-requirements.txt

0 commit comments

Comments
 (0)