From 719d6046673d5ec2dc048f1add46d19b3d426002 Mon Sep 17 00:00:00 2001
From: Ghanshyam Mann <gmann@ghanshyammann.com>
Date: Sun, 15 Dec 2019 01:13:27 +0000
Subject: [PATCH] [ussuri][goal] Drop python 2.7 support and testing

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

python-masakariclient 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

Change-Id: I299939dd0a1a0d0726574d6f32186d4ca818437d
---
 .zuul.yaml                                    |  3 +--
 doc/source/contributor/developing.rst         |  2 +-
 .../notes/drop-py-2-7-d3c0f239678a4c83.yaml   |  6 ++++++
 setup.cfg                                     |  2 --
 test-requirements.txt                         |  3 +--
 tox.ini                                       | 20 +++++--------------
 6 files changed, 14 insertions(+), 22 deletions(-)
 create mode 100644 releasenotes/notes/drop-py-2-7-d3c0f239678a4c83.yaml

diff --git a/.zuul.yaml b/.zuul.yaml
index cd91aa3..4972707 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -2,7 +2,6 @@
     templates:
       - check-requirements
       - openstack-lower-constraints-jobs
-      - openstack-python-jobs
-      - openstack-python3-train-jobs
+      - openstack-python3-ussuri-jobs
       - publish-openstack-docs-pti
       - release-notes-jobs-python3
diff --git a/doc/source/contributor/developing.rst b/doc/source/contributor/developing.rst
index 4236af2..00d672f 100644
--- a/doc/source/contributor/developing.rst
+++ b/doc/source/contributor/developing.rst
@@ -70,7 +70,7 @@ list the environments with the ``-e`` option, separated by spaces:
 
 .. code-block:: bash
 
-    $ tox -e py27,py36,py37,pep8
+    $ tox -e py36,py37,pep8
 
 See ``tox.ini`` for the full list of available test environments.
 
diff --git a/releasenotes/notes/drop-py-2-7-d3c0f239678a4c83.yaml b/releasenotes/notes/drop-py-2-7-d3c0f239678a4c83.yaml
new file mode 100644
index 0000000..49301c0
--- /dev/null
+++ b/releasenotes/notes/drop-py-2-7-d3c0f239678a4c83.yaml
@@ -0,0 +1,6 @@
+---
+upgrade:
+  - |
+    Python 2.7 support has been dropped. Last release of python-masakariclient
+    to support python 2.7 is OpenStack Train. The minimum version of Python now
+    supported is Python 3.6.
diff --git a/setup.cfg b/setup.cfg
index 4853f6c..3936bc3 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -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
diff --git a/test-requirements.txt b/test-requirements.txt
index 93538cf..66d6a9e 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -10,8 +10,7 @@ python-subunit>=1.0.0 # Apache-2.0/BSD
 openstackdocstheme>=1.18.1 # Apache-2.0
 oslotest>=3.2.0 # Apache-2.0
 requests-mock>=1.2.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,>=1.6.2;python_version>='3.4' # BSD
+sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
 stestr>=1.0.0 # Apache-2.0
 testscenarios>=0.4 # Apache-2.0/BSD
 testtools>=2.2.0 # MIT
diff --git a/tox.ini b/tox.ini
index 1703f9d..7091a8e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,9 +1,11 @@
 [tox]
-minversion = 2.0
-envlist = pep8,py27,py36,py37
+minversion = 3.1.1
+envlist = pep8,py36,py37
 skipsdist = True
+ignore_basepython_conflict = True
 
 [testenv]
+basepython = python3
 usedevelop = True
 install_command = pip install {opts} {packages}
 deps =
@@ -16,16 +18,11 @@ whitelist_externals = bash
 # By default stestr will set concurrency
 # to ncpu, to specify something else use
 # the concurrency=<n> option.
-# call ie: 'tox -epy27 -- --concurrency=4'
+# call ie: 'tox -epy37 -- --concurrency=4'
 commands =
   find . -type f -name "*.pyc" -delete
 passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY OS_DEBUG GENERATE_HASHES
 
-[testenv:py27]
-commands =
-    {[testenv]commands}
-    stestr run {posargs}
-
 [testenv:py36]
 basepython = python3.6
 commands =
@@ -39,15 +36,12 @@ commands =
     stestr run {posargs}
 
 [testenv:pep8]
-basepython = python3
 commands = flake8 {posargs}
 
 [testenv:venv]
-basepython = python3
 commands = {posargs}
 
 [testenv:cover]
-basepython = python3
 setenv =
     PYTHON=coverage run --source masakariclient --parallel-mode
 commands =
@@ -57,17 +51,14 @@ commands =
     coverage xml -o cover/coverage.xml
 
 [testenv:docs]
-basepython = python3
 commands =
   sphinx-build -W -b html doc/source doc/build/html
 
 [testenv:releasenotes]
-basepython = python3
 commands =
   sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
 
 [testenv:debug]
-basepython = python3
 commands = oslo_debug_helper {posargs}
 
 [flake8]
@@ -79,7 +70,6 @@ builtins = _
 exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
 
 [testenv:lower-constraints]
-basepython = python3
 deps =
   -c{toxinidir}/lower-constraints.txt
   -r{toxinidir}/test-requirements.txt