Skip to content

Commit

Permalink
Reorganize the code into multiple pypi packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
huguesv committed Jun 15, 2015
1 parent 9120bec commit 721588a
Show file tree
Hide file tree
Showing 123 changed files with 5,295 additions and 320 deletions.
15 changes: 8 additions & 7 deletions .gitignore
Expand Up @@ -6,17 +6,18 @@ __pycache__/
.ptvs/

# Build results
/bin/
/obj/
/dist/
/MANIFEST
bin/
obj/
dist/
MANIFEST

# Result of running python setup.py install/pip install -e
/build/
/azure.egg-info/
RECORD.txt
build/
*.egg-info/

# Test results
/TestResults/
TestResults/

# User-specific files
*.suo
Expand Down
14 changes: 14 additions & 0 deletions ChangeLog.txt
@@ -1,3 +1,17 @@
XXX-XX-XX Version X.Y.Z

The following classes have moved from azure to azure.common:
WindowsAzureError
WindowsAzureConflictError
WindowsAzureMissingResourceError
WindowsAzureBatchOperationError
WindowsAzureAsyncOperationError

when we switch to requests for storage:
- filters



2015-05-13 Version 0.11.0

IMPORTANT CHANGE THAT AFFECTS STORAGE:
Expand Down
13 changes: 13 additions & 0 deletions HOWTO.txt
@@ -0,0 +1,13 @@
TODO: Explain folder structure, how to build, etc.

Some Gotchas
------------

We put an azure/__init__.py in every package even though we don't want to distribute one.
This is so that PTVS can analyze the package and provide IntelliSense when developing the tests.
Add an exclude in MANIFEST.in so that the azure/__init__.py doesn't get included from the source distribution when 'python.exe setup.py sdist'.
Note that 'python.exe setup.py bdist_wheel' will ignore the exclusion and you'll have an azure/__init__.py in your .whl.
To get around that, build the wheel from the source distribution with 'pip.exe wheel <source>.zip'.
Add every top package folder to the search path for PTVS analysis and running tests.
Make sure to save setup.py as UTF-8 WITHOUT BOM, otherwise you'll get an error with no details: 'Failed building wheel for X'.
https://bitbucket.org/pypa/wheel/issue/99/cannot-exclude-directory
4 changes: 4 additions & 0 deletions azure-_core/README.rst
@@ -0,0 +1,4 @@
Microsoft Azure SDK for Python
==============================

This is the Microsoft Azure Management core.
1 change: 1 addition & 0 deletions azure-_core/azure/__init__.py
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
6 changes: 6 additions & 0 deletions azure-_core/setup.cfg
@@ -0,0 +1,6 @@
[bdist_wheel]
universal=1

[install]
single-version-externally-managed=1
record=RECORD.txt
43 changes: 43 additions & 0 deletions azure-_core/setup.py
@@ -0,0 +1,43 @@
#!/usr/bin/env python

#-------------------------------------------------------------------------
# Copyright (c) Microsoft. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#--------------------------------------------------------------------------

from setuptools import setup

setup(
name='azure-_core',
version='0.20.0',
description='Microsoft Azure Core Client Library for Python [Internal]',
long_description=open('README.rst', 'r').read(),
license='Apache License 2.0',
author='Microsoft Corporation',
author_email='ptvshelp@microsoft.com',
url='https://github.com/Azure/azure-sdk-for-python',
classifiers=[
'Development Status :: 3 - Alpha',
'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',
'License :: OSI Approved :: Apache Software License',
],
zip_safe=False,
packages=[
'azure',
],
)
2 changes: 2 additions & 0 deletions azure-common/MANIFEST.in
@@ -0,0 +1,2 @@
include *.rst
exclude azure/__init__.py
4 changes: 4 additions & 0 deletions azure-common/README.rst
@@ -0,0 +1,4 @@
Microsoft Azure SDK for Python
==============================

This is the Microsoft Azure common code.
1 change: 1 addition & 0 deletions azure-common/azure/__init__.py
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
63 changes: 63 additions & 0 deletions azure-common/azure/common/__init__.py
@@ -0,0 +1,63 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#--------------------------------------------------------------------------

__author__ = 'Microsoft Corp. <ptvshelp@microsoft.com>'
__version__ = '0.20.0'


# TODO: Rename and merge with the new exception classes used by ARM

class WindowsAzureError(Exception):

''' WindowsAzure Exception base class. '''

def __init__(self, message):
super(WindowsAzureError, self).__init__(message)


class WindowsAzureConflictError(WindowsAzureError):

'''Indicates that the resource could not be created because it already
exists'''

def __init__(self, message):
super(WindowsAzureConflictError, self).__init__(message)


class WindowsAzureMissingResourceError(WindowsAzureError):

'''Indicates that a request for a request for a resource (queue, table,
container, etc...) failed because the specified resource does not exist'''

def __init__(self, message):
super(WindowsAzureMissingResourceError, self).__init__(message)


class WindowsAzureBatchOperationError(WindowsAzureError):

'''Indicates that a batch operation failed'''

def __init__(self, message, code):
super(WindowsAzureBatchOperationError, self).__init__(message)
self.code = code


class WindowsAzureAsyncOperationError(WindowsAzureError):

'''Indicates that an async operation failed'''

def __init__(self, message, result):
super(WindowsAzureAsyncOperationError, self).__init__(message)
self.result = result
6 changes: 6 additions & 0 deletions azure-common/setup.cfg
@@ -0,0 +1,6 @@
[bdist_wheel]
universal=1

[install]
single-version-externally-managed=1
record=RECORD.txt
47 changes: 47 additions & 0 deletions azure-common/setup.py
@@ -0,0 +1,47 @@
#!/usr/bin/env python

#-------------------------------------------------------------------------
# Copyright (c) Microsoft. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#--------------------------------------------------------------------------

from setuptools import setup

setup(
name='azure-common',
version='0.20.0',
description='Microsoft Azure Client Library for Python (Common)',
long_description=open('README.rst', 'r').read(),
license='Apache License 2.0',
author='Microsoft Corporation',
author_email='ptvshelp@microsoft.com',
url='https://github.com/Azure/azure-sdk-for-python',
classifiers=[
'Development Status :: 3 - Alpha',
'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',
'License :: OSI Approved :: Apache Software License',
],
zip_safe=False,
packages=[
'azure',
'azure.common',
],
install_requires=[
'azure-_core==0.20.0',
],
)
2 changes: 2 additions & 0 deletions azure-mgmt-_core/MANIFEST.in
@@ -0,0 +1,2 @@
include *.rst
exclude azure/__init__.py
4 changes: 4 additions & 0 deletions azure-mgmt-_core/README.rst
@@ -0,0 +1,4 @@
Microsoft Azure SDK for Python
==============================

This is the Microsoft Azure Management core.
1 change: 1 addition & 0 deletions azure-mgmt-_core/azure/__init__.py
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
1 change: 1 addition & 0 deletions azure-mgmt-_core/azure/mgmt/__init__.py
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
6 changes: 6 additions & 0 deletions azure-mgmt-_core/setup.cfg
@@ -0,0 +1,6 @@
[bdist_wheel]
universal=1

[install]
single-version-externally-managed=1
record=RECORD.txt
47 changes: 47 additions & 0 deletions azure-mgmt-_core/setup.py
@@ -0,0 +1,47 @@
#!/usr/bin/env python

#-------------------------------------------------------------------------
# Copyright (c) Microsoft. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#--------------------------------------------------------------------------

from setuptools import setup

setup(
name='azure-mgmt-_core',
version='0.20.0',
description='Microsoft Azure Resource Management Core Client Library for Python [Internal]',
long_description=open('README.rst', 'r').read(),
license='Apache License 2.0',
author='Microsoft Corporation',
author_email='ptvshelp@microsoft.com',
url='https://github.com/Azure/azure-sdk-for-python',
classifiers=[
'Development Status :: 3 - Alpha',
'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',
'License :: OSI Approved :: Apache Software License',
],
zip_safe=False,
packages=[
'azure',
'azure.mgmt',
],
install_requires=[
'azure-_core==0.20.0',
],
)
3 changes: 3 additions & 0 deletions azure-mgmt-compute/MANIFEST.in
@@ -0,0 +1,3 @@
include *.rst
exclude azure/__init__.py
exclude azure/mgmt/__init__.py
4 changes: 4 additions & 0 deletions azure-mgmt-compute/README.rst
@@ -0,0 +1,4 @@
Microsoft Azure SDK for Python
==============================

This is the Microsoft Azure Compute Resource Management Client Library.
1 change: 1 addition & 0 deletions azure-mgmt-compute/azure/__init__.py
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
1 change: 1 addition & 0 deletions azure-mgmt-compute/azure/mgmt/__init__.py
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
22 changes: 22 additions & 0 deletions azure-mgmt-compute/azure/mgmt/compute/__init__.py
@@ -0,0 +1,22 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#--------------------------------------------------------------------------

__author__ = 'Microsoft Corp. <ptvshelp@microsoft.com>'
__version__ = '0.20.0'

# TODO: Replace with real implementation
class ComputeManagementClient(object):
def name(self):
return 'ComputeManagementClient'
6 changes: 6 additions & 0 deletions azure-mgmt-compute/setup.cfg
@@ -0,0 +1,6 @@
[bdist_wheel]
universal=1

[install]
single-version-externally-managed=1
record=RECORD.txt

0 comments on commit 721588a

Please sign in to comment.