Skip to content

Commit 2407a89

Browse files
authored
[mgmt]Update setup.py template for python3 only (#22235)
* Update setup.py * Update swagger_to_sdk_config_autorest.json * Update README.md * Delete setup.cfg * Update setup.py
1 parent fc68d7b commit 2407a89

File tree

4 files changed

+9
-26
lines changed

4 files changed

+9
-26
lines changed

swagger_to_sdk_config_autorest.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"python-mode": "update",
88
"sdkrel:python-sdks-folder": "./sdk/.",
99
"multiapi": "",
10-
"track2": ""
10+
"track2": "",
11+
"python3-only": ""
1112
},
1213
"advanced_options": {
1314
"create_sdk_pull_requests": true,

tools/azure-sdk-tools/packaging_tools/templates/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure {{package_pprint_name}} Client Library.
4-
This package has been tested with Python 2.7, 3.6+.
4+
This package has been tested with Python 3.7+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

7+
## _Disclaimer_
8+
9+
_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_
710

811
# Usage
912

tools/azure-sdk-tools/packaging_tools/templates/setup.cfg

-2
This file was deleted.

tools/azure-sdk-tools/packaging_tools/templates/setup.py

+3-22
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')
4025
if os.path.exists(os.path.join(package_folder_path, 'version.py'))
@@ -63,10 +48,8 @@
6348
classifiers=[
6449
'{{classifier}}',
6550
'Programming Language :: Python',
66-
'Programming Language :: Python :: 2',
67-
'Programming Language :: Python :: 2.7',
51+
"Programming Language :: Python :: 3 :: Only",
6852
'Programming Language :: Python :: 3',
69-
'Programming Language :: Python :: 3.6',
7053
'Programming Language :: Python :: 3.7',
7154
'Programming Language :: Python :: 3.8',
7255
'Programming Language :: Python :: 3.9',
@@ -91,10 +74,8 @@
9174
'azure-core>=1.6.0,<2.0.0',
9275
{%- endif %}
9376
{%- if need_azuremgmtcore %}
94-
'azure-mgmt-core>=1.2.0,<2.0.0',
77+
'azure-mgmt-core>=1.3.0,<2.0.0',
9578
{%- endif %}
9679
],
97-
extras_require={
98-
":python_version<'3.0'": ['{{package_nspkg}}'],
99-
}
80+
python_requires=">=3.7"
10081
)

0 commit comments

Comments
 (0)