Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updates to drop 2.7/3.5 support for azure-communication-chat
  • Loading branch information
Aigerim Beishenbekova authored and Aigerim Beishenbekova committed Jan 26, 2022
commit dfa16b3cfb66d6644df9df69336ad1b87788c312
1 change: 1 addition & 0 deletions sdk/communication/azure-communication-chat/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bugs Fixed

### Other Changes
Python 2.7 is no longer supported. Please use Python version 3.6 or later.
Comment thread
AikoBB marked this conversation as resolved.

## 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 @@ -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,6 @@
-e ../../../tools/azure-sdk-tools
../../nspkg/azure-communication-nspkg
Comment thread
AikoBB marked this conversation as resolved.
Outdated
-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.

7 changes: 2 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 @@ -63,8 +62,6 @@
'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