Drop Python 2 Support

1. It's Ussuri. We can *finally* stop testing Python 2 [1]. Time to party.
We don't attempt any cleanup but simply stop testing with Python 2,
indicate that we only support Python 3 via 'setup.cfg' and remove any
Python 2 only dependencies.

This should free up a significant amount of resources from the gate and
let us start using Python 3 idioms in our code. Win-win.

2. Cleanup basepython from individual testenv sections

3. From this point on the codebase will be incompatible with python2

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

Change-Id: Ia08c363263aaa406d0bf55e10ce8258695387578
This commit is contained in:
caoyuan 2019-10-13 01:42:35 +08:00 committed by Nate Johnston
parent f51b475062
commit feb290fa19
5 changed files with 11 additions and 21 deletions

View File

@ -3,7 +3,6 @@
- check-requirements
- openstack-cover-jobs-neutron
- openstack-lower-constraints-jobs-neutron
- openstack-python-jobs-neutron
- openstack-python3-ussuri-jobs-neutron
- periodic-stable-jobs-neutron
- publish-openstack-docs-pti

View File

@ -1,8 +1,7 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
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,>=1.6.2;python_version>='3.4' # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
sphinxcontrib-apidoc>=0.2.0 # BSD
sphinxmark>=0.1.14 # Apache-2.0
openstackdocstheme>=1.18.1 # Apache-2.0

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
Python 2.7 support has been dropped. The minimum version of Python now
supported by neutron-fwaas is Python 3.6.

View File

@ -6,6 +6,7 @@ description-file =
author = OpenStack
author-email = openstack-discuss@lists.openstack.org
home-page = https://docs.openstack.org/neutron-fwaas/latest/
python-requires = >=3.6
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
@ -16,6 +17,7 @@ classifier =
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3 :: Only
[files]
packages =

21
tox.ini
View File

@ -1,9 +1,10 @@
[tox]
envlist = py27,py37,pep8,pylint
minversion = 2.0
envlist = py37,pep8,pylint
minversion = 3.1.1
skipsdist = True
[testenv]
basepython = python3
setenv = VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
usedevelop = True
@ -24,7 +25,6 @@ setenv = OS_TEST_TIMEOUT=180
commands = false
[testenv:dsvm]
basepython = python3
# Fake job to define environment variables shared between dsvm jobs
setenv = OS_SUDO_TESTING=1
OS_ROOTWRAP_CMD=sudo {envdir}/bin/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf
@ -34,7 +34,6 @@ setenv = OS_SUDO_TESTING=1
commands = false
[testenv:functional]
basepython = python3
setenv = {[testenv]setenv}
{[testenv:common]setenv}
OS_TEST_PATH=./neutron_fwaas/tests/functional
@ -43,7 +42,6 @@ commands =
stestr run {posargs}
[testenv:dsvm-fullstack]
basepython = python3
setenv = {[testenv]setenv}
{[testenv:common]setenv}
{[testenv:dsvm]setenv}
@ -57,7 +55,6 @@ commands =
[testenv:api]
basepython = python3
sitepackages=True
setenv =
OS_TEST_PATH=./neutron_fwaas/tests/tempest_plugin/tests/api/
@ -67,7 +64,6 @@ commands =
stestr run {posargs}
[testenv:scenario]
basepython = python3
sitepackages=True
setenv =
OS_TEST_PATH=./neutron_fwaas/tests/tempest_plugin/tests/scenario/
@ -77,7 +73,6 @@ commands =
stestr run {posargs}
[testenv:dsvm-functional]
basepython = python3
setenv =
OS_TEST_PATH=./neutron_fwaas/tests/functional
OS_SUDO_TESTING=1
@ -94,12 +89,10 @@ commands =
stestr run {posargs}
[testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:pep8]
basepython = python3
commands =
flake8
doc8 {posargs}
@ -110,7 +103,6 @@ commands =
whitelist_externals = sh
[testenv:cover]
basepython = python3
setenv = VIRTUAL_ENV={envdir}
LANGUAGE=en_US
PYTHON=coverage run --source neutron_fwaas --omit='*tests*' --parallel-mode
@ -123,12 +115,10 @@ commands =
coverage xml -o cover/coverage.xml
[testenv:venv]
basepython = python3
commands = {posargs}
deps = -r{toxinidir}/doc/requirements.txt
[testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
whitelist_externals =
rm
@ -137,7 +127,6 @@ commands =
sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs]
basepython = python3
envdir = {toxworkdir}/docs
deps = {[testenv:docs]deps}
whitelist_externals =
@ -179,7 +168,6 @@ exclude = .venv,.git,.tox,dist,doc,*lib/python*,.tmp,*egg,build,tools,.ropeproje
import-order-style = pep8
[testenv:pylint]
basepython = python3
deps =
{[testenv]deps}
pylint
@ -191,14 +179,12 @@ import_exceptions = neutron_fwaas._i18n
local-check-factory = neutron_lib.hacking.checks.factory
[testenv:genconfig]
basepython = python3
commands = {toxinidir}/tools/generate_config_file_samples.sh
[testenv:genpolicy]
commands = oslopolicy-sample-generator --config-file=etc/oslo-policy-generator/policy.conf
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
@ -211,7 +197,6 @@ commands =
pip install -q -e "git+https://git.openstack.org/openstack/neutron#egg=neutron"
[testenv:py3-dev]
basepython = python3
commands =
{[testenv:dev]commands}
{[testenv]commands}