Skip to content

Commit 642f089

Browse files
AikoBBrakshith91
authored andcommitted
Drop support for Python 2.7/3.5 (Azure#22760)
* updates to drop 2.7/3.5 support * mgmt setup.py fix * cspell fix for azuremgmtcommunication * removing nspkg from dev requirements all communication packages * versions update for communication packages
1 parent e7f72da commit 642f089

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+90
-178
lines changed

.vscode/cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
"azcmagent",
127127
"azsdk",
128128
"azuremgmtcore",
129+
"azuremgmtcommunication",
129130
"bdist",
130131
"byref",
131132
"cdll",

sdk/communication/azure-communication-chat/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release History
22

3-
## 1.1.1 (Unreleased)
3+
## 1.2.0 (Unreleased)
44

55
### Features Added
66

@@ -9,6 +9,7 @@
99
### Bugs Fixed
1010

1111
### Other Changes
12+
Python 2.7 is no longer supported. Please use Python version 3.6 or later.
1213

1314
## 1.1.0 (2021-09-15)
1415
- Updated `azure-communication-chat` version.

sdk/communication/azure-communication-chat/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ Read more about Azure Communication Services [here](https://docs.microsoft.com/a
55

66
[Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/communication/azure-communication-chat) | [Package (Pypi)](https://pypi.org/project/azure-communication-chat/) | [API reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-communication-chat/1.0.0b5/index.html) | [Product documentation](https://docs.microsoft.com/azure/communication-services/)
77

8+
## _Disclaimer_
9+
10+
_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
11+
812
# Getting started
913

1014
## Prerequisites
1115

12-
- Python 2.7, or 3.6 or later is required to use this package.
16+
- Python 3.6 or later is required to use this package.
1317
- A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up.
1418

1519
## Install the package
@@ -25,7 +29,7 @@ pip install --pre azure-communication-chat
2529
User access tokens enable you to build client applications that directly authenticate to Azure Communication Services. You can generate these tokens with azure.communication.identity module, and then use them to initialize the Communication Services SDKs. Example of using azure.communication.identity:
2630

2731
```bash
28-
pip install --pre azure-communication-identity
32+
pip install azure-communication-identity
2933
```
3034

3135
```python
@@ -536,8 +540,7 @@ for read_receipt_page in read_receipts.by_page():
536540
## Sample Code
537541

538542
These are code samples that show common scenario operations with the Azure Communication Chat client library.
539-
The async versions of the samples (the python sample files appended with `_async`) show asynchronous operations,
540-
and require Python 3.6 or later.
543+
The async versions of the samples (the python sample files appended with `_async`) show asynchronous operations.
541544
Before run the sample code, refer to Prerequisites
542545
<!-- [Prerequisites](#Prerequisites) -->
543546
to create a resource, then set some Environment Variables

sdk/communication/azure-communication-chat/azure/communication/chat/_chat_client.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
# --------------------------------------------------------------------------
66
from typing import TYPE_CHECKING
77
from uuid import uuid4
8-
try:
9-
from urllib.parse import urlparse
10-
except ImportError:
11-
from urlparse import urlparse # type: ignore
8+
from urllib.parse import urlparse
129

1310
from azure.core.tracing.decorator import distributed_trace
1411
from azure.core.pipeline.policies import BearerTokenCredentialPolicy

sdk/communication/azure-communication-chat/azure/communication/chat/_chat_thread_client.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
# --------------------------------------------------------------------------
66
from typing import TYPE_CHECKING
77

8-
try:
9-
from urllib.parse import urlparse
10-
except ImportError:
11-
from urlparse import urlparse # type: ignore
8+
from urllib.parse import urlparse
129

1310
from azure.core.tracing.decorator import distributed_trace
1411
from azure.core.pipeline.policies import BearerTokenCredentialPolicy

sdk/communication/azure-communication-chat/azure/communication/chat/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
# license information.
55
# --------------------------------------------------------------------------
66

7-
VERSION = "1.1.1"
7+
VERSION = "1.2.0"
88

99
SDK_MONIKER = "communication-chat/{}".format(VERSION) # type: str

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6-
try:
7-
from urllib.parse import urlparse
8-
except ImportError:
9-
from urlparse import urlparse # type: ignore
6+
from urllib.parse import urlparse
107

118
# pylint: disable=unused-import,ungrouped-imports
129
from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6-
try:
7-
from urllib.parse import urlparse
8-
except ImportError:
9-
from urlparse import urlparse # type: ignore
6+
from urllib.parse import urlparse
107

118
# pylint: disable=unused-import,ungrouped-imports
129
from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union, Tuple
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
-e ../../../tools/azure-sdk-tools
2-
../../nspkg/azure-communication-nspkg
32
-e ../azure-communication-identity
4-
aiohttp>=3.0; python_version >= '3.5'
3+
aiohttp>=3.0
54
-e ../../../tools/azure-devtools
6-
python-dateutil>=2.8.1; python_version >= '3.5'
5+
python-dateutil>=2.8.1

sdk/communication/azure-communication-chat/setup.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# your package.
99

1010
# this setup.py is set up in a specific way to keep the azure* and azure-mgmt-* namespaces WORKING all the way
11-
# up from python 2.7. Reference here: https://github.com/Azure/azure-sdk-for-python/wiki/Azure-packaging
11+
# up from python 3.6. Reference here: https://github.com/Azure/azure-sdk-for-python/wiki/Azure-packaging
1212

1313
PACKAGE_NAME = "azure-communication-chat"
1414
PACKAGE_PPRINT_NAME = "Communication Chat"
@@ -41,8 +41,7 @@
4141
classifiers=[
4242
"Development Status :: 5 - Production/Stable",
4343
'Programming Language :: Python',
44-
'Programming Language :: Python :: 2',
45-
'Programming Language :: Python :: 2.7',
44+
"Programming Language :: Python :: 3 :: Only",
4645
'Programming Language :: Python :: 3',
4746
'Programming Language :: Python :: 3.6',
4847
'Programming Language :: Python :: 3.7',
@@ -56,14 +55,13 @@
5655
'azure',
5756
'azure.communication'
5857
]),
58+
python_requires=">=3.6",
5959
install_requires=[
6060
"msrest>=0.6.21",
6161
"azure-core<2.0.0,>=1.19.1",
6262
'six>=1.11.0'
6363
],
6464
extras_require={
65-
":python_version<'3.0'": ['azure-communication-nspkg'],
66-
":python_version<'3.5'": ["typing"],
6765
":python_version<'3.8'": ["typing-extensions"]
6866
}
6967
)

sdk/communication/azure-communication-chat/tests/conftest.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

sdk/communication/azure-communication-chat/tests/test_chat_client.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222
from datetime import datetime
2323
import calendar
2424

25-
try:
26-
from unittest.mock import Mock, patch
27-
except ImportError: # python < 3.3
28-
from mock import Mock, patch # type: ignore
25+
from unittest.mock import Mock, patch
2926

3027
def _convert_datetime_to_utc_int(input):
3128
return int(calendar.timegm(input.utctimetuple()))

sdk/communication/azure-communication-chat/tests/test_chat_client_async.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
from datetime import datetime
1818
from msrest.serialization import TZ_UTC
1919

20-
try:
21-
from unittest.mock import Mock, patch
22-
except ImportError: # python < 3.3
23-
from mock import Mock, patch # type: ignore
20+
from unittest.mock import Mock, patch
2421

2522
import pytest
2623
import time

sdk/communication/azure-communication-chat/tests/test_chat_thread_client.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
)
2222
from unittest_helpers import mock_response
2323

24-
try:
25-
from unittest.mock import Mock, patch
26-
except ImportError: # python < 3.3
27-
from mock import Mock, patch # type: ignore
24+
from unittest.mock import Mock, patch
2825

2926
def _convert_datetime_to_utc_int(input):
3027
return int(calendar.timegm(input.utctimetuple()))

sdk/communication/azure-communication-chat/tests/test_chat_thread_client_async.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
from unittest_helpers import mock_response
1818
from azure.core.exceptions import HttpResponseError
1919

20-
try:
21-
from unittest.mock import Mock, patch
22-
except ImportError: # python < 3.3
23-
from mock import Mock, patch # type: ignore
20+
from unittest.mock import Mock, patch
2421

2522
import pytest
2623
import time

sdk/communication/azure-communication-chat/tests/unittest_helpers.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
# --------------------------------------------------------------------------
66
import json
77

8-
try:
9-
from unittest import mock
10-
except ImportError: # python < 3.3
11-
import mock # type: ignore
8+
from unittest import mock
129

1310

1411
def mock_response(status_code=200, headers=None, json_payload=None):

sdk/communication/azure-communication-identity/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release History
22

3-
## 1.1.0b2 (Unreleased)
3+
## 1.2.0 (Unreleased)
44

55
### Features Added
66

@@ -9,6 +9,7 @@
99
### Bugs Fixed
1010

1111
### Other Changes
12+
- Python 2.7 is no longer supported. Please use Python version 3.6 or later.
1213

1314
## 1.1.0b1 (2021-11-09)
1415
### Features Added

sdk/communication/azure-communication-identity/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ Azure Communication Identity client package is intended to be used to setup the
44

55
[Source code](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/communication/azure-communication-identity) | [Package (Pypi)](https://pypi.org/project/azure-communication-identity/) | [API reference documentation](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/communication/azure-communication-identity) | [Product documentation](https://docs.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-python)
66

7+
## _Disclaimer_
8+
9+
_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
710

811
# Getting started
912
### Prerequisites
10-
- Python 2.7, or 3.6 or later is required to use this package.
13+
- Python 3.6 or later is required to use this package.
1114
- You must have an [Azure subscription](https://azure.microsoft.com/free/)
1215
- A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up.
1316
### Install the package

sdk/communication/azure-communication-identity/azure/communication/identity/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
# license information.
55
# --------------------------------------------------------------------------
66

7-
VERSION = "1.1.0b2"
7+
VERSION = "1.2.0"
88

99
SDK_MONIKER = "communication-identity/{}".format(VERSION) # type: str
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
-e ../../../tools/azure-sdk-tools
22
-e ../../identity/azure-identity
33
../../core/azure-core
4-
../../nspkg/azure-communication-nspkg
54
../azure-mgmt-communication
65
aiohttp>=3.0; python_version >= '3.5'
76
-e ../../../tools/azure-devtools

sdk/communication/azure-communication-identity/setup.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# your package.
99

1010
# this setup.py is set up in a specific way to keep the azure* and azure-mgmt-* namespaces WORKING all the way
11-
# up from python 2.7. Reference here: https://github.com/Azure/azure-sdk-for-python/wiki/Azure-packaging
11+
# up from python 3.6. Reference here: https://github.com/Azure/azure-sdk-for-python/wiki/Azure-packaging
1212

1313
PACKAGE_NAME = "azure-communication-identity"
1414
PACKAGE_PPRINT_NAME = "Communication Identity Service"
@@ -46,8 +46,7 @@
4646
"Development Status :: 4 - Beta",
4747

4848
'Programming Language :: Python',
49-
'Programming Language :: Python :: 2',
50-
'Programming Language :: Python :: 2.7',
49+
'Programming Language :: Python :: 3 :: Only',
5150
'Programming Language :: Python :: 3',
5251
'Programming Language :: Python :: 3.6',
5352
'Programming Language :: Python :: 3.7',
@@ -60,12 +59,12 @@
6059
'azure',
6160
'azure.communication'
6261
]),
62+
python_requires=">=3.6",
6363
install_requires=[
6464
"msrest>=0.6.21",
6565
"azure-core<2.0.0,>=1.19.1"
6666
],
6767
extras_require={
68-
":python_version<'3.0'": ['azure-communication-nspkg'],
6968
":python_version<'3.8'": ["typing-extensions"]
7069
},
7170
project_urls={

sdk/communication/azure-communication-identity/tests/_shared/helper.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
# --------------------------------------------------------------------------
66
import re
77
from azure_devtools.scenario_tests import RecordingProcessor
8-
try:
9-
from urllib.parse import urlparse
10-
except ImportError:
11-
from urlparse import urlparse
8+
from urllib.parse import urlparse
129

1310
class URIIdentityReplacer(RecordingProcessor):
1411
"""Replace the identity in request uri"""

sdk/communication/azure-communication-identity/tests/conftest.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

sdk/communication/azure-communication-networktraversal/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release History
22

3-
## 1.0.0b3 (Unreleased)
3+
## 1.1.0 (Unreleased)
44

55
### Features Added
66

@@ -9,6 +9,7 @@
99
### Bugs Fixed
1010

1111
### Other Changes
12+
Python 2.7 is no longer supported. Please use Python version 3.6 or later.
1213

1314
## 1.0.0b2 (2021-11-18)
1415

sdk/communication/azure-communication-networktraversal/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ It will provide TURN credentials to a user.
66

77
[Source code](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/communication) | [API reference documentation](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/communication)
88

9+
## _Disclaimer_
10+
11+
_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
12+
913
# Getting started
1014

1115
### Prerequisites
1216

13-
- Python 2.7, or 3.6 or later is required to use this package.
17+
- Python 3.6 or later is required to use this package.
1418
- You must have an [Azure subscription](https://azure.microsoft.com/free/)
1519
- A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up.
1620

sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
# license information.
55
# --------------------------------------------------------------------------
66

7-
VERSION = "1.0.0b3"
7+
VERSION = "1.1.0"
88

99
SDK_MONIKER = "communication-networktraversal/{}".format(VERSION) # type: str

sdk/communication/azure-communication-networktraversal/dev_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
-e ../../identity/azure-identity
33
-e ../azure-communication-identity
44
../../core/azure-core
5-
aiohttp>=3.0; python_version >= '3.5'
5+
aiohttp>=3.0
66
-e ../../../tools/azure-devtools

sdk/communication/azure-communication-networktraversal/setup.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)