Skip to content

Commit 396fb73

Browse files
[textanalytics] updates to drop 2.7 support (Azure#22221)
* drop 2.7 support * missed an instance of 3.6 * fix * feedback
1 parent 348ddf0 commit 396fb73

File tree

7 files changed

+7
-38
lines changed

7 files changed

+7
-38
lines changed

sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- `string_index_type` now correctly defaults to the Python default `UnicodeCodePoint` for `AnalyzeSentimentAction` and `RecognizeCustomEntitiesAction`.
1111

1212
### Other Changes
13+
- Python 2.7 and 3.6 are no longer supported. Please use Python version 3.7 or later.
1314

1415
## 5.2.0b2 (2021-11-02)
1516

sdk/textanalytics/azure-ai-textanalytics/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ Text Analytics is a cloud-based service that provides advanced natural language
1616

1717
## _Disclaimer_
1818

19-
_Azure SDK Python packages support for Python 2.7 is ending 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
19+
_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_
2020

2121
## Getting started
2222

2323
### Prerequisites
2424

25-
- Python 2.7, or 3.6 or later is required to use this package.
25+
- Python 3.7 later is required to use this package.
2626
- You must have an [Azure subscription][azure_subscription] and a
2727
[Cognitive Services or Language resource][ta_or_cs_resource] to use this package.
2828

@@ -635,8 +635,6 @@ result = text_analytics_client.analyze_sentiment(documents, logging_enable=True)
635635
### More sample code
636636

637637
These code samples show common scenario operations with the Azure Text Analytics client library.
638-
The async versions of the samples (the python sample files appended with `_async`) show asynchronous operations
639-
with Text Analytics and require Python 3.6 or later.
640638

641639
Authenticate the client with a Cognitive Services/Language API key or a token credential from [azure-identity][azure_identity]:
642640

sdk/textanalytics/azure-ai-textanalytics/dev_requirements.txt

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

sdk/textanalytics/azure-ai-textanalytics/samples/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ urlFragment: textanalytics-samples
1212
# Samples for Azure Text Analytics client library for Python
1313

1414
These code samples show common scenario operations with the Azure Text Analytics client library.
15-
The async versions of the samples require Python 3.6 or later.
1615

1716
You can authenticate your client with a Cognitive Services/Text Analytics API key or through Azure Active Directory with a token credential from [azure-identity][azure_identity]:
1817
* See [sample_authentication.py][sample_authentication] and [sample_authentication_async.py][sample_authentication_async] for how to authenticate in the above cases.
@@ -37,7 +36,7 @@ These sample programs show common scenarios for the Text Analytics client's offe
3736
|[sample_model_version.py][sample_model_version] and [sample_model_version_async.py][sample_model_version_async]|Set the model version for pre-built Text Analytics models|
3837

3938
## Prerequisites
40-
* Python 2.7, or 3.6 or later is required to use this package (3.6 or later if using asyncio)
39+
* Python 3.7 or later is required to use this package
4140
* You must have an [Azure subscription][azure_subscription] and an
4241
[Azure Text Analytics account][azure_text_analytics_account] to run these samples.
4342

sdk/textanalytics/azure-ai-textanalytics/setup.cfg

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

sdk/textanalytics/azure-ai-textanalytics/setup.py

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,6 @@
2020
# a-b-c => a.b.c
2121
namespace_name = PACKAGE_NAME.replace('-', '.')
2222

23-
# azure v0.x is not compatible with this package
24-
# azure v0.x used to have a __version__ attribute (newer versions don't)
25-
try:
26-
import azure
27-
try:
28-
ver = azure.__version__
29-
raise Exception(
30-
'This package is incompatible with azure=={}. '.format(ver) +
31-
'Uninstall it with "pip uninstall azure".'
32-
)
33-
except AttributeError:
34-
pass
35-
except ImportError:
36-
pass
37-
3823
# Version extraction inspired from 'requests'
3924
with open(os.path.join(package_folder_path, '_version.py'), 'r') as fd:
4025
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
@@ -62,10 +47,8 @@
6247
classifiers=[
6348
"Development Status :: 4 - Beta",
6449
'Programming Language :: Python',
65-
'Programming Language :: Python :: 2',
66-
'Programming Language :: Python :: 2.7',
50+
"Programming Language :: Python :: 3 :: Only",
6751
'Programming Language :: Python :: 3',
68-
'Programming Language :: Python :: 3.6',
6952
'Programming Language :: Python :: 3.7',
7053
'Programming Language :: Python :: 3.8',
7154
'Programming Language :: Python :: 3.9',
@@ -79,14 +62,11 @@
7962
'azure',
8063
'azure.ai',
8164
]),
65+
python_requires=">=3.7",
8266
install_requires=[
8367
"azure-core<2.0.0,>=1.19.1",
8468
"msrest>=0.6.21",
8569
'azure-common~=1.1',
8670
'six>=1.11.0',
8771
],
88-
extras_require={
89-
":python_version<'3.0'": ['azure-ai-nspkg'],
90-
":python_version<'3.5'": ['typing'],
91-
}
9272
)

sdk/textanalytics/azure-ai-textanalytics/tests/conftest.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# license information.
77
# --------------------------------------------------------------------------
88

9-
import sys
109
import pytest
1110
from devtools_testutils import (
1211
test_proxy,
@@ -16,12 +15,6 @@
1615
)
1716

1817

19-
# Ignore async tests for Python < 3.6
20-
collect_ignore_glob = []
21-
if sys.version_info < (3, 6):
22-
collect_ignore_glob.append("*_async.py")
23-
24-
2518
@pytest.fixture(scope="session", autouse=True)
2619
def add_sanitizers(test_proxy):
2720
add_remove_header_sanitizer(headers="Ocp-Apim-Subscription-Key")

0 commit comments

Comments
 (0)