From 40bd312410d6ff23ea5d8b6d6263f40bd456fffd Mon Sep 17 00:00:00 2001 From: Brian Rosmaita Date: Fri, 22 Nov 2019 10:11:52 -0500 Subject: [PATCH] Remove py2 testing, jobs Change tox.ini so that all jobs are python3, and add explicit unit/functional testenvs for the two ussuri python runtimes (3.6 and 3.7). Remove py2 jobs from .zuul.yaml and redefine the periodic "tips" jobs so that they are testing with the ussuri python runtimes. Added nodeset: ubuntu-bionic to the abstract base jobs so that py3.7 is available. Co-authored-by: Ghanshyam Mann Co-authored-by: Brian Rosmaita Closes-bug: #1853693 Change-Id: I15467c34fc8466fa1724c5401dc879ae77c1922d --- .zuul.yaml | 94 +++++++++++-------- .../notes/drop-py-2-7-863871c7bc047146.yaml | 6 ++ tox.ini | 70 ++++++-------- 3 files changed, 89 insertions(+), 81 deletions(-) create mode 100644 releasenotes/notes/drop-py-2-7-863871c7bc047146.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 37648e0f51..dc78624ef3 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -32,6 +32,8 @@ name: glance-tox-oslo-tips-base parent: tox abstract: true + nodeset: ubuntu-bionic + timeout: 2400 description: Abstract job for Glance vs. oslo libraries # NOTE(rosmaita): we only need functional test jobs, oslo is # already running periodic jobs using our unit tests. Those @@ -58,12 +60,13 @@ - name: openstack/taskflow - job: - name: glance-tox-functional-oslo-tips + name: glance-tox-functional-py37-oslo-tips parent: glance-tox-oslo-tips-base description: | - Glance py27 functional tests vs. oslo libraries masters + Glance py37 functional tests vs. oslo libraries masters vars: - tox_envlist: functional + python_version: 3.7 + tox_envlist: functional-py37 - job: name: glance-tox-functional-py36-oslo-tips @@ -71,12 +74,15 @@ description: | Glance py36 functional tests vs. oslo libraries masters vars: + python_version: 3.6 tox_envlist: functional-py36 - job: name: glance-tox-keystone-tips-base parent: tox abstract: true + nodeset: ubuntu-bionic + timeout: 2400 description: Abstract job for Glance vs. keystone required-projects: - name: openstack/keystoneauth @@ -84,12 +90,13 @@ - name: openstack/python-keystoneclient - job: - name: glance-tox-py27-keystone-tips + name: glance-tox-py37-keystone-tips parent: glance-tox-keystone-tips-base description: | - Glance py27 unit tests vs. keystone masters + Glance py37 unit tests vs. keystone masters vars: - tox_envlist: py27 + python_version: 3.7 + tox_envlist: py37 - job: name: glance-tox-py36-keystone-tips @@ -97,15 +104,17 @@ description: | Glance py36 unit tests vs. keystone masters vars: + python_version: 3.6 tox_envlist: py36 - job: - name: glance-tox-functional-keystone-tips + name: glance-tox-functional-py37-keystone-tips parent: glance-tox-keystone-tips-base description: | - Glance py27 functional tests vs. keystone masters + Glance py37 functional tests vs. keystone masters vars: - tox_envlist: functional + python_version: 3.7 + tox_envlist: functional-py37 - job: name: glance-tox-functional-py36-keystone-tips @@ -113,23 +122,27 @@ description: | Glance py36 functional tests vs. keystone masters vars: + python_version: 3.6 tox_envlist: functional-py36 - job: name: glance-tox-glance_store-tips-base parent: tox abstract: true + nodeset: ubuntu-bionic + timeout: 2400 description: Abstract job for Glance vs. glance_store required-projects: - name: openstack/glance_store - job: - name: glance-tox-py27-glance_store-tips + name: glance-tox-py37-glance_store-tips parent: glance-tox-glance_store-tips-base description: | - Glance py27 unit tests vs. glance_store master + Glance py37 unit tests vs. glance_store master vars: - tox_envlist: py27 + python_version: 3.7 + tox_envlist: py37 - job: name: glance-tox-py36-glance_store-tips @@ -137,15 +150,17 @@ description: | Glance py36 unit tests vs. glance_store master vars: + python_version: 3.6 tox_envlist: py36 - job: - name: glance-tox-functional-glance_store-tips + name: glance-tox-functional-py37-glance_store-tips parent: glance-tox-glance_store-tips-base description: | - Glance py27 functional tests vs. glance_store master + Glance py37 functional tests vs. glance_store master vars: - tox_envlist: functional + python_version: 3.7 + tox_envlist: functional-py37 - job: name: glance-tox-functional-py36-glance_store-tips @@ -153,12 +168,15 @@ description: | Glance py36 functional tests vs. glance_store master vars: + python_version: 3.6 tox_envlist: functional-py36 - job: name: glance-tox-cursive-tips-base parent: tox abstract: true + nodeset: ubuntu-bionic + timeout: 2400 description: Abstract job for Glance vs. cursive and related libs required-projects: - name: x/cursive @@ -166,12 +184,13 @@ - name: openstack/castellan - job: - name: glance-tox-py27-cursive-tips + name: glance-tox-py37-cursive-tips parent: glance-tox-cursive-tips-base description: | - Glance py27 unit tests vs. cursive (and related libs) master + Glance py37 unit tests vs. cursive (and related libs) master vars: - tox_envlist: py27 + python_version: 3.7 + tox_envlist: py37 - job: name: glance-tox-py36-cursive-tips @@ -179,15 +198,17 @@ description: | Glance py36 unit tests vs. cursive (and related libs) master vars: + python_version: 3.6 tox_envlist: py36 - job: - name: glance-tox-functional-cursive-tips + name: glance-tox-functional-py37-cursive-tips parent: glance-tox-cursive-tips-base description: | - Glance py27 functional tests vs. cursive (and related libs) master + Glance py37 functional tests vs. cursive (and related libs) master vars: - tox_envlist: functional + python_version: 3.7 + tox_envlist: functional-py37 - job: name: glance-tox-functional-py36-cursive-tips @@ -195,22 +216,21 @@ description: | Glance py36 functional tests vs. cursive (and related libs) master vars: + python_version: 3.6 tox_envlist: functional-py36 - project: templates: - check-requirements - - integrated-gate - integrated-gate-storage - openstack-lower-constraints-jobs - - openstack-python-jobs - - openstack-python3-train-jobs + - openstack-python3-ussuri-jobs - periodic-stable-jobs - publish-openstack-docs-pti - release-notes-jobs-python3 check: jobs: - - openstack-tox-functional + - openstack-tox-functional-py36 - openstack-tox-functional-py37 - glance-code-constants-check - devstack-plugin-ceph-tempest: @@ -230,8 +250,6 @@ - ^tools/.*$ - ^tox.ini$ - ^\.zuul\.yaml$ - - tempest-full: - irrelevant-files: *tempest-irrelevant-files - tempest-integrated-storage: irrelevant-files: *tempest-irrelevant-files - grenade-py3: @@ -239,19 +257,17 @@ gate: jobs: - - openstack-tox-functional + - openstack-tox-functional-py36 - openstack-tox-functional-py37 - - tempest-full: - irrelevant-files: *tempest-irrelevant-files - tempest-integrated-storage: irrelevant-files: *tempest-irrelevant-files - grenade-py3: irrelevant-files: *tempest-irrelevant-files experimental: jobs: - - glance-tox-py27-glance_store-tips + - glance-tox-py37-glance_store-tips - glance-tox-py36-glance_store-tips - - glance-tox-functional-glance_store-tips + - glance-tox-functional-py37-glance_store-tips - glance-tox-functional-py36-glance_store-tips - barbican-simple-crypto-devstack-tempest - glance-dsvm-grenade-multinode @@ -275,31 +291,31 @@ # to define these jobs in the openstack/project-config repo. # That would make us less agile in adjusting these tests, so we # aren't doing that either. - - glance-tox-functional-oslo-tips: + - glance-tox-functional-py37-oslo-tips: branches: master - glance-tox-functional-py36-oslo-tips: branches: master - - glance-tox-py27-keystone-tips: + - glance-tox-py37-keystone-tips: branches: master - glance-tox-py36-keystone-tips: branches: master - - glance-tox-functional-keystone-tips: + - glance-tox-functional-py37-keystone-tips: branches: master - glance-tox-functional-py36-keystone-tips: branches: master - - glance-tox-py27-glance_store-tips: + - glance-tox-py37-glance_store-tips: branches: master - glance-tox-py36-glance_store-tips: branches: master - - glance-tox-functional-glance_store-tips: + - glance-tox-functional-py37-glance_store-tips: branches: master - glance-tox-functional-py36-glance_store-tips: branches: master - - glance-tox-py27-cursive-tips: + - glance-tox-py37-cursive-tips: branches: master - glance-tox-py36-cursive-tips: branches: master - - glance-tox-functional-cursive-tips: + - glance-tox-functional-py37-cursive-tips: branches: master - glance-tox-functional-py36-cursive-tips: branches: master diff --git a/releasenotes/notes/drop-py-2-7-863871c7bc047146.yaml b/releasenotes/notes/drop-py-2-7-863871c7bc047146.yaml new file mode 100644 index 0000000000..cf61f3f8ee --- /dev/null +++ b/releasenotes/notes/drop-py-2-7-863871c7bc047146.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + Python 2.7 support has been dropped. Last release of Glance + to support py2.7 is OpenStack Train (Glance 19.x). The minimum + version of Python now supported by Glance is Python 3.6. diff --git a/tox.ini b/tox.ini index 6f720d7200..0dcdb29e05 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,16 @@ [tox] -minversion = 2.3.1 -envlist = functional-py37,py37,py27,functional,pep8 +minversion = 3.1.0 +# python runtimes: https://governance.openstack.org/tc/reference/runtimes/ussuri.html +envlist = functional-py37,py37,py36,pep8 skipsdist = True +skip_missing_interpreters = true +# 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] # Set default python version +basepython = python3 setenv = VIRTUAL_ENV={envdir} PYTHONWARNINGS=default::DeprecationWarning @@ -29,45 +35,32 @@ whitelist_externals = bash rm passenv = *_proxy *_PROXY -[testenv:py27] -basepython = python2.7 -commands = stestr run --slowest {posargs} - [testenv:py36] -basepython = python3.6 commands = stestr run --slowest {posargs} [testenv:py37] -basepython = python3.7 +commands = stestr run --slowest {posargs} + +[testenv:py38] commands = stestr run --slowest {posargs} [testenv:functional] -basepython = python2.7 +# this will use whatever the system python3 is setenv = TEST_PATH = ./glance/tests/functional -ignore_errors = True -commands = - stestr run {posargs} +commands = stestr run {posargs} [testenv:functional-py36] -basepython = python3.6 -setenv = - TEST_PATH = ./glance/tests/functional -ignore_errors = True -whitelist_externals = - bash -commands = - stestr run {posargs} +setenv = {[testenv:functional]setenv} +commands = {[testenv:functional]commands} [testenv:functional-py37] -basepython = python3.7 -setenv = - TEST_PATH = ./glance/tests/functional -ignore_errors = True -whitelist_externals = - bash -commands = - stestr run {posargs} +setenv = {[testenv:functional]setenv} +commands = {[testenv:functional]commands} + +[testenv:functional-py38] +setenv = {[testenv:functional]setenv} +commands = {[testenv:functional]commands} [testenv:gateonly] # NOTE(rosmaita): these tests catch configuration problems for some code @@ -75,14 +68,12 @@ commands = # so they don't affect local development # TODO(someone other than me): figure out how to make these changes either # automatic or unnecessary -basepython = python3 setenv = TEST_PATH = ./glance/tests/gate commands = stestr run {posargs} [testenv:pep8] -basepython = python3 commands = flake8 {posargs} # Run security linter @@ -91,7 +82,6 @@ commands = doc8 {posargs} [testenv:genconfig] -basepython = python3 commands = oslo-config-generator --config-file etc/oslo-config-generator/glance-api.conf oslo-config-generator --config-file etc/oslo-config-generator/glance-registry.conf @@ -101,7 +91,6 @@ commands = oslo-config-generator --config-file etc/oslo-config-generator/glance-image-import.conf [testenv:api-ref] -basepython = python3 # This environment is called from CI scripts to test and publish # the API Ref to docs.openstack.org. deps = @@ -112,7 +101,6 @@ commands = sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html [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 @@ -140,7 +128,6 @@ local-check-factory = glance.hacking.checks.factory import_exceptions = glance.i18n [testenv:docs] -basepython = python3 deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/doc/requirements.txt @@ -150,11 +137,9 @@ commands = whereto doc/source/_extra/.htaccess doc/test/redirect-tests.txt [testenv:venv] -basepython = python3 commands = {posargs} [testenv:releasenotes] -basepython = python3 deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/doc/requirements.txt @@ -162,7 +147,6 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:cover] -basepython = python3 setenv = PYTHON=coverage run --source glance --parallel-mode commands = @@ -172,21 +156,23 @@ commands = coverage xml -o cover/coverage.xml [testenv:debug] -basepython = python3 +# this will use whatever the system python3 is commands = oslo_debug_helper {posargs} -[testenv:debug-py27] +[testenv:debug-py36] commands = oslo_debug_helper {posargs} -[testenv:debug-py35] -basepython = python3.5 +[testenv:debug-py37] +commands = + oslo_debug_helper {posargs} + +[testenv:debug-py38] commands = oslo_debug_helper {posargs} [testenv:lower-constraints] -basepython = python3 deps = -c{toxinidir}/lower-constraints.txt -r{toxinidir}/test-requirements.txt