From d71b2863d00283510ca0f484ccf634d8216a578d Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 19 Jul 2020 17:41:22 +0800 Subject: [PATCH] python-common: drop python2 support Signed-off-by: Kefu Chai --- src/python-common/README.rst | 5 ----- src/python-common/ceph/deployment/drive_group.py | 5 ++--- src/python-common/ceph/deployment/service_spec.py | 5 ++--- src/python-common/requirements.txt | 1 - src/python-common/setup.py | 3 --- 5 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/python-common/README.rst b/src/python-common/README.rst index 07f42fd147e..3900ec4f944 100644 --- a/src/python-common/README.rst +++ b/src/python-common/README.rst @@ -11,11 +11,6 @@ Like for example: - ``ceph`` command line interface and other Ceph tools. - Also external tools. -Requirements -============ - -- ``python-six`` - Usage ===== diff --git a/src/python-common/ceph/deployment/drive_group.py b/src/python-common/ceph/deployment/drive_group.py index 85da04bf297..2837c6571e1 100644 --- a/src/python-common/ceph/deployment/drive_group.py +++ b/src/python-common/ceph/deployment/drive_group.py @@ -7,7 +7,6 @@ try: from typing import Optional, List, Dict, Any except ImportError: pass -import six class DeviceSelection(object): @@ -257,7 +256,7 @@ class DriveGroupSpec(ServiceSpec): for key in ('block_wal_size', 'block_db_size', 'journal_size'): if key in json_drive_group: - if isinstance(json_drive_group[key], six.string_types): + if isinstance(json_drive_group[key], str): from ceph.deployment.drive_selection import SizeMatcher json_drive_group[key] = SizeMatcher.str_to_byte(json_drive_group[key]) @@ -277,7 +276,7 @@ class DriveGroupSpec(ServiceSpec): if not self.service_id: raise DriveGroupValidationError('service_id is required') - if not isinstance(self.placement.host_pattern, six.string_types) and \ + if not isinstance(self.placement.host_pattern, str) and \ self.placement.host_pattern is not None: raise DriveGroupValidationError('host_pattern must be of type string') diff --git a/src/python-common/ceph/deployment/service_spec.py b/src/python-common/ceph/deployment/service_spec.py index 9111c75ad71..e1f0e440edb 100644 --- a/src/python-common/ceph/deployment/service_spec.py +++ b/src/python-common/ceph/deployment/service_spec.py @@ -4,7 +4,6 @@ from collections import namedtuple, OrderedDict from functools import wraps from typing import Optional, Dict, Any, List, Union, Callable, Iterator -import six import yaml from ceph.deployment.hostspec import HostSpec @@ -123,9 +122,9 @@ class HostPlacementSpec(namedtuple('HostPlacementSpec', ['hostname', 'network', try: # if subnets are defined, also verify the validity if '/' in network: - ip_network(six.text_type(network)) + ip_network(network) else: - ip_address(six.text_type(network)) + ip_address(network) except ValueError as e: # logging? raise e diff --git a/src/python-common/requirements.txt b/src/python-common/requirements.txt index 7df43fb736a..d472610f624 100644 --- a/src/python-common/requirements.txt +++ b/src/python-common/requirements.txt @@ -1,4 +1,3 @@ -six pytest >=2.1.3,<5; python_version < '3.5' mock; python_version < '3.3' mypy==0.782; python_version >= '3' diff --git a/src/python-common/setup.py b/src/python-common/setup.py index 48daee6dee4..369c928f928 100644 --- a/src/python-common/setup.py +++ b/src/python-common/setup.py @@ -17,9 +17,6 @@ setup( keywords='ceph', url="https://github.com/ceph/ceph", zip_safe = False, - install_requires=( - 'six', - ), classifiers = [ 'Intended Audience :: Developer', 'Operating System :: POSIX :: Linux', -- 2.39.5