Browse Source

Drop python2 tests

OpenStack is dropping the py2.7 support in ussuri cycle.
magnum is ready with python 3 and ok to drop the
python 2.7 support.

https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html#completion-criteria

Depends-On: https://review.opendev.org/693631

Change-Id: I2ce19b3f976619853117231ae0dae24ebe68601f
Signed-off-by: Diogo Guerra <diogo.filipe.tomas.guerra@cern.ch>
changes/21/691721/5
Diogo Guerra 1 month ago
parent
commit
3d17c6eb49
6 changed files with 14 additions and 74 deletions
  1. +1
    -48
      .zuul.yaml
  2. +1
    -1
      doc/source/contributor/objects.rst
  3. +4
    -4
      doc/source/contributor/quickstart.rst
  4. +6
    -0
      releasenotes/notes/drop-py27-support-7e2c4300341f9719.yaml
  5. +0
    -2
      setup.cfg
  6. +2
    -19
      tox.ini

+ 1
- 48
.zuul.yaml View File

@@ -62,44 +62,6 @@
branch_override: default
devstack_python3: 1

- job:
name: magnum-functional-base-python2
parent: legacy-dsvm-base
timeout: 7800
pre-run: playbooks/pre/prepare-workspace.yaml
run: playbooks/magnum-functional-base.yaml
post-run: playbooks/post/upload-logs.yaml
required-projects:
- openstack/devstack-gate
- openstack/diskimage-builder
- openstack/ironic
- openstack/ironic-lib
- openstack/ironic-python-agent
- openstack/magnum
- openstack/magnum-tempest-plugin
- x/pyghmi
- openstack/python-ironicclient
- openstack/python-magnumclient
- openstack/virtualbmc
irrelevant-files:
- ^.*\.rst$
- ^api-ref/.*$
- ^doc/.*$
- ^specs/.*$
- ^install-guide/.*$
- ^releasenotes/.*$
- ^dockerfiles/.*$
vars:
ironic: 0
ceilometer: 0
swift: 0
horizon: 0
multinode: 0
neutron: 1
tempest: 0
branch_override: default
devstack_python3: 0

- job:
name: magnum-functional-multinode-base
parent: legacy-dsvm-base-multinode
@@ -143,12 +105,6 @@
vars:
coe: api

- job:
name: magnum-functional-api-python2
parent: magnum-functional-base-python2
vars:
coe: api

- job:
name: magnum-functional-coe
parent: magnum-functional-base
@@ -368,15 +324,13 @@
templates:
- openstack-cover-jobs
- openstack-lower-constraints-jobs
- openstack-python-jobs
- openstack-python3-train-jobs
- openstack-python3-ussuri-jobs
- check-requirements
- publish-openstack-docs-pti
- release-notes-jobs-python3
check:
jobs:
- magnum-functional-api
- magnum-functional-api-python2
- openstack-tox-cover:
voting: false
- magnum-container-build
@@ -384,7 +338,6 @@
queue: magnum
jobs:
- magnum-functional-api
- magnum-functional-api-python2
experimental:
jobs:
- magnum-functional-dcos

+ 1
- 1
doc/source/contributor/objects.rst View File

@@ -49,7 +49,7 @@ Object Change Example
The following example shows the unit test workflow when changing an object
(Cluster was updated to hold a new 'foo' field)::

tox -e py27 magnum.tests.unit.objects.test_objects
tox -e py37 magnum.tests.unit.objects.test_objects

This results in a unit test failure with the following output:


+ 4
- 4
doc/source/contributor/quickstart.rst View File

@@ -67,13 +67,13 @@ All unit tests should be run using tox. To run magnum's entire test suite::

To run a specific test, use a positional argument for the unit tests::

# run a specific test for Python 2.7
tox -epy27 -- test_conductor
# run a specific test for Python 3.7
tox -epy37 -- test_conductor

You may pass options to the test programs using positional arguments::

# run all the Python 2.7 unit tests (in parallel!)
tox -epy27 -- --parallel
# run all the Python 3.7 unit tests (in parallel!)
tox -epy37 -- --parallel

To run only the pep8/flake8 syntax and style checks::


+ 6
- 0
releasenotes/notes/drop-py27-support-7e2c4300341f9719.yaml View File

@@ -0,0 +1,6 @@
---
upgrade:
- |
Python 2.7 support has been dropped. Last release magnum support py2.7
is OpenStack Train. The minimum version of Python now supported by magnum
is Python 3.6.

+ 0
- 2
setup.cfg View File

@@ -13,8 +13,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

+ 2
- 19
tox.ini View File

@@ -1,9 +1,10 @@
[tox]
minversion = 2.0
envlist = py27,py37,pep8
envlist = py37,pep8
skipsdist = True

[testenv]
basepython = python3
usedevelop = True
install_command =
pip install -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} {opts} {packages}
@@ -24,11 +25,6 @@ commands =
stestr run {posargs}

[testenv:debug]
basepython = python3
commands = oslo_debug_helper -t magnum/tests/unit {posargs}

[testenv:debug-py27]
basepython = python2.7
commands = oslo_debug_helper -t magnum/tests/unit {posargs}

[testenv:functional-api]
@@ -109,7 +105,6 @@ commands =
stestr run {posargs}

[testenv:pep8]
basepython = python3
commands =
doc8 -e .rst specs/ doc/source/ contrib/ CONTRIBUTING.rst HACKING.rst README.rst
bash tools/flake8wrap.sh {posargs}
@@ -123,30 +118,24 @@ commands =
-print0 | xargs -0 bashate -v -iE006,E010,E042 -eE005"

[testenv:venv]
basepython = python3
commands = {posargs}

[testenv:bandit]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r magnum -x tests -n5 -ll

[testenv:cover]
basepython = python3
commands = {toxinidir}/tools/cover.sh {posargs}

[testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html

[testenv:genconfig]
basepython = python3
commands =
oslo-config-generator --config-file etc/magnum/magnum-config-generator.conf

[testenv:genpolicy]
basepython = python3
commands =
oslopolicy-sample-generator --config-file etc/magnum/magnum-policy-generator.conf

@@ -162,7 +151,6 @@ exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,tools,releasenotes
local-check-factory = magnum.hacking.checks.factory

[testenv:pip-check-reqs]
basepython = python3
# do not install test-requirements as that will pollute the virtualenv for
# determining missing packages
# this also means that pip_check_reqs must be installed separately, outside
@@ -172,25 +160,21 @@ deps = pip_check_reqs
commands=pip-missing-reqs -d --ignore-file=magnum/tests/* magnum

[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:install-guide]
basepython = python3
commands = sphinx-build -a -E -W -d install-guide/build/doctrees -b html install-guide/source install-guide/build/html

[testenv:api-ref]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html

[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
@@ -199,7 +183,6 @@ deps =
# This environment can be used to quickly validate that all needed system
# packages required to successfully execute test targets are installed
[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

Loading…
Cancel
Save