From 61dc82cb54f393e3ea0084d9f6e71b6840718596 Mon Sep 17 00:00:00 2001 From: jacky06 Date: Sun, 10 May 2020 23:05:04 +0800 Subject: [PATCH] Remove six We don't need this in a Python 3-only world. Change-Id: Ibeb506281e88b44d454497d06f9187308859ac9c --- cloudkittyclient/common/base.py | 9 +++------ cloudkittyclient/v2/dataframes.py | 3 +-- lower-constraints.txt | 1 - requirements.txt | 1 - 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/cloudkittyclient/common/base.py b/cloudkittyclient/common/base.py index a622ab8..3811781 100644 --- a/cloudkittyclient/common/base.py +++ b/cloudkittyclient/common/base.py @@ -12,11 +12,9 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# -from string import Formatter as StringFormatter -from six import add_metaclass -from six.moves.urllib.parse import urlencode +from string import Formatter as StringFormatter +from urllib.parse import urlencode from cloudkittyclient import utils @@ -31,8 +29,7 @@ class HttpDecoratorMeta(type): ) -@add_metaclass(HttpDecoratorMeta) -class BaseManager(object): +class BaseManager(object, metaclass=HttpDecoratorMeta): """Base class for Endpoint Manager objects.""" url = '' diff --git a/cloudkittyclient/v2/dataframes.py b/cloudkittyclient/v2/dataframes.py index 00c56b1..a16fade 100644 --- a/cloudkittyclient/v2/dataframes.py +++ b/cloudkittyclient/v2/dataframes.py @@ -13,7 +13,6 @@ # under the License. # import json -import six from cloudkittyclient.common import base from cloudkittyclient import exc @@ -36,7 +35,7 @@ class DataframesManager(base.BaseManager): if not dataframes: raise exc.ArgumentRequired("'dataframes' argument is required") - if not isinstance(dataframes, six.string_types): + if not isinstance(dataframes, str): try: dataframes = json.dumps(dataframes) except TypeError: diff --git a/lower-constraints.txt b/lower-constraints.txt index d1064b8..4354e2e 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -6,7 +6,6 @@ oslo.utils==3.35 # Apache-2.0 oslo.log==3.36 # Apache-2.0 PyYAML==3.12 # MIT jsonpath-rw-ext==1.0 # Apache-2.0 -six==1.11 # MIT os-client-config==1.29.0 # Apache-2.0 osc-lib==1.12.1 # Apache-2.0 diff --git a/requirements.txt b/requirements.txt index 73e1ac8..ee82b98 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,5 @@ oslo.utils>=3.35 # Apache-2.0 oslo.log>=3.36 # Apache-2.0 PyYAML>=3.12 # MIT jsonpath-rw-ext>=1.0 # Apache-2.0 -six>=1.11 # MIT os-client-config>=1.29.0 # Apache-2.0 osc-lib>=1.12.1 # Apache-2.0