Skip to content

Commit

Permalink
Packaging update of azure-storage-blob
Browse files Browse the repository at this point in the history
  • Loading branch information
AutorestCI committed Jun 18, 2019
1 parent 8d9a862 commit 66d6877
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 44 deletions.
9 changes: 9 additions & 0 deletions sdk/storage/azure-storage-blob/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. :changelog:
Release History
===============

0.1.0 (1970-01-01)
++++++++++++++++++

* Initial Release
5 changes: 3 additions & 2 deletions sdk/storage/azure-storage-blob/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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

33 changes: 33 additions & 0 deletions sdk/storage/azure-storage-blob/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.

For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


Usage
=====

For code examples, see `MyService Management
<https://docs.microsoft.com/python/api/overview/azure/>`__
on docs.microsoft.com.


Provide Feedback
================

If you encounter any bugs or have suggestions, please file an issue in the
`Issues <https://github.com/Azure/azure-sdk-for-python/issues>`__
section of the project.


.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-storage-blob%2FREADME.png
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-blob/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-blob/azure/storage/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
8 changes: 8 additions & 0 deletions sdk/storage/azure-storage-blob/sdk_packaging.toml
Original file line number Diff line number Diff line change
@@ -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
65 changes: 25 additions & 40 deletions sdk/storage/azure-storage-blob/setup.py
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -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',
Expand All @@ -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'],
}
)

0 comments on commit 66d6877

Please sign in to comment.