Skip to content

Commit 63ed0fd

Browse files
authored
chore: remove redundant six usage (#362)
* chore: remove redundant six usage * remove all six usage
1 parent 3cfd5e1 commit 63ed0fd

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

aws_lambda_builders/actions.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import logging
66
import os
77
import shutil
8-
import six
98

109
from aws_lambda_builders.utils import copytree
1110

@@ -58,7 +57,7 @@ def __new__(mcs, name, bases, class_dict):
5857

5958
# Validate class variables
6059
# All classes must provide a name
61-
if not isinstance(cls.NAME, six.string_types):
60+
if not isinstance(cls.NAME, str):
6261
raise ValueError("Action must provide a valid name")
6362

6463
if not Purpose.has_value(cls.PURPOSE):
@@ -67,7 +66,7 @@ def __new__(mcs, name, bases, class_dict):
6766
return cls
6867

6968

70-
class BaseAction(six.with_metaclass(_ActionMetaClass, object)):
69+
class BaseAction(object, metaclass=_ActionMetaClass):
7170
"""
7271
Base class for all actions. It does not provide any implementation.
7372
"""

aws_lambda_builders/workflow.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import logging
77

88
from collections import namedtuple
9-
import six
109

1110
from aws_lambda_builders.binary_path import BinaryPath
1211
from aws_lambda_builders.path_resolver import PathResolver
@@ -118,7 +117,7 @@ def __new__(mcs, name, bases, class_dict):
118117
# Validate class variables
119118

120119
# All classes must provide a name
121-
if not isinstance(cls.NAME, six.string_types):
120+
if not isinstance(cls.NAME, str):
122121
raise ValueError("Workflow must provide a valid name")
123122

124123
# All workflows must express their capabilities
@@ -131,7 +130,7 @@ def __new__(mcs, name, bases, class_dict):
131130
return cls
132131

133132

134-
class BaseWorkflow(six.with_metaclass(_WorkflowMetaClass, object)):
133+
class BaseWorkflow(object, metaclass=_WorkflowMetaClass):
135134
"""
136135
Default implementation of the builder workflow. It provides several useful capabilities out-of-box that help
137136
minimize the scope of build actions.

requirements/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
six~=1.11
1+

tests/integration/workflows/python_pip/test_python_pip.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
import shutil
3-
import six
43
import sys
54
import platform
65
import tempfile
@@ -146,7 +145,7 @@ def test_mismatch_runtime_python_project(self):
146145
"Binary validation failed" not in ex_s
147146
and "pip executable not found in your python environment" not in ex_s
148147
):
149-
six.raise_from(AssertionError("Unexpected exception"), ex)
148+
raise AssertionError("Unexpected exception") from ex
150149

151150
def test_runtime_validate_python_project_fail_open_unsupported_runtime(self):
152151
with self.assertRaises(WorkflowFailedError):

0 commit comments

Comments
 (0)