From baccd5bcfa316cec04908e21d5fd95ef52edccfe Mon Sep 17 00:00:00 2001 From: Eric Fried Date: Fri, 25 Oct 2019 09:28:16 -0500 Subject: [PATCH] Stop supporting and testing python2 Change-Id: If678d77b8da69121b0075bfbc4216531be25da6a --- .zuul.yaml | 3 +-- .../novaclient-dsvm-functional/run.yaml | 1 + ...drop-python2-support-d3a1bedc75445edc.yaml | 4 ++++ setup.cfg | 2 -- tox.ini | 20 ++----------------- 5 files changed, 8 insertions(+), 22 deletions(-) create mode 100644 releasenotes/notes/drop-python2-support-d3a1bedc75445edc.yaml diff --git a/.zuul.yaml b/.zuul.yaml index c44db2efa..95eabd355 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,4 +1,5 @@ - job: + # TODO(efried): Cut over to zuulv3 name: novaclient-dsvm-functional parent: legacy-dsvm-base run: playbooks/legacy/novaclient-dsvm-functional/run.yaml @@ -16,11 +17,9 @@ - project: templates: - check-requirements - - lib-forward-testing - lib-forward-testing-python3 - openstack-cover-jobs - openstack-lower-constraints-jobs - - openstack-python-jobs - openstack-python3-ussuri-jobs - publish-openstack-docs-pti - release-notes-jobs-python3 diff --git a/playbooks/legacy/novaclient-dsvm-functional/run.yaml b/playbooks/legacy/novaclient-dsvm-functional/run.yaml index a3d1f4979..183d3989c 100644 --- a/playbooks/legacy/novaclient-dsvm-functional/run.yaml +++ b/playbooks/legacy/novaclient-dsvm-functional/run.yaml @@ -27,6 +27,7 @@ cmd: | set -e set -x + export DEVSTACK_GATE_USE_PYTHON3=true export PYTHONUNBUFFERED=true export BRANCH_OVERRIDE=default export DEVSTACK_PROJECT_FROM_GIT=python-novaclient diff --git a/releasenotes/notes/drop-python2-support-d3a1bedc75445edc.yaml b/releasenotes/notes/drop-python2-support-d3a1bedc75445edc.yaml new file mode 100644 index 000000000..9fd7dee19 --- /dev/null +++ b/releasenotes/notes/drop-python2-support-d3a1bedc75445edc.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + Python 2 is no longer supported. Python 3 is required. diff --git a/setup.cfg b/setup.cfg index 42b82ac21..d2048632d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,8 +16,6 @@ classifier = License :: OSI Approved :: Apache Software License Operating System :: OS Independent 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 diff --git a/tox.ini b/tox.ini index ce99fb0b7..2b9cb62db 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,10 @@ [tox] -envlist = py27,py37,pep8,docs +envlist = py37,pep8,docs minversion = 2.0 skipsdist = True [testenv] +basepython = python3 usedevelop = True # tox is silly... these need to be separated by a newline.... whitelist_externals = @@ -22,15 +23,12 @@ commands = stestr run {posargs} [testenv:pep8] -basepython = python3 commands = flake8 {posargs} [testenv:bandit] -basepython = python3 commands = bandit -r novaclient -n5 -x tests [testenv:venv] -basepython = python3 deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/test-requirements.txt @@ -39,7 +37,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 @@ -51,7 +48,6 @@ commands = whereto doc/build/html/.htaccess doc/test/redirect-tests.txt [testenv:pdf-docs] -basepython = python3 envdir = {toxworkdir}/docs deps = {[testenv:docs]deps} commands = @@ -60,7 +56,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 @@ -69,21 +64,12 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:functional] -basepython = python2.7 -passenv = OS_NOVACLIENT_TEST_NETWORK -commands = - stestr --test-path=./novaclient/tests/functional run --concurrency=1 {posargs} - python novaclient/tests/functional/hooks/check_resources.py - -[testenv:functional-py36] -basepython = python3.6 passenv = OS_NOVACLIENT_TEST_NETWORK commands = stestr --test-path=./novaclient/tests/functional run --concurrency=1 {posargs} python novaclient/tests/functional/hooks/check_resources.py [testenv:cover] -basepython = python3 setenv = PYTHON=coverage run --source novaclient --parallel-mode commands = @@ -110,7 +96,6 @@ exclude=.venv,.git,.tox,dist,*lib/python*,*egg,build,doc/source/conf.py,releasen import_exceptions = novaclient.i18n [testenv:bindep] -basepython = python3 # 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 # dependencies are missing! This also means that bindep must be installed @@ -119,7 +104,6 @@ deps = bindep commands = bindep test [testenv:lower-constraints] -basepython = python3 deps = -c{toxinidir}/lower-constraints.txt -r{toxinidir}/test-requirements.txt