From bedaa4cf9d989876096978d374561ad4ddc71f09 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Fri, 17 Dec 2021 13:27:38 -0800 Subject: [PATCH 1/2] updates to drop 2.7 support --- .../azure-ai-metricsadvisor/CHANGELOG.md | 1 + .../azure-ai-metricsadvisor/README.md | 8 +++---- .../dev_requirements.txt | 2 +- .../azure-ai-metricsadvisor/samples/README.md | 6 ++--- .../azure-ai-metricsadvisor/setup.cfg | 2 -- .../azure-ai-metricsadvisor/setup.py | 24 ++----------------- .../azure-ai-metricsadvisor/tests/conftest.py | 9 ------- 7 files changed, 11 insertions(+), 41 deletions(-) delete mode 100644 sdk/metricsadvisor/azure-ai-metricsadvisor/setup.cfg diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/CHANGELOG.md b/sdk/metricsadvisor/azure-ai-metricsadvisor/CHANGELOG.md index 928acd8dc7cb..9ac9af39d7c2 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/CHANGELOG.md +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/CHANGELOG.md @@ -9,6 +9,7 @@ ### Bugs Fixed ### Other Changes +- Python 2.7 and 3.6 are no longer supported. Please use Python version 3.7 or later. ## 1.0.0 (2021-07-06) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md b/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md index 65030e7efb4d..f258c75852d9 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md @@ -10,7 +10,7 @@ Metrics Advisor is a scalable real-time time series monitoring, alerting, and ro ## _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 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 @@ -19,12 +19,12 @@ _Azure SDK Python packages support for Python 2.7 is ending 01 January 2022. For Install the Azure Metrics Advisor client library for Python with pip: ```commandline -pip install azure-ai-metricsadvisor --pre +pip install azure-ai-metricsadvisor ``` ### Prerequisites -* Python 2.7, or 3.6 or later is required to use this package. +* Python 3.7 or later is required to use this package. * You need an [Azure subscription][azure_sub], and a [Metrics Advisor serivce][ma_service] to use this package. ### Authenticate the client @@ -464,7 +464,7 @@ hook = client.create_hook( ### Async APIs -This library includes a complete async API supported on Python 3.6+. To use it, you must +This library includes a complete async API supported on Python 3.7+. To use it, you must first install an async transport, such as [aiohttp](https://pypi.org/project/aiohttp/). See [azure-core documentation][azure_core_docs] diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/dev_requirements.txt b/sdk/metricsadvisor/azure-ai-metricsadvisor/dev_requirements.txt index 91e5d2e162ff..a46c1ec38228 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/dev_requirements.txt +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/dev_requirements.txt @@ -2,4 +2,4 @@ -e ../../../tools/azure-devtools -e ../../identity/azure-identity ../../core/azure-core -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/metricsadvisor/azure-ai-metricsadvisor/samples/README.md b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md index 8e799d96f8a9..4a4a347c7356 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md @@ -11,7 +11,7 @@ urlFragment: metricsadvisor-samples # Samples for Azure Metrics Advisor client library for Python These code samples show common scenario operations with the Azure Metrics Advisor client library. -The async versions of the samples require Python 3.6 or later. +The async versions of the samples require Python 3.7 or later. |**File Name**|**Description**| |----------------|-------------| @@ -28,7 +28,7 @@ The async versions of the samples require Python 3.6 or later. ## Prerequisites -* Python 2.7, or 3.6 or later is required to use this package (3.6 or later if using asyncio) +* Python 3.7 or later is required to use this package * You must have an [Azure subscription][azure_subscription] and an [Azure Metrics Advisor account][portal_metrics_advisor_account] to run these samples. @@ -37,7 +37,7 @@ The async versions of the samples require Python 3.6 or later. 1. Install the Azure Metrics Advisor client library for Python with [pip][pip]: ```bash -pip install azure-ai-metricsadvisor --pre +pip install azure-ai-metricsadvisor ``` 2. Clone or download this sample repository diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/setup.cfg b/sdk/metricsadvisor/azure-ai-metricsadvisor/setup.cfg deleted file mode 100644 index 3c6e79cf31da..000000000000 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -universal=1 diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/setup.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/setup.py index 117821428f55..8e7a6e20d42e 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/setup.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/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,10 +47,8 @@ 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', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', @@ -79,13 +62,10 @@ 'azure', 'azure.ai', ]), + python_requires=">=3.7", install_requires=[ "azure-core<2.0.0,>=1.6.0", "msrest>=0.6.21", 'six>=1.11.0', ], - extras_require={ - ":python_version<'3.0'": ['azure-ai-nspkg'], - ":python_version<'3.5'": ['typing'], - } ) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/conftest.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/conftest.py index d129d1baf24a..58a612d0c8d1 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/conftest.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/conftest.py @@ -3,12 +3,3 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # ------------------------------------------------------------------------- - -import sys - -import pytest - -# Ignore async tests for Python < 3.5 -collect_ignore = [] -if sys.version_info < (3, 5): - collect_ignore.append("async_tests") From 0511ac3501e1b639830125dbcd9ec153e0f84f74 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Fri, 17 Dec 2021 17:03:43 -0800 Subject: [PATCH 2/2] feedback --- sdk/metricsadvisor/azure-ai-metricsadvisor/README.md | 2 +- sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md | 1 - sdk/metricsadvisor/azure-ai-metricsadvisor/tests/conftest.py | 5 ----- 3 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 sdk/metricsadvisor/azure-ai-metricsadvisor/tests/conftest.py diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md b/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md index f258c75852d9..696513464efa 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md @@ -464,7 +464,7 @@ hook = client.create_hook( ### Async APIs -This library includes a complete async API supported on Python 3.7+. To use it, you must +This library includes a complete set of async APIs. To use them, you must first install an async transport, such as [aiohttp](https://pypi.org/project/aiohttp/). See [azure-core documentation][azure_core_docs] diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md index 4a4a347c7356..8076ac75fd54 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md @@ -11,7 +11,6 @@ urlFragment: metricsadvisor-samples # Samples for Azure Metrics Advisor client library for Python These code samples show common scenario operations with the Azure Metrics Advisor client library. -The async versions of the samples require Python 3.7 or later. |**File Name**|**Description**| |----------------|-------------| diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/conftest.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/conftest.py deleted file mode 100644 index 58a612d0c8d1..000000000000 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/conftest.py +++ /dev/null @@ -1,5 +0,0 @@ -# ------------------------------------------------------------------------ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------