Cleanup py27 support

This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove py2 stanza from setup.py
- Remove obsolete sections from setup.cfg
- Update classifiers
- Switch to using sphinx-build
- Remove install_command from tox.ini, the default is fine
- Remove Babel from requirements, it's not needed for running.
- Remove obsolete babel.cfg
- Use TOX_CONSTRAINTS_FILE instead of obsolete UPPER_CONSTRAINTS_FILE.
- Update hacking to current 3.1.0 version
- Remove use of six library

Change-Id: I233dfc7a06cbd2e098499629f63d0b8f2db5258e
This commit is contained in:
Andreas Jaeger 2020-06-09 13:41:47 +02:00
parent 820a42650d
commit 4195ae11b2
13 changed files with 28 additions and 59 deletions

View File

@ -1,2 +0,0 @@
[python: **.py]

View File

@ -4,7 +4,6 @@
pbr>=2.0 # Apache-2.0
oslo.config!=4.3.0,!=4.4.0,>=4.0.0 # Apache-2.0
six>=1.9.0 # MIT
oslo.serialization!=2.19.1,>=1.10.0 # Apache-2.0
oslo.utils>=3.20.0 # Apache-2.0
testtools>=1.4.0 # MIT

View File

@ -13,37 +13,17 @@ classifier =
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
[files]
packages =
zaqar_tempest_plugin
[build_sphinx]
all-files = 1
warning-is-error = 1
source-dir = doc/source
build-dir = doc/build
[upload_sphinx]
upload-dir = doc/build/html
[compile_catalog]
directory = zaqar_tempest_plugin/locale
domain = zaqar_tempest_plugin
[update_catalog]
domain = zaqar_tempest_plugin
output_dir = zaqar_tempest_plugin/locale
input_file = zaqar_tempest_plugin/locale/zaqar_tempest_plugin.pot
[extract_messages]
keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg
output_file = zaqar_tempest_plugin/locale/zaqar_tempest_plugin.pot
[entry_points]
tempest.test_plugins =
zaqar_tests = zaqar_tempest_plugin.plugin:ZaqarTempestPlugin

View File

@ -13,17 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
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(
setup_requires=['pbr'],
pbr=True)

View File

@ -2,7 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking>=0.12.0,<0.13 # Apache-2.0
hacking>=3.1.0,<3.2.0 # Apache-2.0
coverage>=4.0,!=4.4 # Apache-2.0
python-subunit>=0.0.18 # Apache-2.0/BSD

View File

@ -7,12 +7,13 @@ ignore_basepython_conflict = True
[testenv]
basepython = python3
usedevelop = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python setup.py test --slowest --testr-args='{posargs}'
[testenv:pep8]
@ -25,7 +26,7 @@ commands = {posargs}
commands = python setup.py test --coverage --testr-args='{posargs}'
[testenv:docs]
commands = python setup.py build_sphinx
commands = sphinx-build -a -W -b html doc/source doc/build/html
[testenv:releasenotes]
commands =

View File

@ -13,10 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import urllib
from oslo_utils import uuidutils
from oslo_serialization import jsonutils as json
from six.moves.urllib import parse as urllib
from tempest.lib.common import rest_client
from zaqar_tempest_plugin.api_schema.response.v1 \
@ -150,7 +151,7 @@ class V1MessagingClient(MessagingClient):
def post_claims(self, queue_name, rbody, url_params=False):
uri = '{0}/queues/{1}/claims'.format(self.uri_prefix, queue_name)
if url_params:
uri += '?%s' % urllib.urlencode(url_params)
uri += '?%s' % urllib.parse.urlencode(url_params)
resp, body = self.post(uri, body=json.dumps(rbody),
extra_headers=True,
@ -285,7 +286,7 @@ class V11MessagingClient(MessagingClient):
def post_claims(self, queue_name, rbody, url_params=False):
uri = '{0}/queues/{1}/claims'.format(self.uri_prefix, queue_name)
if url_params:
uri += '?%s' % urllib.urlencode(url_params)
uri += '?%s' % urllib.parse.urlencode(url_params)
resp, body = self.post(uri, body=json.dumps(rbody),
extra_headers=True,
@ -326,7 +327,7 @@ class V2MessagingClient(MessagingClient):
def list_queues(self, url_params=False):
uri = '{0}/queues'.format(self.uri_prefix)
if url_params:
uri += '?%s' % urllib.urlencode(url_params)
uri += '?%s' % urllib.parse.urlencode(url_params)
resp, body = self.get(uri, headers=self.headers)
if resp['status'] != '204':
@ -436,7 +437,7 @@ class V2MessagingClient(MessagingClient):
def post_claims(self, queue_name, rbody, url_params=False):
uri = '{0}/queues/{1}/claims'.format(self.uri_prefix, queue_name)
if url_params:
uri += '?%s' % urllib.urlencode(url_params)
uri += '?%s' % urllib.parse.urlencode(url_params)
resp, body = self.post(uri, body=json.dumps(rbody),
extra_headers=True,

View File

@ -13,7 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from six.moves.urllib import parse as urlparse
import urllib
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
@ -105,7 +106,7 @@ class TestClaims(base.BaseV1MessagingTest):
# Delete Claimed message
# This will implicitly verify that the claim is deleted.
message_uri = urlparse.urlparse(claim_uri).path
message_uri = urllib.parse.urlparse(claim_uri).path
self.client.delete_messages(message_uri)
@classmethod

View File

@ -13,7 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from six.moves.urllib import parse as urlparse
import urllib
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
@ -105,7 +106,7 @@ class TestClaims(base.BaseV11MessagingTest):
# Delete Claimed message
# This will implicitly verify that the claim is deleted.
message_uri = urlparse.urlparse(claim_uri).path
message_uri = urllib.parse.urlparse(claim_uri).path
self.client.delete_messages(message_uri)
@classmethod

View File

@ -14,8 +14,8 @@
# limitations under the License.
import time
import urllib
from six.moves.urllib import parse as urlparse
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
@ -107,7 +107,7 @@ class TestClaims(base.BaseV2MessagingTest):
# Delete Claimed message
# This will implicitly verify that the claim is deleted.
message_uri = urlparse.urlparse(claim_uri).path
message_uri = urllib.parse.urlparse(claim_uri).path
self.client.delete_messages(message_uri)
@decorators.idempotent_id('c1975970-66e7-11e7-a771-fa163e40e1ff')

View File

@ -16,7 +16,6 @@
import random
from oslo_utils import uuidutils
from six import moves
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
@ -33,7 +32,7 @@ class TestMessagesNegative(base.BaseV2MessagingTest):
def resource_setup(cls):
super(TestMessagesNegative, cls).resource_setup()
cls.queues = list()
for _ in moves.xrange(1):
for _ in range(1):
queue_name = data_utils.rand_name('Queues-Test')
cls.queues.append(queue_name)
# Create Queue

View File

@ -14,7 +14,6 @@
# limitations under the License.
from six import moves
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
@ -49,7 +48,7 @@ class TestManageQueue(base.BaseV2MessagingTest):
def resource_setup(cls):
super(TestManageQueue, cls).resource_setup()
cls.queues = list()
for _ in moves.xrange(5):
for _ in range(5):
queue_name = data_utils.rand_name('Queues-Test')
cls.queues.append(queue_name)
# Create Queue

View File

@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from six import moves
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
@ -27,7 +26,7 @@ class QueueNegativeTestJSON(base.BaseV2MessagingTest):
def resource_setup(cls):
super(QueueNegativeTestJSON, cls).resource_setup()
cls.queues = list()
for _ in moves.xrange(1):
for _ in range(1):
queue_name = data_utils.rand_name('Queues-Test')
cls.queues.append(queue_name)
cls.client.create_queue(queue_name)