Skip to content

Commit cf31b2f

Browse files
authored
remove dependency on fix (Azure#30891)
* remove dependency on fix * update
1 parent f4ff2cb commit cf31b2f

File tree

38 files changed

+45
-114
lines changed

38 files changed

+45
-114
lines changed

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_shared/models.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# pylint: skip-file
66

77
from enum import Enum
8-
from six import with_metaclass
98
from typing import Mapping, Optional, Union, Any
109

1110
try:
@@ -15,8 +14,7 @@
1514

1615
from azure.core import CaseInsensitiveEnumMeta
1716

18-
19-
class CommunicationIdentifierKind(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
17+
class CommunicationIdentifierKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
2018
"""Communication Identifier Kind.
2119
2220
For checking yet unknown identifiers it is better to rely on the presence of the `raw_id` property,
@@ -32,7 +30,7 @@ class CommunicationIdentifierKind(with_metaclass(CaseInsensitiveEnumMeta, str, E
3230
MICROSOFT_BOT = "microsoft_bot"
3331

3432

35-
class CommunicationCloudEnvironment(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
33+
class CommunicationCloudEnvironment(str, Enum, metaclass=CaseInsensitiveEnumMeta):
3634
"""The cloud environment that the identifier belongs to"""
3735

3836
PUBLIC = "PUBLIC"

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_shared/user_credential.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from threading import Lock, Condition, Timer, TIMEOUT_MAX, Event
88
from datetime import timedelta
99
from typing import Any
10-
import six
1110
from .utils import get_current_utc_as_int
1211
from .utils import create_access_token
1312

@@ -32,7 +31,7 @@ class CommunicationTokenCredential(object):
3231
_DEFAULT_AUTOREFRESH_INTERVAL_MINUTES = 10
3332

3433
def __init__(self, token: str, **kwargs: Any):
35-
if not isinstance(token, six.string_types):
34+
if not isinstance(token, str):
3635
raise TypeError("Token must be a string.")
3736
self._token = create_access_token(token)
3837
self._token_refresher = kwargs.pop('token_refresher', None)

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_shared/user_credential_async.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from datetime import timedelta
99
from typing import Any
1010
import sys
11-
import six
1211
from .utils import get_current_utc_as_int
1312
from .utils import create_access_token
1413
from .utils_async import AsyncTimer
@@ -34,7 +33,7 @@ class CommunicationTokenCredential(object):
3433
_DEFAULT_AUTOREFRESH_INTERVAL_MINUTES = 10
3534

3635
def __init__(self, token: str, **kwargs: Any):
37-
if not isinstance(token, six.string_types):
36+
if not isinstance(token, str):
3837
raise TypeError("Token must be a string.")
3938
self._token = create_access_token(token)
4039
self._token_refresher = kwargs.pop('token_refresher', None)

sdk/communication/azure-communication-callautomation/setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
install_requires=[
6565
"msrest>=0.7.1",
6666
"azure-core<2.0.0,>=1.24.0",
67-
'six>=1.11.0'
6867
],
6968
extras_require={
7069
":python_version<'3.8'": ["typing-extensions"]

sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/_azure_communication_chat_service_enums.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,11 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from enum import Enum, EnumMeta
10-
from six import with_metaclass
9+
from enum import Enum
10+
from azure.core import CaseInsensitiveEnumMeta
1111

12-
class _CaseInsensitiveEnumMeta(EnumMeta):
13-
def __getitem__(self, name):
14-
return super().__getitem__(name.upper())
1512

16-
def __getattr__(cls, name):
17-
"""Return the enum member matching `name`
18-
We use __getattr__ instead of descriptors or inserting into the enum
19-
class' __dict__ in order to support `name` and `value` being both
20-
properties for enum members (which live in the class' __dict__) and
21-
enum members themselves.
22-
"""
23-
try:
24-
return cls._member_map_[name.upper()]
25-
except KeyError:
26-
raise AttributeError(name)
27-
28-
29-
class ChatMessageType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
13+
class ChatMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
3014
"""The chat message type.
3115
"""
3216

@@ -36,7 +20,7 @@ class ChatMessageType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
3620
PARTICIPANT_ADDED = "participantAdded"
3721
PARTICIPANT_REMOVED = "participantRemoved"
3822

39-
class CommunicationCloudEnvironmentModel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
23+
class CommunicationCloudEnvironmentModel(str, Enum, metaclass=CaseInsensitiveEnumMeta):
4024
"""The cloud that the identifier belongs to.
4125
"""
4226

sdk/communication/azure-communication-chat/azure/communication/chat/_shared/models.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# pylint: skip-file
66

77
from enum import Enum
8-
from six import with_metaclass
98
from typing import Mapping, Optional, Union, Any
109

1110
try:
@@ -16,7 +15,7 @@
1615
from azure.core import CaseInsensitiveEnumMeta
1716

1817

19-
class CommunicationIdentifierKind(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
18+
class CommunicationIdentifierKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
2019
"""Communication Identifier Kind.
2120
2221
For checking yet unknown identifiers it is better to rely on the presence of the `raw_id` property,
@@ -32,7 +31,7 @@ class CommunicationIdentifierKind(with_metaclass(CaseInsensitiveEnumMeta, str, E
3231
MICROSOFT_BOT = "microsoft_bot"
3332

3433

35-
class CommunicationCloudEnvironment(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
34+
class CommunicationCloudEnvironment(str, Enum, metaclass=CaseInsensitiveEnumMeta):
3635
"""The cloud environment that the identifier belongs to"""
3736

3837
PUBLIC = "PUBLIC"

sdk/communication/azure-communication-chat/azure/communication/chat/_shared/user_credential.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from threading import Lock, Condition, Timer, TIMEOUT_MAX, Event
88
from datetime import timedelta
99
from typing import Any
10-
import six
1110
from .utils import get_current_utc_as_int
1211
from .utils import create_access_token
1312

@@ -32,7 +31,7 @@ class CommunicationTokenCredential(object):
3231
_DEFAULT_AUTOREFRESH_INTERVAL_MINUTES = 10
3332

3433
def __init__(self, token: str, **kwargs: Any):
35-
if not isinstance(token, six.string_types):
34+
if not isinstance(token, str):
3635
raise TypeError("Token must be a string.")
3736
self._token = create_access_token(token)
3837
self._token_refresher = kwargs.pop('token_refresher', None)

sdk/communication/azure-communication-chat/azure/communication/chat/_shared/user_credential_async.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from datetime import timedelta
99
from typing import Any
1010
import sys
11-
import six
1211
from .utils import get_current_utc_as_int
1312
from .utils import create_access_token
1413
from .utils_async import AsyncTimer
@@ -34,7 +33,7 @@ class CommunicationTokenCredential(object):
3433
_DEFAULT_AUTOREFRESH_INTERVAL_MINUTES = 10
3534

3635
def __init__(self, token: str, **kwargs: Any):
37-
if not isinstance(token, six.string_types):
36+
if not isinstance(token, str):
3837
raise TypeError("Token must be a string.")
3938
self._token = create_access_token(token)
4039
self._token_refresher = kwargs.pop('token_refresher', None)

sdk/communication/azure-communication-chat/azure/communication/chat/aio/_chat_client_async.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from datetime import datetime
1111
from uuid import uuid4
1212

13-
import six
1413
from azure.core.tracing.decorator import distributed_trace
1514
from azure.core.tracing.decorator_async import distributed_trace_async
1615
from azure.core.pipeline.policies import AsyncBearerTokenCredentialPolicy

sdk/communication/azure-communication-chat/azure/communication/chat/aio/_chat_thread_client_async.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union, Tuple
1010
from datetime import datetime
1111

12-
import six
1312
from azure.core.tracing.decorator import distributed_trace
1413
from azure.core.tracing.decorator_async import distributed_trace_async
1514
from azure.core.pipeline.policies import AsyncBearerTokenCredentialPolicy

0 commit comments

Comments
 (0)