From ab6898aa7fe748d8976664a38fe16e42d11cbe4b Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Fri, 15 Nov 2019 01:29:13 +0000 Subject: [PATCH] [ussuri][goal] Drop python 2.7 support and testing OpenStack is dropping the py2.7 support in ussuri cycle. Barbican is ready with python 3 and ok to drop the python 2.7 support. Complete discussion & schedule can be found in - http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html - https://etherpad.openstack.org/p/drop-python2-support Ussuri Communtiy-wide goal: https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html Depends-On: https://review.opendev.org/#/c/693631/ Change-Id: I77bf25fedb45433c7dbe655b4fd0c24dcf030549 --- .zuul.yaml | 5 ----- doc/requirements.txt | 3 +-- .../legacy/barbican-devstack-base/run.yaml | 10 +--------- .../run.yaml | 6 +----- .../run-ipv6.yaml | 8 +------- .../barbican-devstack-tempest-base/run.yaml | 7 +------ .../notes/drop-py-2-7-f745ea90b33c7910.yaml | 6 ++++++ setup.cfg | 2 -- tox.ini | 19 ++----------------- 9 files changed, 13 insertions(+), 53 deletions(-) create mode 100644 releasenotes/notes/drop-py-2-7-f745ea90b33c7910.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 86b6eba3c..be9dcb09f 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -3,7 +3,6 @@ parent: legacy-dsvm-base vars: database: sql - python_version: py36 services: tempest,rabbit,mysql,key required-projects: - openstack/devstack-gate @@ -19,7 +18,6 @@ parent: legacy-base vars: database: sql - python_version: py27 services: tempest,keystone required-projects: - openstack/devstack @@ -35,7 +33,6 @@ name: barbican-devstack-tempest-base parent: legacy-dsvm-base vars: - python_version: py27 database: sql castellan_from_git: 0 cursive: 0 @@ -58,7 +55,6 @@ # non-voting until https://pagure.io/dogtagpki/issue/3108 is fixed voting: false vars: - python_version: py35 services: barbican-dogtag,tempest,rabbit,mysql,key plugin: dogtag post-run: playbooks/legacy/barbican-devstack-functional-base/dogtag-post.yaml @@ -155,7 +151,6 @@ - check-requirements - 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/doc/requirements.txt b/doc/requirements.txt index 9ca111a80..62b531000 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,5 +1,4 @@ -sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD -sphinx>=1.8.0,!=2.1.0;python_version>='3.4' # BSD +sphinx>=1.8.0,!=2.1.0 # BSD sphinxcontrib-httpdomain>=1.3.0 # BSD sphinxcontrib-blockdiag>=1.5.4 # BSD sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD diff --git a/playbooks/legacy/barbican-devstack-base/run.yaml b/playbooks/legacy/barbican-devstack-base/run.yaml index c20bf53fb..905d5c7f4 100644 --- a/playbooks/legacy/barbican-devstack-base/run.yaml +++ b/playbooks/legacy/barbican-devstack-base/run.yaml @@ -33,15 +33,7 @@ export PROJECTS="openstack/python-barbicanclient $PROJECTS" export PROJECTS="openstack/barbican-tempest-plugin $PROJECTS" export DEVSTACK_LOCAL_CONFIG="enable_plugin barbican https://opendev.org/openstack/barbican" - if [[ "{{ python_version }}" == py3* ]] ; then - export DEVSTACK_GATE_USE_PYTHON3=True - export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-account" - export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-container" - export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-object" - export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-proxy" - else - export DEVSTACK_GATE_USE_PYTHON3=False - fi + export DEVSTACK_GATE_USE_PYTHON3=True function gate_hook { $BASE/new/barbican/devstack/gate_hook.sh diff --git a/playbooks/legacy/barbican-devstack-functional-base/run.yaml b/playbooks/legacy/barbican-devstack-functional-base/run.yaml index b9fc4fed6..fce0eb715 100644 --- a/playbooks/legacy/barbican-devstack-functional-base/run.yaml +++ b/playbooks/legacy/barbican-devstack-functional-base/run.yaml @@ -46,11 +46,7 @@ export PROJECTS="openstack/python-barbicanclient $PROJECTS" export PROJECTS="openstack/barbican-tempest-plugin $PROJECTS" - if [[ "{{ python_version }}" == py3* ]] ; then - export DEVSTACK_GATE_USE_PYTHON3=True - else - export DEVSTACK_GATE_USE_PYTHON3=False - fi + export DEVSTACK_GATE_USE_PYTHON3=True function gate_hook { $BASE/new/barbican/devstack/gate_hook.sh diff --git a/playbooks/legacy/barbican-devstack-tempest-base/run-ipv6.yaml b/playbooks/legacy/barbican-devstack-tempest-base/run-ipv6.yaml index cfa402b5b..a2beed98b 100644 --- a/playbooks/legacy/barbican-devstack-tempest-base/run-ipv6.yaml +++ b/playbooks/legacy/barbican-devstack-tempest-base/run-ipv6.yaml @@ -53,19 +53,13 @@ fi } export -f pre_test_hook - + export DEVSTACK_GATE_USE_PYTHON3=True if [ "{{ database }}" == "postgres" ] ; then export DEVSTACK_GATE_POSTGRES=1 elif [ "{{ castellan_from_git }}" == "1" ] ; then export DEVSTACK_PROJECT_FROM_GIT="castellan" elif [ "{{ cursive }}" == "1" ] ; then export DEVSTACK_PROJECT_FROM_GIT="cursive" - elif [ "{{ python_version }}" == "py35" ] ; then - export DEVSTACK_GATE_USE_PYTHON3=True - export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-account" - export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-container" - export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-object" - export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-proxy" fi function post_test_hook { diff --git a/playbooks/legacy/barbican-devstack-tempest-base/run.yaml b/playbooks/legacy/barbican-devstack-tempest-base/run.yaml index 8d760ee9d..be059c8c0 100644 --- a/playbooks/legacy/barbican-devstack-tempest-base/run.yaml +++ b/playbooks/legacy/barbican-devstack-tempest-base/run.yaml @@ -49,6 +49,7 @@ fi } export -f pre_test_hook + export DEVSTACK_GATE_USE_PYTHON3=True if [ "{{ database }}" == "postgres" ] ; then export DEVSTACK_GATE_POSTGRES=1 @@ -56,12 +57,6 @@ export DEVSTACK_PROJECT_FROM_GIT="castellan" elif [ "{{ cursive }}" == "1" ] ; then export DEVSTACK_PROJECT_FROM_GIT="cursive" - elif [[ "{{ python_version }}" == py3* ]] ; then - export DEVSTACK_GATE_USE_PYTHON3=True - export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-account" - export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-container" - export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-object" - export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-proxy" fi cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh diff --git a/releasenotes/notes/drop-py-2-7-f745ea90b33c7910.yaml b/releasenotes/notes/drop-py-2-7-f745ea90b33c7910.yaml new file mode 100644 index 000000000..e8cdff19b --- /dev/null +++ b/releasenotes/notes/drop-py-2-7-f745ea90b33c7910.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + Python 2.7 support has been dropped. Last release of Barbican + to support python 2.7 is OpenStack Train. The minimum version of Python now + supported by Barbican is Python 3.6. diff --git a/setup.cfg b/setup.cfg index a40e8cfa1..9c7c15cbf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/tox.ini b/tox.ini index b0f091ea5..75d9014ea 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,10 @@ [tox] minversion = 2.0 -envlist = py27,py36,py37,pep8,docs +envlist = py36,py37,pep8,docs skipsdist = True [testenv] +basepython = python3 setenv = PYTHON=coverage run --source barbican --parallel-mode usedevelop = True @@ -24,7 +25,6 @@ commands = whitelist_externals = rm [testenv:cover] -basepython = python3 deps = {[testenv]deps} diff_cover @@ -37,14 +37,12 @@ commands = diff-cover --fail-under 100 --compare-branch master cover/coverage.xml [testenv:releasenotes] -basepython = python3 deps = -r{toxinidir}/doc/requirements.txt commands = rm -rf releasenotes/build sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:pep8] -basepython = python3 sitepackages = False commands = doc8 {posargs} @@ -53,24 +51,20 @@ commands = bandit -r barbican -x tests -n5 -s B105 [testenv:genconfig] -basepython = python3 whitelist_externals = bash envdir = {toxworkdir}/pep8 commands = oslo-config-generator --config-file etc/oslo-config-generator/barbican.conf [testenv:venv] -basepython = python3 commands = {posargs} [testenv:debug] -basepython = python3 commands = oslo_debug_helper -t barbican/tests {posargs} [testenv:py3pep8] # This hack is in place to allow us to run py3 based flake8 # without installing barbican. -basepython = python3 install_command = /bin/echo {packages} commands = pip install "hacking>=0.10.0,<0.11" @@ -80,7 +74,6 @@ commands = # This environment is called from CI scripts to test and publish # the main docs to https://docs.openstack.org/barbican description = Build main documentation -basepython = python3 deps = -r{toxinidir}/doc/requirements.txt commands= rm -rf doc/build doc/build/doctrees @@ -88,7 +81,6 @@ commands= whitelist_externals = rm [testenv:pdf-docs] -basepython = python3 deps = {[testenv:docs]deps} whitelist_externals = make @@ -97,7 +89,6 @@ commands = make -C doc/build/pdf [testenv:api-guide] -basepython = python3 # This environment is called from CI scripts to test and publish # the API Guide to docs.openstack.org. deps = -r{toxinidir}/doc/requirements.txt @@ -107,7 +98,6 @@ commands = [testenv:all-docs] description = Build all documentation -basepython = python3 deps = -r{toxinidir}/doc/requirements.txt commands= {[testenv:docs]commands} @@ -133,7 +123,6 @@ passenv = KMIP_PLUGIN_ENABLED PKCS11_PLUGIN_ENABLED [testenv:cmd] -basepython = python3 # This tox env is purely to make local test development easier # Note: This requires local running instances of Barbican and Keystone deps = -r{toxinidir}/test-requirements.txt @@ -156,12 +145,10 @@ exclude = .git,.idea,.tox,bin,dist,debian,rpmbuild,tools,*.egg-info,*.eggs,contr *docs/target,*.egg,build [testenv:bandit] -basepython = python3 deps = -r{toxinidir}/test-requirements.txt commands = bandit -r barbican -x tests -n5 [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 @@ -170,7 +157,6 @@ deps = bindep commands = bindep test [testenv:genpolicy] -basepython = python3 envdir = {toxworkdir}/pep8 commands = oslopolicy-sample-generator --config-file=etc/oslo-config-generator/policy.conf @@ -178,7 +164,6 @@ commands = oslopolicy-sample-generator --config-file=etc/oslo-config-generator/p local-check-factory = barbican.hacking.checks.factory [testenv:lower-constraints] -basepython = python3 deps = -c{toxinidir}/lower-constraints.txt -r{toxinidir}/test-requirements.txt