From 2b4af0869cb65456771e267cb45ceb307e030926 Mon Sep 17 00:00:00 2001 From: swathipil <76007337+swathipil@users.noreply.github.com> Date: Thu, 6 Jan 2022 14:33:27 -0800 Subject: [PATCH] drop Python 2.7/3.6 (#22320) --- sdk/servicebus/azure-servicebus/CHANGELOG.md | 2 ++ sdk/servicebus/azure-servicebus/README.md | 6 ++--- sdk/servicebus/azure-servicebus/conftest.py | 4 --- .../azure-servicebus/dev_requirements.txt | 2 +- .../azure-servicebus/samples/README.md | 4 +-- sdk/servicebus/azure-servicebus/setup.cfg | 2 -- sdk/servicebus/azure-servicebus/setup.py | 26 +++---------------- 7 files changed, 11 insertions(+), 35 deletions(-) delete mode 100644 sdk/servicebus/azure-servicebus/setup.cfg diff --git a/sdk/servicebus/azure-servicebus/CHANGELOG.md b/sdk/servicebus/azure-servicebus/CHANGELOG.md index 015052edc997..a6f05e1918a4 100644 --- a/sdk/servicebus/azure-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-servicebus/CHANGELOG.md @@ -2,6 +2,8 @@ ## 7.5.0 (Unreleased) +This version and all future versions will require Python 3.7+. Python 2.7 and 3.6 are no longer supported. + ### Features Added - Added support for fixed (linear) retry backoff: diff --git a/sdk/servicebus/azure-servicebus/README.md b/sdk/servicebus/azure-servicebus/README.md index ea2efca44076..99e9c59e3770 100644 --- a/sdk/servicebus/azure-servicebus/README.md +++ b/sdk/servicebus/azure-servicebus/README.md @@ -18,7 +18,7 @@ of this package please look at our [migration guide to move from Service Bus V0. ## _Disclaimer_ -_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_ +_Azure SDK Python packages support for Python 2.7 ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_ ## Getting started @@ -34,7 +34,7 @@ pip install azure-servicebus To use this package, you must have: * Azure subscription - [Create a free account][azure_sub] * Azure Service Bus - [Namespace and management credentials][service_bus_namespace] -* Python 2.7, 3.6 or later - [Install Python][python] +* Python 3.7 or later - [Install Python][python] If you need an Azure service bus namespace, you can create it via the [Azure Portal][azure_namespace_creation]. @@ -61,7 +61,7 @@ protocol. There are implementations of the `TokenCredential` protocol available [azure-identity package][pypi_azure_identity]. The fully qualified namespace is of the format ``. - To use the credential types provided by `azure-identity`, please install the package: ```pip install azure-identity``` -- Additionally, to use the async API supported on Python 3.6+, you must first install an async transport, such as [`aiohttp`](https://pypi.org/project/aiohttp/): +- Additionally, to use the async API, you must first install an async transport, such as [`aiohttp`](https://pypi.org/project/aiohttp/): ```pip install aiohttp``` - When using Azure Active Directory, your principal must be assigned a role which allows access to Service Bus, such as the Azure Service Bus Data Owner role. For more information about using Azure Active Directory authorization with Service Bus, diff --git a/sdk/servicebus/azure-servicebus/conftest.py b/sdk/servicebus/azure-servicebus/conftest.py index 6d440a7f620e..fb49c4fe14a4 100644 --- a/sdk/servicebus/azure-servicebus/conftest.py +++ b/sdk/servicebus/azure-servicebus/conftest.py @@ -10,11 +10,7 @@ import pytest -# Ignore async tests for Python < 3.5 collect_ignore = [] -if sys.version_info < (3, 5): - collect_ignore.append("tests/async_tests") - collect_ignore.append("samples/async_samples") # Only run stress tests on request. if not any([arg.startswith('test_stress') or arg.endswith('StressTest') for arg in sys.argv]): diff --git a/sdk/servicebus/azure-servicebus/dev_requirements.txt b/sdk/servicebus/azure-servicebus/dev_requirements.txt index 1161edc25300..1e18873ffb9d 100644 --- a/sdk/servicebus/azure-servicebus/dev_requirements.txt +++ b/sdk/servicebus/azure-servicebus/dev_requirements.txt @@ -3,4 +3,4 @@ -e ../../../tools/azure-devtools -e ../../../tools/azure-sdk-tools azure-mgmt-servicebus~=1.0.0 -aiohttp>=3.0; python_version >= '3.5' \ No newline at end of file +aiohttp>=3.0 \ No newline at end of file diff --git a/sdk/servicebus/azure-servicebus/samples/README.md b/sdk/servicebus/azure-servicebus/samples/README.md index 094a770137b3..b4053fc360f6 100644 --- a/sdk/servicebus/azure-servicebus/samples/README.md +++ b/sdk/servicebus/azure-servicebus/samples/README.md @@ -14,7 +14,7 @@ urlFragment: servicebus-samples > which has different APIs than the older version (0.50). Please visit [this link](https://github.com/Azure/azure-sdk-for-python/tree/servicebus_v0.50.3/sdk/servicebus/azure-servicebus/samples) for samples of version 0.50 of this library. These are code samples that show common scenario operations with the Azure Service Bus client library. -Both [sync version](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples) and [async version](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/async_samples) of samples are provided, async samples require Python 3.6 or later. +Both [sync version](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples) and [async version](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/async_samples) of samples are provided, async samples require Python 3.7 or later. - [send_queue.py](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py) ([async version](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/async_samples/send_queue_async.py)) - Examples to send messages to a service bus queue: - From a connection string @@ -96,7 +96,7 @@ Both [sync version](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/ - [topic_subscription_with_rule_operations.py](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples/topic_subscription_with_rule_operations.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/async_samples/topic_subscription_with_rule_operations_async.py)) - Example to manage rules on topic subscriptions and to explore different forms of subscription filters. ## Prerequisites -- Python 2.7, 3.6 or later. +- Python 3.7 or later. - **Microsoft Azure Subscription:** To use Azure services, including Azure Service Bus, you'll need a subscription. If you do not have an existing Azure account, you may sign up for a free trial or use your MSDN subscriber benefits when you [create an account](https://account.windowsazure.com/Home/Index). diff --git a/sdk/servicebus/azure-servicebus/setup.cfg b/sdk/servicebus/azure-servicebus/setup.cfg deleted file mode 100644 index 3c6e79cf31da..000000000000 --- a/sdk/servicebus/azure-servicebus/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -universal=1 diff --git a/sdk/servicebus/azure-servicebus/setup.py b/sdk/servicebus/azure-servicebus/setup.py index a156e4a8762e..25086e099b0f 100644 --- a/sdk/servicebus/azure-servicebus/setup.py +++ b/sdk/servicebus/azure-servicebus/setup.py @@ -20,21 +20,6 @@ # a-b-c => a.b.c namespace_name = PACKAGE_NAME.replace('-', '.') -# azure v0.x is not compatible with this package -# azure v0.x used to have a __version__ attribute (newer versions don't) -try: - import azure - try: - ver = azure.__version__ - raise Exception( - 'This package is incompatible with azure=={}. '.format(ver) + - 'Uninstall it with "pip uninstall azure".' - ) - except AttributeError: - pass -except ImportError: - pass - # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', @@ -62,16 +47,14 @@ classifiers=[ "Development Status :: 5 - Production/Stable", 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'License :: OSI Approved :: MIT License', ], + python_requires=">=3.7", zip_safe=False, packages=find_packages(exclude=[ 'tests', @@ -86,8 +69,5 @@ 'azure-core<2.0.0,>=1.14.0', "isodate>=0.6.0", "six>=1.11.0", - ], - extras_require={ - ":python_version<'3.0'": ['azure-nspkg', 'futures'], - } + ] )