Drop python 2.7 support and testing

OpenStack is dropping the py2.7 support in ussuri cycle.

Ironic 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://review.opendev.org/#/c/691178/

Change-Id: I3cc36d79ffabf31607d503dada9e7512c639647c
This commit is contained in:
Iury Gregory Melo Ferreira 2019-11-20 15:52:10 +01:00
parent 516f04caf7
commit b869b46c63
8 changed files with 10 additions and 59 deletions

View File

@ -793,10 +793,7 @@ function install_virtualbmc {
git_clone_by_name "virtualbmc" git_clone_by_name "virtualbmc"
setup_dev_lib "virtualbmc" setup_dev_lib "virtualbmc"
else else
# pyghmi is still not compatible with python3 pip_install_gr "virtualbmc"
# hence we need to install virtualbmc in python2
# environment else IPMI calls will fail at the gate.
USE_PYTHON3=False pip_install_gr "virtualbmc"
fi fi
local cmd local cmd

View File

@ -2,7 +2,6 @@ mock>=3.0.0 # BSD
openstackdocstheme>=1.20.0 # Apache-2.0 openstackdocstheme>=1.20.0 # Apache-2.0
os-api-ref>=1.4.0 # Apache-2.0 os-api-ref>=1.4.0 # Apache-2.0
reno>=2.5.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD
sphinxcontrib-apidoc>=0.2.0 # BSD sphinxcontrib-apidoc>=0.2.0 # BSD
sphinxcontrib-pecanwsme>=0.10.0 # Apache-2.0 sphinxcontrib-pecanwsme>=0.10.0 # Apache-2.0

View File

@ -15,18 +15,12 @@ The description of each jobs that runs in the CI when you submit a patch for
* - Job name * - Job name
- Description - Description
* - ironic-tox-unit-with-driver-libs
- Runs Ironic unit tests with the driver dependencies installed under
Python2
* - ironic-tox-unit-with-driver-libs-python3 * - ironic-tox-unit-with-driver-libs-python3
- Runs Ironic unit tests with the driver dependencies installed under - Runs Ironic unit tests with the driver dependencies installed under
Python3 Python3
* - ironic-standalone * - ironic-standalone
- Deploys Ironic in standalone mode and runs tempest tests that match - Deploys Ironic in standalone mode and runs tempest tests that match
the regex `ironic_standalone`. the regex `ironic_standalone`.
* - ironic-tempest-functional-python2
- Deploys Ironic in standalone mode and runs tempest functional tests
that matches the regex `ironic_tempest_plugin.tests.api` under Python2
* - ironic-tempest-functional-python3 * - ironic-tempest-functional-python3
- Deploys Ironic in standalone mode and runs tempest functional tests - Deploys Ironic in standalone mode and runs tempest functional tests
that matches the regex `ironic_tempest_plugin.tests.api` under Python3 that matches the regex `ironic_tempest_plugin.tests.api` under Python3

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
Python 2.7 support has been dropped. Last release of Ironic
to support Python 2.7 is OpenStack Train. The minimum version of Python now
supported by Ironic 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

22
tox.ini
View File

@ -1,11 +1,12 @@
[tox] [tox]
minversion = 2.0 minversion = 2.0
skipsdist = True skipsdist = True
envlist = py3,py27,pep8 envlist = py3,pep8
[testenv] [testenv]
usedevelop = True usedevelop = True
install_command = pip install -U {opts} {packages} install_command = pip install -U {opts} {packages}
basepython = python3
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
PYTHONDONTWRITEBYTECODE = 1 PYTHONDONTWRITEBYTECODE = 1
LANGUAGE=en_US LANGUAGE=en_US
@ -20,24 +21,16 @@ commands =
stestr run {posargs} stestr run {posargs}
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:unit-with-driver-libs]
basepython = python2
deps = {[testenv]deps}
-r{toxinidir}/driver-requirements.txt
[testenv:unit-with-driver-libs-python3] [testenv:unit-with-driver-libs-python3]
basepython = python3
deps = {[testenv]deps} deps = {[testenv]deps}
-r{toxinidir}/driver-requirements.txt -r{toxinidir}/driver-requirements.txt
[testenv:genstates] [testenv:genstates]
basepython = python3
deps = {[testenv]deps} deps = {[testenv]deps}
pydot2 pydot2
commands = {toxinidir}/tools/states_to_dot.py -f {toxinidir}/doc/source/images/states.svg --format svg commands = {toxinidir}/tools/states_to_dot.py -f {toxinidir}/doc/source/images/states.svg --format svg
[testenv:pep8] [testenv:pep8]
basepython = python3
whitelist_externals = bash whitelist_externals = bash
commands = commands =
bash tools/flake8wrap.sh {posargs} bash tools/flake8wrap.sh {posargs}
@ -50,7 +43,6 @@ commands =
{toxinidir}/tools/check-releasenotes.py {toxinidir}/tools/check-releasenotes.py
[testenv:cover] [testenv:cover]
basepython = python3
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
LANGUAGE=en_US LANGUAGE=en_US
PYTHON=coverage run --source ironic --omit='*tests*' --parallel-mode PYTHON=coverage run --source ironic --omit='*tests*' --parallel-mode
@ -62,25 +54,21 @@ commands =
coverage html -d ./cover --omit='*tests*' coverage html -d ./cover --omit='*tests*'
[testenv:genconfig] [testenv:genconfig]
basepython = python3
sitepackages = False sitepackages = False
envdir = {toxworkdir}/venv envdir = {toxworkdir}/venv
commands = commands =
oslo-config-generator --config-file=tools/config/ironic-config-generator.conf oslo-config-generator --config-file=tools/config/ironic-config-generator.conf
[testenv:genpolicy] [testenv:genpolicy]
basepython = python3
sitepackages = False sitepackages = False
envdir = {toxworkdir}/venv envdir = {toxworkdir}/venv
commands = commands =
oslopolicy-sample-generator --config-file=tools/policy/ironic-policy-generator.conf oslopolicy-sample-generator --config-file=tools/policy/ironic-policy-generator.conf
[testenv:debug] [testenv:debug]
basepython = python3
commands = oslo_debug_helper -t ironic/tests/unit {posargs} commands = oslo_debug_helper -t ironic/tests/unit {posargs}
[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}/requirements.txt -r{toxinidir}/requirements.txt
@ -89,7 +77,6 @@ deps =
commands = sphinx-build -b html -W doc/source doc/build/html commands = sphinx-build -b html -W doc/source doc/build/html
[testenv:pdf-docs] [testenv:pdf-docs]
basepython = python3
whitelist_externals = make whitelist_externals = make
deps = {[testenv:docs]deps} deps = {[testenv:docs]deps}
commands = commands =
@ -98,7 +85,6 @@ commands =
[testenv:api-ref] [testenv:api-ref]
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
@ -109,7 +95,6 @@ commands =
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:releasenotes] [testenv:releasenotes]
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
@ -118,7 +103,6 @@ commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:venv] [testenv:venv]
basepython = python3
setenv = PYTHONHASHSEED=0 setenv = PYTHONHASHSEED=0
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}
@ -150,14 +134,12 @@ local-check-factory = ironic.hacking.checks.factory
import_exceptions = testtools.matchers, ironic.common.i18n import_exceptions = testtools.matchers, ironic.common.i18n
[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
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
[testenv:bandit] [testenv:bandit]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r ironic -x tests -n5 -ll -c tools/bandit.yml commands = bandit -r ironic -x tests -n5 -ll -c tools/bandit.yml

View File

@ -53,7 +53,6 @@
Q_AGENT: openvswitch Q_AGENT: openvswitch
Q_ML2_TENANT_NETWORK_TYPE: vxlan Q_ML2_TENANT_NETWORK_TYPE: vxlan
USE_PYTHON3: True
devstack_plugins: devstack_plugins:
ironic: https://opendev.org/openstack/ironic ironic: https://opendev.org/openstack/ironic
zuul_copy_output: zuul_copy_output:
@ -318,18 +317,10 @@
neutron-metadata-agent: False neutron-metadata-agent: False
neutron-metering: False neutron-metering: False
- job:
name: ironic-tempest-functional-python2
description: ironic-tempest-functional-python2
parent: ironic-tempest-functional-python3
vars:
devstack_localrc:
USE_PYTHON3: False
- job: - job:
name: ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode name: ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode
description: ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode description: ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode
parent: tempest-multinode-full parent: tempest-multinode-full-py3
pre-run: playbooks/ci-workarounds/pre.yaml pre-run: playbooks/ci-workarounds/pre.yaml
timeout: 10800 timeout: 10800
required-projects: required-projects:
@ -408,7 +399,6 @@
# ephemeral partition on such nodes # ephemeral partition on such nodes
LIBVIRT_STORAGE_POOL_PATH: /opt/libvirt/images LIBVIRT_STORAGE_POOL_PATH: /opt/libvirt/images
USE_PYTHON3: True
devstack_plugins: devstack_plugins:
ironic: https://opendev.org/openstack/ironic ironic: https://opendev.org/openstack/ironic
networking-generic-switch: https://opendev.org/openstack/networking-generic-switch networking-generic-switch: https://opendev.org/openstack/networking-generic-switch
@ -474,7 +464,6 @@
Q_ML2_TENANT_NETWORK_TYPE: vlan Q_ML2_TENANT_NETWORK_TYPE: vlan
VIRT_DRIVER: ironic VIRT_DRIVER: ironic
PUBLIC_BRIDGE: br-infra PUBLIC_BRIDGE: br-infra
USE_PYTHON3: True
devstack_services: devstack_services:
c-api: False c-api: False
c-bak: False c-bak: False
@ -485,14 +474,6 @@
q-agt: True q-agt: True
n-cpu: True n-cpu: True
- job:
name: ironic-tox-unit-with-driver-libs
parent: tox
description: |
Run unit tests with driver dependencies installed.
vars:
tox_envlist: unit-with-driver-libs
- job: - job:
name: ironic-tox-unit-with-driver-libs-python3 name: ironic-tox-unit-with-driver-libs-python3
parent: tox parent: tox
@ -518,7 +499,6 @@
parent: ironic-base parent: ironic-base
vars: vars:
devstack_localrc: devstack_localrc:
USE_PYTHON3: True
IRONIC_ENABLED_HARDWARE_TYPES: ipmi IRONIC_ENABLED_HARDWARE_TYPES: ipmi
IRONIC_ENABLED_BOOT_INTERFACES: pxe IRONIC_ENABLED_BOOT_INTERFACES: pxe
IRONIC_VM_SPECS_RAM: 512 IRONIC_VM_SPECS_RAM: 512

View File

@ -3,17 +3,14 @@
- check-requirements - check-requirements
- openstack-cover-jobs - openstack-cover-jobs
- openstack-lower-constraints-jobs - openstack-lower-constraints-jobs
- openstack-python-jobs
- openstack-python3-ussuri-jobs - openstack-python3-ussuri-jobs
- periodic-stable-jobs - periodic-stable-jobs
- publish-openstack-docs-pti - publish-openstack-docs-pti
- release-notes-jobs-python3 - release-notes-jobs-python3
check: check:
jobs: jobs:
- ironic-tox-unit-with-driver-libs
- ironic-tox-unit-with-driver-libs-python3 - ironic-tox-unit-with-driver-libs-python3
- ironic-standalone - ironic-standalone
- ironic-tempest-functional-python2
- ironic-tempest-functional-python3 - ironic-tempest-functional-python3
- ironic-grenade-dsvm - ironic-grenade-dsvm
# Temporary disable voting because of end of cycle CI instability. # Temporary disable voting because of end of cycle CI instability.
@ -47,10 +44,8 @@
gate: gate:
queue: ironic queue: ironic
jobs: jobs:
- ironic-tox-unit-with-driver-libs
- ironic-tox-unit-with-driver-libs-python3 - ironic-tox-unit-with-driver-libs-python3
- ironic-standalone - ironic-standalone
- ironic-tempest-functional-python2
- ironic-tempest-functional-python3 - ironic-tempest-functional-python3
- ironic-grenade-dsvm - ironic-grenade-dsvm
# removing from voting due to end of cycle gate instability. # removing from voting due to end of cycle gate instability.