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

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

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

Cleanup tox.ini, remove install_command and add constraints to deps.
Replace mock with unittest.mock.

Change-Id: Idcac0b5310adf27a35223273bd54a4a154988c9b
This commit is contained in:
Andreas Jaeger 2020-02-04 18:55:16 +01:00
parent 128f0119ea
commit dd7efc353e
12 changed files with 19 additions and 36 deletions

View File

@ -1,6 +1,5 @@
- project: - project:
templates: templates:
- openstack-python-jobs
- openstack-python3-ussuri-jobs - openstack-python3-ussuri-jobs
- check-requirements - check-requirements
- publish-openstack-docs-pti - publish-openstack-docs-pti

View File

@ -3,7 +3,6 @@
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
openstackdocstheme>=1.18.1 # Apache-2.0 openstackdocstheme>=1.18.1 # 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,>=1.6.2 # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD
reno>=2.5.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0
sphinxcontrib-httpdomain>=1.3.0 # BSD sphinxcontrib-httpdomain>=1.3.0 # BSD

View File

@ -26,7 +26,6 @@ keystoneauth1==3.4.0
linecache2==1.0.0 linecache2==1.0.0
MarkupSafe==1.0 MarkupSafe==1.0
mccabe==0.2.1 mccabe==0.2.1
mock==2.0.0
monotonic==0.6 monotonic==0.6
msgpack-python==0.4.0 msgpack-python==0.4.0
munch==2.1.0 munch==2.1.0

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
Python 2.7 support has been dropped. The minimum version of Python now
supported by heat-agents is Python 3.6.

View File

@ -6,6 +6,7 @@ description-file =
author = OpenStack author = OpenStack
author-email = openstack-discuss@lists.openstack.org author-email = openstack-discuss@lists.openstack.org
home-page = https://docs.openstack.org/heat/latest/ home-page = https://docs.openstack.org/heat/latest/
python-requires = >=3.6
classifier = classifier =
Environment :: OpenStack Environment :: OpenStack
Intended Audience :: Information Technology Intended Audience :: Information Technology
@ -13,16 +14,8 @@ 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
Programming Language :: Python :: 3 :: Only
[build_sphinx] Programming Language :: Python :: Implementation :: CPython
source-dir = doc/source
build-dir = doc/build
all_files = 1
[upload_sphinx]
upload-dir = doc/build/html

View File

@ -16,14 +16,6 @@
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT # THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools import setuptools
# In python < 2.7.4, a lazy loading of package `pbr` will break
# setuptools if some other modules registered functions in `atexit`.
# solution from: http://bugs.python.org/issue15881#msg170215
try:
import multiprocessing # noqa
except ImportError:
pass
setuptools.setup( setuptools.setup(
setup_requires=['pbr>=2.0.0'], setup_requires=['pbr>=2.0.0'],
pbr=True) pbr=True)

View File

@ -5,7 +5,6 @@ coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD
# Hacking already pins down pep8, pyflakes and flake8 # Hacking already pins down pep8, pyflakes and flake8
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
mock>=2.0.0 # BSD
paunch>=4.0.0 # Apache-2.0 paunch>=4.0.0 # Apache-2.0
requests>=2.14.2 # Apache-2.0 requests>=2.14.2 # Apache-2.0
requests-mock>=1.1.0 # Apache-2.0 requests-mock>=1.1.0 # Apache-2.0

View File

@ -16,8 +16,8 @@ import json
import tempfile import tempfile
import fixtures import fixtures
import mock
import six import six
from unittest import mock
from tests import common from tests import common
from tests import heat_config_notify as hcn from tests import heat_config_notify as hcn

View File

@ -15,9 +15,9 @@ import copy
import imp import imp
import json import json
import logging import logging
import mock
import six import six
import sys import sys
from unittest import mock
from tests import common from tests import common

View File

@ -13,8 +13,8 @@
import json import json
import mock
from six.moves import cStringIO as StringIO from six.moves import cStringIO as StringIO
from unittest import mock
from tests import common from tests import common
from tests import hook_docker_cmd from tests import hook_docker_cmd

View File

@ -12,9 +12,9 @@
# under the License. # under the License.
import mock
import re import re
import testtools import testtools
from unittest import mock
from tests import hook_kubelet from tests import hook_kubelet

15
tox.ini
View File

@ -1,28 +1,27 @@
[tox] [tox]
envlist = py27,py37,pep8 envlist = py37,pep8
minversion = 1.6 ignore_basepython_conflict = true
minversion = 3.1.0
skipsdist = True skipsdist = True
[testenv] [testenv]
basepython = python3
whitelist_externals = bash whitelist_externals = bash
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages} deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
deps = -r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
commands = bash -c 'if [ ! -d ./.testrepository ] ; then testr init ; fi' commands = bash -c 'if [ ! -d ./.testrepository ] ; then testr init ; fi'
testr run {posargs} testr run {posargs}
[testenv:pep8] [testenv:pep8]
basepython = python3
commands = flake8 commands = flake8
[testenv:docs] [testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[flake8] [flake8]
@ -31,12 +30,10 @@ builtins = _
exclude=.venv,.git,.tox,*lib/python*,private,.eggs exclude=.venv,.git,.tox,*lib/python*,private,.eggs
[testenv:releasenotes] [testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[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