Skip to content

Commit

Permalink
[mgmt]Update setup.py template for python3 only (#22235)
Browse files Browse the repository at this point in the history
* Update setup.py

* Update swagger_to_sdk_config_autorest.json

* Update README.md

* Delete setup.cfg

* Update setup.py
  • Loading branch information
msyyc authored Jan 5, 2022
1 parent fc68d7b commit 2407a89
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 26 deletions.
3 changes: 2 additions & 1 deletion swagger_to_sdk_config_autorest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"python-mode": "update",
"sdkrel:python-sdks-folder": "./sdk/.",
"multiapi": "",
"track2": ""
"track2": "",
"python3-only": ""
},
"advanced_options": {
"create_sdk_pull_requests": true,
Expand Down
5 changes: 4 additions & 1 deletion tools/azure-sdk-tools/packaging_tools/templates/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Microsoft Azure SDK for Python

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

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

# Usage

Expand Down
2 changes: 0 additions & 2 deletions tools/azure-sdk-tools/packaging_tools/templates/setup.cfg

This file was deleted.

25 changes: 3 additions & 22 deletions tools/azure-sdk-tools/packaging_tools/templates/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
if os.path.exists(os.path.join(package_folder_path, 'version.py'))
Expand Down Expand Up @@ -63,10 +48,8 @@
classifiers=[
'{{classifier}}',
'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',
Expand All @@ -91,10 +74,8 @@
'azure-core>=1.6.0,<2.0.0',
{%- endif %}
{%- if need_azuremgmtcore %}
'azure-mgmt-core>=1.2.0,<2.0.0',
'azure-mgmt-core>=1.3.0,<2.0.0',
{%- endif %}
],
extras_require={
":python_version<'3.0'": ['{{package_nspkg}}'],
}
python_requires=">=3.7"
)

0 comments on commit 2407a89

Please sign in to comment.