diff --git a/.zuul.yaml b/.zuul.yaml index 4ddc32314f7e..b6bcf999c202 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,5 +1,10 @@ # See https://docs.openstack.org/infra/manual/drivers.html#naming-with-zuul-v3 # for job naming conventions. + +# TODO(stephenfin): Remove 'USE_PYTHON3' once [1] or similar merges +# +# [1] https://review.opendev.org/#/c/649097/ +# - job: name: nova-dsvm-multinode-base parent: legacy-dsvm-base-multinode @@ -24,17 +29,17 @@ - ^nova/test.py$ - ^releasenotes/.*$ - ^setup.cfg$ - - ^tests-py3.txt$ - ^tools/.*$ - ^tox.ini$ - job: - name: nova-tox-functional + name: nova-tox-functional-py36 parent: openstack-tox + nodeset: ubuntu-bionic description: | - Run tox-based functional tests for the OpenStack Nova project with Nova - specific irrelevant-files list. Uses tox with the ``functional`` - environment. + Run tox-based functional tests for the OpenStack Nova project + under cPython version 3.6 with Nova specific irrelevant-files list. + Uses tox with the ``functional-py36`` environment. This job also provides a parent for other projects to run the nova functional tests on their own changes. @@ -48,35 +53,12 @@ - ^doc/(source|test)/.*$ - ^nova/locale/.*$ - ^releasenotes/.*$ - vars: - # explicitly stating the work dir makes this job reusable by other - # projects - zuul_work_dir: src/opendev.org/openstack/nova - tox_envlist: functional - tox_install_siblings: true - timeout: 3600 - -- job: - name: nova-tox-functional-py36 - parent: openstack-tox - nodeset: ubuntu-bionic - description: | - Run tox-based functional tests for the OpenStack Nova project - under cPython version 3.6 with Nova specific irrelevant-files list. - Uses tox with the ``functional-py36`` environment. - - This job also provides a parent for other projects (notably placement) - to run the nova functional tests on their own changes. - required-projects: - # including nova here makes this job reusable by other projects - - openstack/nova - - openstack/placement - irrelevant-files: *functional-irrelevant-files vars: # explicitly stating the work dir makes this job reusable by other # projects zuul_work_dir: src/opendev.org/openstack/nova tox_envlist: functional-py36 + tox_install_siblings: true bindep_profile: test py36 timeout: 3600 @@ -138,7 +120,6 @@ - ^nova/test.py$ - ^releasenotes/.*$ - ^setup.cfg$ - - ^tests-py3.txt$ - ^tools/.*$ - ^tox.ini$ # TODO(mriedem): Make this voting and gating once bug 1771700 is fixed @@ -223,6 +204,7 @@ bridge_mappings: public:br-ex resource_provider_bandwidths: br-ex:1000000:1000000 devstack_localrc: + USE_PYTHON3: True # Added in Pike. NOVA_USE_SERVICE_TOKEN: True # Enable TLS between the noVNC proxy & compute nodes; this requires @@ -243,6 +225,7 @@ group-vars: subnode: devstack_localrc: + USE_PYTHON3: True NOVA_USE_SERVICE_TOKEN: True NOVA_CONSOLE_PROXY_COMPUTE_TLS: True devstack_services: @@ -262,6 +245,7 @@ tox_envlist: all tempest_test_regex: api.*compute devstack_localrc: + USE_PYTHON3: True TEMPEST_COMPUTE_TYPE: compute_legacy - job: @@ -321,6 +305,7 @@ # Disable other non-essential services that we don't need for this job. c-bak: false devstack_localrc: + USE_PYTHON3: True # Setup two non-cell0 cells (cell1 and cell2). NOVA_NUM_CELLS: 2 # Resize to the same host is supported for now since we only have @@ -334,10 +319,12 @@ group-vars: peers: devstack_localrc: + USE_PYTHON3: True NOVA_ALLOW_MOVE_TO_SAME_HOST: true LIVE_MIGRATION_AVAILABLE: false subnode: devstack_localrc: + USE_PYTHON3: True # The subnode compute will get registered with cell2. NOVA_CPU_CELL: 2 devstack_services: @@ -367,8 +354,7 @@ - integrated-gate-compute - openstack-cover-jobs - 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 @@ -396,7 +382,6 @@ - nova-lvm - nova-multi-cell - nova-next - - nova-tox-functional - nova-tox-functional-py36 - tempest-integrated-compute: irrelevant-files: *dsvm-irrelevant-files @@ -408,7 +393,6 @@ jobs: - nova-grenade-multinode - nova-live-migration - - nova-tox-functional - nova-tox-functional-py36 - nova-multi-cell - nova-next diff --git a/releasenotes/notes/drop-python-2-7-73d3113c69d724d6.yaml b/releasenotes/notes/drop-python-2-7-73d3113c69d724d6.yaml new file mode 100644 index 000000000000..355f9ee294aa --- /dev/null +++ b/releasenotes/notes/drop-python-2-7-73d3113c69d724d6.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + Python 2.7 support has been dropped. The minimum version of Python now + supported by nova is Python 3.6. diff --git a/requirements.txt b/requirements.txt index f623b60bff72..262ca29e7d2e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,7 +23,6 @@ netaddr>=0.7.18 # BSD netifaces>=0.10.4 # MIT paramiko>=2.0.0 # LGPLv2.1+ Babel!=2.4.0,>=2.3.4 # BSD -enum34>=1.0.4;python_version=='2.7' or python_version=='2.6' or python_version=='3.3' # BSD iso8601>=0.1.11 # MIT jsonschema>=2.6.0 # MIT python-cinderclient!=4.0.0,>=3.3.0 # Apache-2.0 diff --git a/setup.cfg b/setup.cfg index 9dc249a5dcc2..22cdff1c163b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,6 +6,7 @@ description-file = author = OpenStack author-email = openstack-discuss@lists.openstack.org home-page = https://docs.openstack.org/nova/latest/ +python-requires = >=3.6 classifier = Environment :: OpenStack Intended Audience :: Information Technology @@ -13,11 +14,11 @@ 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 + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: Implementation :: CPython [extras] osprofiler = diff --git a/test-requirements.txt b/test-requirements.txt index c8c8cb1c50c3..aae938f1c214 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,7 +3,6 @@ # process, which may cause wedges in the gate later. hacking>=1.1.0,<1.2.0 # Apache-2.0 -contextlib2>=0.5.5;python_version<'3.0' # PSF License coverage!=4.4,>=4.0 # Apache-2.0 ddt>=1.0.1 # MIT fixtures>=3.0.0 # Apache-2.0/BSD diff --git a/tox.ini b/tox.ini index 82a78bc4aa3b..614bab6b8060 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.1.1 -envlist = py27,py37,functional,pep8 +envlist = py37,functional,pep8 # Automatic envs (pyXX) will only use the python version appropriate to that # env and ignore basepython inherited from [testenv] if we set # ignore_basepython_conflict. @@ -36,10 +36,6 @@ passenv = commands = stestr run {posargs} env TEST_OSPROFILER=1 stestr run --combine --no-discover 'nova.tests.unit.test_profiler' - -[testenv:py27] -commands = - {[testenv]commands} stestr slowest [testenv:pep8] @@ -61,13 +57,8 @@ commands = bash tools/flake8wrap.sh -HEAD [testenv:functional] -# TODO(melwitt): This can be removed when functional tests are gating with -# python 3.x -# NOTE(cdent): For a while, we shared functional virtualenvs with the unit -# tests, to save some time. However, this conflicts with tox siblings in zuul, -# and we need siblings to make testing against master of other projects work. -basepython = python2.7 -setenv = {[testenv]setenv} +description = + Run functional tests using python3. # As nova functional tests import the PlacementFixture from the placement # repository these tests are, by default, set up to run with latest master from # the placement repo. In the gate, Zuul will clone the latest master from @@ -92,18 +83,16 @@ commands = stestr --test-path=./nova/tests/functional run {posargs} stestr slowest -# TODO(gcb) Merge this into [testenv:functional] when functional tests are gating -# with python 3 [testenv:functional-py36] -basepython = python3.6 -setenv = {[testenv]setenv} +description = + Run functional tests using python3.6. deps = {[testenv:functional]deps} commands = {[testenv:functional]commands} [testenv:functional-py37] -basepython = python3.7 -setenv = {[testenv]setenv} +description = + Run functional tests using python3.7. deps = {[testenv:functional]deps} commands = {[testenv:functional]commands}