From 3aa619eadaceda4d1623ae339dd775bc4cb5c412 Mon Sep 17 00:00:00 2001 From: swathipil <76007337+swathipil@users.noreply.github.com> Date: Wed, 5 Jan 2022 12:31:06 -0800 Subject: [PATCH] [SchemaRegistry] drop 2.7/36 (#22318) * drop 2.7/36 * version * drop 2.7/3.6 --- .../CHANGELOG.md | 2 ++ .../README.md | 6 +++--- .../avroserializer/_apache_avro_serializer.py | 5 +---- .../_schema_registry_avro_serializer.py | 5 +---- .../dev_requirements.txt | 2 +- .../samples/README.md | 2 +- .../setup.cfg | 2 -- .../setup.py | 9 +++------ .../tests/conftest.py | 16 ---------------- .../azure-schemaregistry/CHANGELOG.md | 4 +++- .../azure-schemaregistry/README.md | 6 +++--- .../azure/schemaregistry/_version.py | 2 +- .../azure-schemaregistry/conftest.py | 17 ----------------- .../azure-schemaregistry/dev_requirements.txt | 2 +- .../azure-schemaregistry/samples/README.md | 4 ++-- .../azure-schemaregistry/setup.cfg | 2 -- .../azure-schemaregistry/setup.py | 11 +++-------- shared_requirements.txt | 1 - 18 files changed, 25 insertions(+), 73 deletions(-) delete mode 100644 sdk/schemaregistry/azure-schemaregistry-avroserializer/setup.cfg delete mode 100644 sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/conftest.py delete mode 100644 sdk/schemaregistry/azure-schemaregistry/conftest.py delete mode 100644 sdk/schemaregistry/azure-schemaregistry/setup.cfg diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/CHANGELOG.md b/sdk/schemaregistry/azure-schemaregistry-avroserializer/CHANGELOG.md index 8e660feef295..4248deac163c 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/CHANGELOG.md +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/CHANGELOG.md @@ -2,6 +2,8 @@ ## 1.0.0b5 (Unreleased) +This version and all future versions will require Python 3.7+. Python 2.7 and 3.6 are no longer supported. + ### Features Added ### Breaking Changes diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/README.md b/sdk/schemaregistry/azure-schemaregistry-avroserializer/README.md index 843d5e28bfdb..39e46d2a87aa 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/README.md +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/README.md @@ -8,7 +8,7 @@ Schema Registry schema identifiers and Avro-encoded data. ## _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 @@ -24,7 +24,7 @@ pip install azure-schemaregistry-avroserializer azure-identity To use this package, you must have: * Azure subscription - [Create a free account][azure_sub] * [Azure Schema Registry][schemaregistry_service] -* Python 2.7, 3.6 or later - [Install Python][python] +* Python 3.7 or later - [Install Python][python] ### Authenticate the client Interaction with the Schema Registry Avro Serializer starts with an instance of AvroSerializer class, which takes the schema group name and the [Schema Registry Client][schemaregistry_client] class. The client constructor takes the Event Hubs fully qualified namespace and and Azure Active Directory credential: @@ -38,7 +38,7 @@ Interaction with the Schema Registry Avro Serializer starts with an instance of 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/): ```Bash pip install aiohttp diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_apache_avro_serializer.py b/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_apache_avro_serializer.py index 7f3c07345daf..992ced66062c 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_apache_avro_serializer.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_apache_avro_serializer.py @@ -3,10 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -try: - from functools import lru_cache -except ImportError: - from backports.functools_lru_cache import lru_cache +from functools import lru_cache from typing import BinaryIO, Union, TypeVar from io import BytesIO import avro diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_schema_registry_avro_serializer.py b/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_schema_registry_avro_serializer.py index c1ea6323ea2e..7b3cc8679233 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_schema_registry_avro_serializer.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_schema_registry_avro_serializer.py @@ -23,10 +23,7 @@ # IN THE SOFTWARE. # # -------------------------------------------------------------------------- -try: - from functools import lru_cache -except ImportError: - from backports.functools_lru_cache import lru_cache +from functools import lru_cache from io import BytesIO from typing import Any, Dict, Mapping diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/dev_requirements.txt b/sdk/schemaregistry/azure-schemaregistry-avroserializer/dev_requirements.txt index d53cebff6287..14549f3dbe61 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/dev_requirements.txt +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/dev_requirements.txt @@ -1,4 +1,4 @@ -e ../../../tools/azure-devtools -e ../../../tools/azure-sdk-tools -e ../../identity/azure-identity -aiohttp>=3.0; python_version >= '3.5' \ No newline at end of file +aiohttp>=3.0 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/README.md b/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/README.md index 45d3e1dc7b10..983f5ba1e81b 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/README.md +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/README.md @@ -23,7 +23,7 @@ Several Schema Registry Avro Serializer Python SDK samples are available to you * Receive `EventData` from Event Hubs and deserialize the received bytes. ## Prerequisites -- Python 2.7, 3.6 or later. +- Python 3.7 or later. - **Microsoft Azure Subscription:** To use Azure services, including Azure Schema Registry, 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/schemaregistry/azure-schemaregistry-avroserializer/setup.cfg b/sdk/schemaregistry/azure-schemaregistry-avroserializer/setup.cfg deleted file mode 100644 index 3c6e79cf31da..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -universal=1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/setup.py b/sdk/schemaregistry/azure-schemaregistry-avroserializer/setup.py index 46326ffeb12d..47c87a7e84e3 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/setup.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/setup.py @@ -41,8 +41,7 @@ ] install_packages = [ 'azure-schemaregistry>=1.0.0,<2.0.0', - 'avro==1.10.0', - 'backports.functools-lru-cache >= 1.6.4; python_version == "2.7"' + 'avro==1.10.0' ] setup( @@ -58,16 +57,14 @@ classifiers=[ "Development Status :: 4 - Beta", '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=exclude_packages), install_requires=install_packages diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/conftest.py b/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/conftest.py deleted file mode 100644 index dc548de50415..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/conftest.py +++ /dev/null @@ -1,16 +0,0 @@ -# ------------------------------------------------------------------------ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# ------------------------------------------------------------------------- - -import os -import sys -import uuid - -import pytest - -# Ignore async tests for Python < 3.5 -collect_ignore_glob = [] -if sys.version_info < (3, 5): - collect_ignore_glob.append("*_async.py") diff --git a/sdk/schemaregistry/azure-schemaregistry/CHANGELOG.md b/sdk/schemaregistry/azure-schemaregistry/CHANGELOG.md index 2d5f5e70cb4b..7d9ab8efcdde 100644 --- a/sdk/schemaregistry/azure-schemaregistry/CHANGELOG.md +++ b/sdk/schemaregistry/azure-schemaregistry/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.1 (Unreleased) +## 1.1.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 diff --git a/sdk/schemaregistry/azure-schemaregistry/README.md b/sdk/schemaregistry/azure-schemaregistry/README.md index c7cb2c921f04..59169141dd0f 100644 --- a/sdk/schemaregistry/azure-schemaregistry/README.md +++ b/sdk/schemaregistry/azure-schemaregistry/README.md @@ -8,7 +8,7 @@ schema identifiers rather than full schemas. ## _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 on 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_ ## Getting started @@ -24,7 +24,7 @@ pip install azure-schemaregistry To use this package, you must have: * Azure subscription - [Create a free account][azure_sub] * [Azure Schema Registry][schemaregistry_service] -* Python 2.7, 3.6 or later - [Install Python][python] +* Python 3.7 or later - [Install Python][python] ### Authenticate the client @@ -39,7 +39,7 @@ Interaction with Schema Registry starts with an instance of SchemaRegistryClient 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/): ```Bash pip install aiohttp diff --git a/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_version.py b/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_version.py index 44b53a9ccedf..719057e70880 100644 --- a/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_version.py +++ b/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_version.py @@ -24,4 +24,4 @@ # # -------------------------------------------------------------------------- -VERSION = "1.0.1" +VERSION = "1.1.0" diff --git a/sdk/schemaregistry/azure-schemaregistry/conftest.py b/sdk/schemaregistry/azure-schemaregistry/conftest.py deleted file mode 100644 index 4e4d47319fb6..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry/conftest.py +++ /dev/null @@ -1,17 +0,0 @@ -# ------------------------------------------------------------------------ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# ------------------------------------------------------------------------- - -import os -import sys -import uuid - -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") diff --git a/sdk/schemaregistry/azure-schemaregistry/dev_requirements.txt b/sdk/schemaregistry/azure-schemaregistry/dev_requirements.txt index f15ae1a63a98..2dd5cbcbc02d 100644 --- a/sdk/schemaregistry/azure-schemaregistry/dev_requirements.txt +++ b/sdk/schemaregistry/azure-schemaregistry/dev_requirements.txt @@ -2,4 +2,4 @@ -e ../../../tools/azure-sdk-tools -e ../../core/azure-core -e ../../identity/azure-identity -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/schemaregistry/azure-schemaregistry/samples/README.md b/sdk/schemaregistry/azure-schemaregistry/samples/README.md index c0f23c4b99d2..0c10498d4f0d 100644 --- a/sdk/schemaregistry/azure-schemaregistry/samples/README.md +++ b/sdk/schemaregistry/azure-schemaregistry/samples/README.md @@ -12,7 +12,7 @@ urlFragment: schemaregistry-samples These are code samples that show common scenario operations with the Schema Registry 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. +and require Python 3.7 or later. Several Schema Registry Python SDK samples are available to you in the SDK's GitHub repository. These samples provide example code for additional scenarios commonly encountered while working with Schema Registry: @@ -22,7 +22,7 @@ Several Schema Registry Python SDK samples are available to you in the SDK's Git * Get schema id ## Prerequisites -- Python 2.7, 3.6 or later. +- Python 3.7 or later. - **Microsoft Azure Subscription:** To use Azure services, including Azure Schema Registry, 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/schemaregistry/azure-schemaregistry/setup.cfg b/sdk/schemaregistry/azure-schemaregistry/setup.cfg deleted file mode 100644 index 3c6e79cf31da..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -universal=1 diff --git a/sdk/schemaregistry/azure-schemaregistry/setup.py b/sdk/schemaregistry/azure-schemaregistry/setup.py index f28bf90a2f13..11eaa337cec7 100644 --- a/sdk/schemaregistry/azure-schemaregistry/setup.py +++ b/sdk/schemaregistry/azure-schemaregistry/setup.py @@ -55,23 +55,18 @@ 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=exclude_packages), install_requires=[ 'msrest>=0.6.21', 'azure-core<2.0.0,>=1.20.0' - ], - extras_require={ - ":python_version<'3.0'": ['azure-nspkg'] - } + ] ) diff --git a/shared_requirements.txt b/shared_requirements.txt index c212781ae411..d4ee1afe0c8f 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -129,7 +129,6 @@ isodate>=0.6.0 avro==1.10.0 pyjwt>=1.7.1 chardet<5,>=3.0.2 -backports.functools-lru-cache >= 1.6.4; python_version == "2.7" #override azure-search-documents typing-extensions>=3.7.4.3 #override azure azure-keyvault~=1.0 #override azure-mgmt-core azure-core<2.0.0,>=1.15.0