[ussuri][goal] Drop python 2.7 support and testing

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

sahara 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

Other required Sahara changes:
- port the image building job to CentOS 8, and thus Python 3.

Depends-On: https://review.opendev.org/#/c/693631/
Depends-On: https://review.opendev.org/#/c/694699/
Change-Id: I30485a9933d38db76c031c6e760598c4e47123fc
This commit is contained in:
Ghanshyam Mann 2020-01-14 18:38:26 +01:00 committed by Luigi Toscano
parent d4bdcecc07
commit 17c3249a27
5 changed files with 15 additions and 23 deletions

View File

@ -1,7 +1,6 @@
- project: - project:
templates: templates:
- 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
@ -90,10 +89,12 @@
- openstack/openstack-ansible-os_sahara - openstack/openstack-ansible-os_sahara
vars: vars:
osa_test_repo: openstack/openstack-ansible-os_sahara osa_test_repo: openstack/openstack-ansible-os_sahara
devstack_localrc:
USE_PYTHON3: True
- job: - job:
name: sahara-buildimages-base name: sahara-buildimages-base
nodeset: centos-7 nodeset: centos-8
vars: vars:
sahara_src_dir: src/opendev.org/openstack/sahara sahara_src_dir: src/opendev.org/openstack/sahara
run: playbooks/buildimages/run.yaml run: playbooks/buildimages/run.yaml

View File

@ -25,6 +25,6 @@ postgresql-devel [platform:rpm]
# command. # command.
python-guestfs [platform:dpkg] python-guestfs [platform:dpkg]
libguestfs-xfs [platform:dpkg] libguestfs-xfs [platform:dpkg]
python-libguestfs [platform:rpm] python3-libguestfs [platform:rpm]
libguestfs-xfs [platform:redhat] libguestfs-xfs [platform:redhat]
xfsprogs [platform:suse] xfsprogs [platform:suse]

View File

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

View File

@ -5,8 +5,6 @@ description-file = README.rst
license = Apache Software License license = Apache Software License
classifiers = classifiers =
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

23
tox.ini
View File

@ -1,9 +1,13 @@
[tox] [tox]
envlist = py27,py37,pep8,genpolicy envlist = py37,pep8,genpolicy
minversion = 1.6 minversion = 1.6
skipsdist = True skipsdist = 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] [testenv]
basepython = python3
usedevelop = True usedevelop = True
install_command = pip install {opts} {packages} install_command = pip install {opts} {packages}
setenv = setenv =
@ -17,15 +21,10 @@ commands = 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:cover] [testenv:cover]
basepython = python3
setenv = setenv =
PACKAGE_NAME=sahara PACKAGE_NAME=sahara
commands = {toxinidir}/tools/cover.sh {posargs} commands = {toxinidir}/tools/cover.sh {posargs}
[testenv:debug-py27]
basepython = python2.7
commands = oslo_debug_helper -t sahara/tests/unit {posargs}
[testenv:debug-py36] [testenv:debug-py36]
basepython = python3.6 basepython = python3.6
commands = oslo_debug_helper -t sahara/tests/unit {posargs} commands = oslo_debug_helper -t sahara/tests/unit {posargs}
@ -35,7 +34,6 @@ basepython = python3.7
commands = oslo_debug_helper -t sahara/tests/unit {posargs} commands = oslo_debug_helper -t sahara/tests/unit {posargs}
[testenv:pep8] [testenv:pep8]
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
@ -50,11 +48,9 @@ commands =
bandit -c bandit.yaml -r sahara -n5 -p sahara_default -x tests bandit -c bandit.yaml -r sahara -n5 -p sahara_default -x tests
[testenv:genpolicy] [testenv:genpolicy]
basepython = python3
commands = oslopolicy-sample-generator --config-file tools/config/sahara-policy-generator.conf commands = oslopolicy-sample-generator --config-file tools/config/sahara-policy-generator.conf
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[testenv:images] [testenv:images]
@ -62,7 +58,6 @@ sitepackages = True
commands = {posargs} commands = {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}/doc/requirements.txt -r{toxinidir}/doc/requirements.txt
@ -76,7 +71,6 @@ commands =
whitelist_externals = rm whitelist_externals = rm
[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}/doc/requirements.txt -r{toxinidir}/doc/requirements.txt
@ -88,18 +82,15 @@ whitelist_externals = rm
[testenv:pylint] [testenv:pylint]
basepython = python3
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
commands = bash tools/lintstack.sh commands = bash tools/lintstack.sh
[testenv:genconfig] [testenv:genconfig]
basepython = python3
commands = commands =
oslo-config-generator --config-file tools/config/config-generator.sahara.conf \ oslo-config-generator --config-file tools/config/config-generator.sahara.conf \
--output-file etc/sahara/sahara.conf.sample --output-file etc/sahara/sahara.conf.sample
[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}/doc/requirements.txt -r{toxinidir}/doc/requirements.txt
@ -109,7 +100,6 @@ commands =
whitelist_externals = rm whitelist_externals = rm
[testenv:debug] [testenv:debug]
basepython = python3
# It runs tests from the specified dir (default is sahara/tests) # It runs tests from the specified dir (default is sahara/tests)
# in interactive mode, so, you could use pbr for tests debug. # in interactive mode, so, you could use pbr for tests debug.
# Example usage: tox -e debug -- -t sahara/tests/unit some.test.path # Example usage: tox -e debug -- -t sahara/tests/unit some.test.path
@ -117,7 +107,6 @@ basepython = python3
commands = oslo_debug_helper -t sahara/tests/unit {posargs} commands = oslo_debug_helper -t sahara/tests/unit {posargs}
[testenv:bandit] [testenv:bandit]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
commands = bandit -c bandit.yaml -r sahara -n5 -p sahara_default -x tests commands = bandit -c bandit.yaml -r sahara -n5 -p sahara_default -x tests
@ -145,7 +134,6 @@ import_exceptions = sahara.i18n
local-check-factory = sahara.utils.hacking.checks.factory local-check-factory = sahara.utils.hacking.checks.factory
[testenv:bindep] [testenv:bindep]
basepython = python3
# Do not install any requirements. We want this to be fast and work even if # 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 # system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed # dependencies are missing! This also means that bindep must be installed
@ -154,7 +142,6 @@ deps = bindep
commands = bindep test commands = bindep test
[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