Skip to content

Commit

Permalink
[ACR] Change to support python3.6 or above only (#22325)
Browse files Browse the repository at this point in the history
  • Loading branch information
YalinLi0312 authored Jan 15, 2022
1 parent c9dce46 commit 57b7aac
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 30 deletions.
7 changes: 6 additions & 1 deletion sdk/containerregistry/azure-containerregistry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Use the client library for Azure Container Registry to:

[Source code][source] | [Package (Pypi)][package] | [API reference documentation][docs] | [REST API documentation][rest_docs] | [Product documentation][product_docs]

## _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

### Install the package
Expand All @@ -23,7 +27,8 @@ pip install --pre azure-containerregistry

### Prerequisites

You need an [Azure subscription][azure_sub] and a [Container Registry account][container_registry_docs] to use this package.
* Python 3.6 or later is required to use this package.
* You need an [Azure subscription][azure_sub] and a [Container Registry account][container_registry_docs] to use this package.

To create a new Container Registry, you can use the [Azure Portal][container_registry_create_portal],
[Azure PowerShell][container_registry_create_ps], or the [Azure CLI][container_registry_create_cli].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@ def extract_data(pipeline_response):
link = None
if "Link" in pipeline_response.http_response.headers.keys():
link = _parse_next_link(pipeline_response.http_response.headers["Link"])
elif "link" in pipeline_response.http_response.headers.keys(): # python 2.7 turns this into lowercase
link = _parse_next_link(pipeline_response.http_response.headers["link"])
return link, iter(list_of_elem)

def get_next(next_link=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
-e ../../../tools/azure-devtools
../../core/azure-core
../azure-mgmt-containerregistry
aiohttp>=3.0; python_version >= '3.5'
aiohttp>=3.0; python_version >= '3.6'
azure-identity
msrestazure>=0.4.11
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The async versions of the samples require Python 3.6 or later.
|[sample_list_tags.py][list_tags] and [sample_list_tags_async.py][list_tags_async] | List tags on an image using an anonymous access |

### 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.
* You need an [Azure subscription][azure_sub] and a [Container Registry account][container_registry_docs] to use this package.

## Setup
Expand All @@ -48,10 +48,9 @@ Check out the [API reference documentation][rest_docs] to learn more about what


<!-- LINKS -->
[azure_sub]: https://azure.microsoft.com/free/
[rest_docs]: https://docs.microsoft.com/rest/api/containerregistry/

[container_registry_docs]: https://docs.microsoft.com/azure/container-registry/container-registry-intro

[hello_world]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/containerregistry/azure-containerregistry/samples/sample_hello_world.py
[hello_world_async]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_hello_world_async.py
[delete_tags]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/containerregistry/azure-containerregistry/samples/sample_delete_tags.py
Expand Down
2 changes: 0 additions & 2 deletions sdk/containerregistry/azure-containerregistry/setup.cfg

This file was deleted.

16 changes: 4 additions & 12 deletions sdk/containerregistry/azure-containerregistry/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
from io import open
import re

# example setup.py Feel free to copy the entire "azure-template" folder into a package folder named
# with "azure-<yourpackagename>". Ensure that the below arguments to setup() are updated to reflect
# 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

# Change the PACKAGE_NAME only to change folder and different name
PACKAGE_NAME = "azure-containerregistry"
PACKAGE_PPRINT_NAME = "Azure Container Registry"

Expand Down Expand Up @@ -43,13 +37,13 @@
classifiers=[
"Development Status :: 4 - Beta",
"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",
"Programming Language :: Python :: 3.10",
"License :: OSI Approved :: MIT License",
],
packages=find_packages(
Expand All @@ -59,13 +53,11 @@
"azure",
]
),
python_requires=">=3.6",
install_requires=[
"azure-core>=1.20.0,<2.0.0",
"msrest>=0.6.21",
],
extras_require={
# ":python_version<'3.0'": ["azure-nspkg"],
},
project_urls={
"Bug Reports": "https://github.com/Azure/azure-sdk-for-python/issues",
"Source": "https://github.com/Azure/azure-sdk-python",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,8 @@
# license information.
# --------------------------------------------------------------------------

import sys

# Fixture
from testcase import load_registry

# Ignore async tests for Python < 3.5
collect_ignore_glob = []
if sys.version_info < (3, 5):
collect_ignore_glob.append("*_async.py")


def pytest_configure(config):
config.addinivalue_line("usefixtures", "load_registry")
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

In order to run the performance tests, the `azure-devtools` package must be installed. This is done as part of the
`dev_requirements` install. Start by creating a new virtual environment for your perf tests. This will need to be a
Python 3 environment, preferably >=3.7.
Python 3 environment, preferably >=3.6.

### Setup for test resources

Expand Down

0 comments on commit 57b7aac

Please sign in to comment.