From aeeb3ceb598a560183d89c93a0bbbf95853b3b6c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 17 Jun 2019 19:40:37 +0000 Subject: [PATCH] Packaging update of azure-storage-blob --- sdk/storage/azure-storage-blob/HISTORY.rst | 9 +++ sdk/storage/azure-storage-blob/MANIFEST.in | 5 +- sdk/storage/azure-storage-blob/README.rst | 33 ++++++++++ .../azure-storage-blob/azure/__init__.py | 2 +- .../azure/storage/__init__.py | 2 +- .../azure-storage-blob/sdk_packaging.toml | 8 +++ sdk/storage/azure-storage-blob/setup.py | 65 +++++++------------ 7 files changed, 80 insertions(+), 44 deletions(-) create mode 100644 sdk/storage/azure-storage-blob/HISTORY.rst create mode 100644 sdk/storage/azure-storage-blob/README.rst create mode 100644 sdk/storage/azure-storage-blob/sdk_packaging.toml diff --git a/sdk/storage/azure-storage-blob/HISTORY.rst b/sdk/storage/azure-storage-blob/HISTORY.rst new file mode 100644 index 00000000000..8924d5d6c44 --- /dev/null +++ b/sdk/storage/azure-storage-blob/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (1970-01-01) +++++++++++++++++++ + +* Initial Release diff --git a/sdk/storage/azure-storage-blob/MANIFEST.in b/sdk/storage/azure-storage-blob/MANIFEST.in index 9babac44ebe..e661bed6a00 100644 --- a/sdk/storage/azure-storage-blob/MANIFEST.in +++ b/sdk/storage/azure-storage-blob/MANIFEST.in @@ -1,4 +1,5 @@ -include *.md +recursive-include tests *.py *.yaml +include *.rst include azure/__init__.py include azure/storage/__init__.py -include LICENSE.txt + diff --git a/sdk/storage/azure-storage-blob/README.rst b/sdk/storage/azure-storage-blob/README.rst new file mode 100644 index 00000000000..e21b69129a0 --- /dev/null +++ b/sdk/storage/azure-storage-blob/README.rst @@ -0,0 +1,33 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure MyService Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Usage +===== + +For code examples, see `MyService Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-storage-blob%2FREADME.png diff --git a/sdk/storage/azure-storage-blob/azure/__init__.py b/sdk/storage/azure-storage-blob/azure/__init__.py index 59cb7014657..0260537a02b 100644 --- a/sdk/storage/azure-storage-blob/azure/__init__.py +++ b/sdk/storage/azure-storage-blob/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/azure/storage/__init__.py b/sdk/storage/azure-storage-blob/azure/storage/__init__.py index 59cb7014657..0260537a02b 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/__init__.py +++ b/sdk/storage/azure-storage-blob/azure/storage/__init__.py @@ -1 +1 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/sdk_packaging.toml b/sdk/storage/azure-storage-blob/sdk_packaging.toml new file mode 100644 index 00000000000..ff4f8661cff --- /dev/null +++ b/sdk/storage/azure-storage-blob/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-storage-blob" +package_nspkg = "azure-storage-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/sdk/storage/azure-storage-blob/setup.py b/sdk/storage/azure-storage-blob/setup.py index 213c1b1386b..0eab3124edf 100644 --- a/sdk/storage/azure-storage-blob/setup.py +++ b/sdk/storage/azure-storage-blob/setup.py @@ -1,31 +1,29 @@ #!/usr/bin/env python -# ------------------------------------------------------------------------- +#------------------------------------------------------------------------- # 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 re - -from setuptools import setup, find_packages - +import os.path +from io import open +from setuptools import find_packages, setup # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-storage-blob" -PACKAGE_PPRINT_NAME = "Azure Blob Storage" +PACKAGE_PPRINT_NAME = "MyService Management" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') - +# 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( @@ -37,46 +35,35 @@ except ImportError: pass -# azure-storage v0.36.0 and prior are not compatible with this package -try: - import azure.storage - - try: - ver = azure.storage.__version__ - raise Exception( - 'This package is incompatible with azure-storage=={}. '.format(ver) + - ' Uninstall it with "pip uninstall azure-storage".' - ) - except AttributeError: - pass -except ImportError: - pass - # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, '__init__.py'), 'r') as fd: - version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) if not version: raise RuntimeError('Cannot find version information') +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + setup( name=PACKAGE_NAME, version=version, - description='Microsoft {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), - long_description=open('README.md', 'r').read(), - long_description_content_type='text/markdown', + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', - author_email='ascl@microsoft.com', - url='https://github.com/Azure/azure-storage-python', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', 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.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', @@ -85,19 +72,17 @@ ], zip_safe=False, packages=find_packages(exclude=[ + 'tests', # Exclude packages that will be covered by PEP420 or nspkg 'azure', 'azure.storage', - 'tests', - 'tests.blob', - 'tests.common' ]), install_requires=[ - #'azure-core~=0.0.1', + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], extras_require={ - ":python_version<'3.0'": ['futures'], - ":python_version<'3.4'": ['enum34>=1.0.4'], - }, + ":python_version<'3.0'": ['azure-storage-nspkg'], + } )