Remove Python 2.7 support from testing and gates

Makes Python 3 the base python for all tox venvs and removes
py2 jobs from zuul.yaml.

Remaining:
- move the legacy gate jobs from openstack-zuul-jobs to the os-brick
  repo and make them py3 jobs
- adjust setup.cfg to require py3 and remove py2 requirements from
  test-requirements.txt and doc/requirements.txt

Partial-bug: #1853372

Change-Id: Ib447656aa213914bafd50380b3821090f93776f8
This commit is contained in:
Brian Rosmaita 2019-12-04 16:24:05 -05:00
parent 331316827a
commit ecff5ec771
4 changed files with 15 additions and 18 deletions

View File

@ -1,10 +1,8 @@
- project: - project:
templates: templates:
- check-requirements - check-requirements
- lib-forward-testing
- lib-forward-testing-python3 - lib-forward-testing-python3
- openstack-lower-constraints-jobs - openstack-lower-constraints-jobs
- openstack-python-jobs
- openstack-python3-ussuri-jobs - openstack-python3-ussuri-jobs
- publish-openstack-docs-pti - publish-openstack-docs-pti
- release-notes-jobs-python3 - release-notes-jobs-python3

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
Python 2.7 support has been dropped. Beginning with os-brick
release 3.0.0, the minimum version of Python supported by
os-brick is Python 3.6.

View File

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

23
tox.ini
View File

@ -1,9 +1,15 @@
[tox] [tox]
minversion = 2.0 minversion = 3.1.0
envlist = py27,py37,pep8
skipsdist = True skipsdist = True
skip_missing_interpreters = true
# python runtimes: https://governance.openstack.org/tc/reference/runtimes/ussuri.html
envlist = py37,py36,pep8
# 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] [testenv]
basepython = python3
usedevelop = True usedevelop = True
setenv = setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
@ -21,7 +27,7 @@ deps =
# By default stestr will set concurrency # By default stestr will set concurrency
# to ncpu, to specify something else use # to ncpu, to specify something else use
# the concurrency=<n> option. # the concurrency=<n> option.
# call ie: 'tox -epy27 -- --concurrency=4' # call example: 'tox -epy37 -- --concurrency=4'
commands = commands =
stestr run {posargs} stestr run {posargs}
stestr slowest stestr slowest
@ -31,23 +37,19 @@ whitelist_externals = bash
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
[testenv:debug] [testenv:debug]
basepython = python3
commands = commands =
find . -type f -name "*.pyc" -delete find . -type f -name "*.pyc" -delete
oslo_debug_helper {posargs} oslo_debug_helper {posargs}
[testenv:pep8] [testenv:pep8]
basepython = python3
commands = flake8 {posargs} commands = flake8 {posargs}
[testenv:fast8] [testenv:fast8]
basepython = python3
envdir = {toxworkdir}/pep8 envdir = {toxworkdir}/pep8
commands = commands =
{toxinidir}/tools/fast8.sh {toxinidir}/tools/fast8.sh
[testenv:pylint] [testenv:pylint]
basepython = python3
deps = deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
@ -55,11 +57,9 @@ deps =
commands = bash tools/lintstack.sh commands = bash tools/lintstack.sh
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[testenv:cover] [testenv:cover]
basepython = python3
# To see the report of missing coverage add to commands # To see the report of missing coverage add to commands
# coverage report --show-missing # coverage report --show-missing
setenv = setenv =
@ -72,7 +72,6 @@ commands =
coverage xml -o cover/coverage/xml coverage xml -o cover/coverage/xml
[testenv:docs] [testenv:docs]
basepython = python3
deps = deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt -r{toxinidir}/doc/requirements.txt
@ -83,7 +82,6 @@ whitelist_externals = rm
[testenv:pdf-docs] [testenv:pdf-docs]
basepython = python3
deps = {[testenv:docs]deps} deps = {[testenv:docs]deps}
commands = {[testenv:docs]commands} commands = {[testenv:docs]commands}
sphinx-build -W -b latex doc/source doc/build/pdf sphinx-build -W -b latex doc/source doc/build/pdf
@ -92,7 +90,6 @@ whitelist_externals =
make make
[testenv:releasenotes] [testenv:releasenotes]
basepython = python3
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8] [flake8]
@ -119,7 +116,6 @@ max-complexity=30
import_exceptions = os_brick.i18n import_exceptions = os_brick.i18n
[testenv:bindep] [testenv:bindep]
basepython = python3
# Do not install any requirements. We want this to be fast and work even if # 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 # system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed # dependencies are missing! This also means that bindep must be installed
@ -131,7 +127,6 @@ commands = bindep test
usedevelop = False usedevelop = False
[testenv:lower-constraints] [testenv:lower-constraints]
basepython = python3
deps = deps =
-c{toxinidir}/lower-constraints.txt -c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt