Get rid of Python 2 support

2020 is coming, everyone should be using Python 3 now.

As per the official python support timeline set forth by the OpenStack
TC [1], OpenStack Train (in our case, kolla-ansible 9.x) is the last
release that will support python2.7.

[1] https://governance.openstack.org/tc/resolutions/20180529-python2-deprecation-timeline.html

Implements: blueprint drop-py2-support

Change-Id: Ibb3b12a779ecfd424053d0b3e98dac2f21d909bc
This commit is contained in:
Marcin Juszkiewicz 2019-11-20 11:47:46 +01:00 committed by Mark Goddard
parent 3f10f70840
commit bf9c8b5af1
5 changed files with 8 additions and 16 deletions

View File

@ -3,8 +3,6 @@ libffi-dev [platform:dpkg]
libffi-devel [platform:rpm]
gcc [platform:rpm]
gcc [platform:dpkg]
python-dev [platform:dpkg]
python-devel [platform:rpm]
python3-dev [platform:dpkg]
python3-devel [platform:rpm]
openssl-devel [platform:rpm]

View File

@ -7,6 +7,5 @@
# be installed in a specific order.
openstackdocstheme>=1.19.0 # Apache-2.0
reno>=2.5.0 # Apache-2.0
sphinx>=1.8.0,<2.0.0;python_version=='2.7' # BSD
sphinx>=1.8.0,!=2.1.0;python_version>='3.4' # BSD
sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
Python 2.7 support has been dropped. Last release of kolla-ansible to
support Python 2.7 is OpenStack Train. The minimum version of Python now
supported by kolla-ansible is Python 3.6.

View File

@ -14,8 +14,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

13
tox.ini
View File

@ -1,9 +1,10 @@
[tox]
minversion = 2.5.0
skipsdist = True
envlist = py27,py37,pep8,pypy
envlist = py37,pep8,pypy
[testenv]
basepython = python3
usedevelop=True
whitelist_externals = find
rm
@ -20,11 +21,9 @@ commands =
stestr run --slowest {posargs}
[testenv:debug]
basepython = python3
commands = oslo_debug_helper -t tests {posargs}
[testenv:cover]
basepython = python3
setenv = VIRTUAL_ENV={envdir}
NOSE_WITH_COVERAGE=1
NOSE_COVER_BRANCHES=1
@ -38,7 +37,6 @@ commands =
coverage xml -o cover/coverage.xml
[testenv:pep8]
basepython = python3
# sphinx needs to be installed to make doc8 work properly
deps =
{[testenv]deps}
@ -54,11 +52,9 @@ commands =
[testenv:bandit]
# B303: Use of insecure MD2, MD4, MD5, or SHA1 hash function.
basepython = python3
commands = bandit --skip B303 -r ansible kolla_ansible tests tools
[testenv:venv]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
@ -66,7 +62,6 @@ deps =
commands = {posargs}
[testenv:docs]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
@ -76,7 +71,6 @@ commands =
sphinx-build -W --keep-going -b html doc/source doc/build/html
[testenv:deploy-guide]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
@ -87,7 +81,6 @@ commands =
sphinx-build -a -E -W -d deploy-guide/build/doctrees --keep-going -b html deploy-guide/source deploy-guide/build/html
[testenv:pdf-docs]
basepython = python3
whitelist_externals = make
deps = {[testenv:docs]deps}
commands =
@ -95,7 +88,6 @@ commands =
make -C doc/build/pdf
[testenv:releasenotes]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
@ -109,7 +101,6 @@ show-source = True
exclude=.eggs,.git,.tox,doc
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt