Skip to content

Commit

Permalink
Drop support for Python 2.7/3.5 (Azure#22760)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
AikoBB authored and rakshith91 committed Apr 10, 2022
1 parent e7f72da commit 642f089
Show file tree
Hide file tree
Showing 55 changed files with 90 additions and 178 deletions.
1 change: 1 addition & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
"azcmagent",
"azsdk",
"azuremgmtcore",
"azuremgmtcommunication",
"bdist",
"byref",
"cdll",
Expand Down
3 changes: 2 additions & 1 deletion sdk/communication/azure-communication-chat/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 1.1.1 (Unreleased)
## 1.2.0 (Unreleased)

### Features Added

Expand All @@ -9,6 +9,7 @@
### Bugs Fixed

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

## 1.1.0 (2021-09-15)
- Updated `azure-communication-chat` version.
Expand Down
11 changes: 7 additions & 4 deletions sdk/communication/azure-communication-chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ Read more about Azure Communication Services [here](https://docs.microsoft.com/a

[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/)

## _Disclaimer_

_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_

# Getting started

## Prerequisites

- Python 2.7, or 3.6 or later is required to use this package.
- Python 3.6 or later is required to use this package.
- 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.

## Install the package
Expand All @@ -25,7 +29,7 @@ pip install --pre azure-communication-chat
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:

```bash
pip install --pre azure-communication-identity
pip install azure-communication-identity
```

```python
Expand Down Expand Up @@ -536,8 +540,7 @@ for read_receipt_page in read_receipts.by_page():
## Sample Code

These are code samples that show common scenario operations with the Azure Communication Chat client library.
The async versions of the samples (the python sample files appended with `_async`) show asynchronous operations,
and require Python 3.6 or later.
The async versions of the samples (the python sample files appended with `_async`) show asynchronous operations.
Before run the sample code, refer to Prerequisites
<!-- [Prerequisites](#Prerequisites) -->
to create a resource, then set some Environment Variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
# --------------------------------------------------------------------------
from typing import TYPE_CHECKING
from uuid import uuid4
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse # type: ignore
from urllib.parse import urlparse

from azure.core.tracing.decorator import distributed_trace
from azure.core.pipeline.policies import BearerTokenCredentialPolicy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
# --------------------------------------------------------------------------
from typing import TYPE_CHECKING

try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse # type: ignore
from urllib.parse import urlparse

from azure.core.tracing.decorator import distributed_trace
from azure.core.pipeline.policies import BearerTokenCredentialPolicy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
# license information.
# --------------------------------------------------------------------------

VERSION = "1.1.1"
VERSION = "1.2.0"

SDK_MONIKER = "communication-chat/{}".format(VERSION) # type: str
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse # type: ignore
from urllib.parse import urlparse

# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse # type: ignore
from urllib.parse import urlparse

# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union, Tuple
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
-e ../../../tools/azure-sdk-tools
../../nspkg/azure-communication-nspkg
-e ../azure-communication-identity
aiohttp>=3.0; python_version >= '3.5'
aiohttp>=3.0
-e ../../../tools/azure-devtools
python-dateutil>=2.8.1; python_version >= '3.5'
python-dateutil>=2.8.1
2 changes: 0 additions & 2 deletions sdk/communication/azure-communication-chat/setup.cfg

This file was deleted.

8 changes: 3 additions & 5 deletions sdk/communication/azure-communication-chat/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# your package.

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

PACKAGE_NAME = "azure-communication-chat"
PACKAGE_PPRINT_NAME = "Communication Chat"
Expand Down Expand Up @@ -41,8 +41,7 @@
classifiers=[
"Development Status :: 5 - Production/Stable",
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
"Programming Language :: Python :: 3 :: Only",
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
Expand All @@ -56,14 +55,13 @@
'azure',
'azure.communication'
]),
python_requires=">=3.6",
install_requires=[
"msrest>=0.6.21",
"azure-core<2.0.0,>=1.19.1",
'six>=1.11.0'
],
extras_require={
":python_version<'3.0'": ['azure-communication-nspkg'],
":python_version<'3.5'": ["typing"],
":python_version<'3.8'": ["typing-extensions"]
}
)
11 changes: 0 additions & 11 deletions sdk/communication/azure-communication-chat/tests/conftest.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
from datetime import datetime
import calendar

try:
from unittest.mock import Mock, patch
except ImportError: # python < 3.3
from mock import Mock, patch # type: ignore
from unittest.mock import Mock, patch

def _convert_datetime_to_utc_int(input):
return int(calendar.timegm(input.utctimetuple()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
from datetime import datetime
from msrest.serialization import TZ_UTC

try:
from unittest.mock import Mock, patch
except ImportError: # python < 3.3
from mock import Mock, patch # type: ignore
from unittest.mock import Mock, patch

import pytest
import time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
)
from unittest_helpers import mock_response

try:
from unittest.mock import Mock, patch
except ImportError: # python < 3.3
from mock import Mock, patch # type: ignore
from unittest.mock import Mock, patch

def _convert_datetime_to_utc_int(input):
return int(calendar.timegm(input.utctimetuple()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
from unittest_helpers import mock_response
from azure.core.exceptions import HttpResponseError

try:
from unittest.mock import Mock, patch
except ImportError: # python < 3.3
from mock import Mock, patch # type: ignore
from unittest.mock import Mock, patch

import pytest
import time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
# --------------------------------------------------------------------------
import json

try:
from unittest import mock
except ImportError: # python < 3.3
import mock # type: ignore
from unittest import mock


def mock_response(status_code=200, headers=None, json_payload=None):
Expand Down
3 changes: 2 additions & 1 deletion sdk/communication/azure-communication-identity/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 1.1.0b2 (Unreleased)
## 1.2.0 (Unreleased)

### Features Added

Expand All @@ -9,6 +9,7 @@
### Bugs Fixed

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

## 1.1.0b1 (2021-11-09)
### Features Added
Expand Down
5 changes: 4 additions & 1 deletion sdk/communication/azure-communication-identity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ Azure Communication Identity client package is intended to be used to setup the

[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)

## _Disclaimer_

_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_

# Getting started
### Prerequisites
- Python 2.7, or 3.6 or later is required to use this package.
- Python 3.6 or later is required to use this package.
- You must have an [Azure subscription](https://azure.microsoft.com/free/)
- 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.
### Install the package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
# license information.
# --------------------------------------------------------------------------

VERSION = "1.1.0b2"
VERSION = "1.2.0"

SDK_MONIKER = "communication-identity/{}".format(VERSION) # type: str
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
-e ../../../tools/azure-sdk-tools
-e ../../identity/azure-identity
../../core/azure-core
../../nspkg/azure-communication-nspkg
../azure-mgmt-communication
aiohttp>=3.0; python_version >= '3.5'
-e ../../../tools/azure-devtools
2 changes: 0 additions & 2 deletions sdk/communication/azure-communication-identity/setup.cfg

This file was deleted.

7 changes: 3 additions & 4 deletions sdk/communication/azure-communication-identity/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# your package.

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

PACKAGE_NAME = "azure-communication-identity"
PACKAGE_PPRINT_NAME = "Communication Identity Service"
Expand Down Expand Up @@ -46,8 +46,7 @@
"Development Status :: 4 - Beta",

'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
Expand All @@ -60,12 +59,12 @@
'azure',
'azure.communication'
]),
python_requires=">=3.6",
install_requires=[
"msrest>=0.6.21",
"azure-core<2.0.0,>=1.19.1"
],
extras_require={
":python_version<'3.0'": ['azure-communication-nspkg'],
":python_version<'3.8'": ["typing-extensions"]
},
project_urls={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
# --------------------------------------------------------------------------
import re
from azure_devtools.scenario_tests import RecordingProcessor
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from urllib.parse import urlparse

class URIIdentityReplacer(RecordingProcessor):
"""Replace the identity in request uri"""
Expand Down
11 changes: 0 additions & 11 deletions sdk/communication/azure-communication-identity/tests/conftest.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 1.0.0b3 (Unreleased)
## 1.1.0 (Unreleased)

### Features Added

Expand All @@ -9,6 +9,7 @@
### Bugs Fixed

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

## 1.0.0b2 (2021-11-18)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ It will provide TURN credentials to a user.

[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)

## _Disclaimer_

_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_

# Getting started

### Prerequisites

- Python 2.7, or 3.6 or later is required to use this package.
- Python 3.6 or later is required to use this package.
- You must have an [Azure subscription](https://azure.microsoft.com/free/)
- 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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
# license information.
# --------------------------------------------------------------------------

VERSION = "1.0.0b3"
VERSION = "1.1.0"

SDK_MONIKER = "communication-networktraversal/{}".format(VERSION) # type: str
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
-e ../../identity/azure-identity
-e ../azure-communication-identity
../../core/azure-core
aiohttp>=3.0; python_version >= '3.5'
aiohttp>=3.0
-e ../../../tools/azure-devtools

This file was deleted.

Loading

0 comments on commit 642f089

Please sign in to comment.