Skip to content

Commit eff520c

Browse files
committed
Create all component packages
1 parent e309d4e commit eff520c

File tree

62 files changed

+724
-50
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+724
-50
lines changed

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
include *.rst
2-
exclude src/azure/__init__.py

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
applicationinsights==0.10.0
22
azure==2.0.0rc1
33
jmespath
4+
pip
45
mock==1.3.0
56
pylint==1.5.4
67
six==1.10.0

setup.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from codecs import open
2020
from setuptools import setup
2121

22-
VERSION = '0.0.1'
22+
VERSION = '0.0.3.dev0'
2323

2424
# If we have source, validate that our version numbers match
2525
# This should prevent uploading releases with mismatched versions.
@@ -56,10 +56,12 @@
5656

5757
DEPENDENCIES = [
5858
'applicationinsights',
59-
'azure==2.0.0rc1',
59+
'msrest',
6060
'six',
6161
'jmespath',
62-
'adal==0.2.0' #from internal index server.
62+
'pip',
63+
# 'azure-cli-components==0.0.3.dev0',
64+
# 'azure-cli-login==0.0.3.dev0',
6365
]
6466

6567
with open('README.rst', 'r', encoding='utf-8') as f:
@@ -82,10 +84,17 @@
8284
],
8385
package_dir = {'':'src'},
8486
packages=[
87+
'azure',
8588
'azure.cli',
8689
'azure.cli.commands',
90+
'azure.cli.command_modules',
8791
'azure.cli.extensions',
8892
],
8993
package_data={'azure.cli': ['locale/**/*.txt']},
9094
install_requires=DEPENDENCIES,
95+
extras_require={
96+
':python_version < "3.4"': [
97+
'enum34',
98+
],
99+
},
91100
)

src/azure/cli/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
__import__('pkg_resources').declare_namespace(__name__)
12
'''The Azure Command-line tool.
23
34
This tools provides a command-line interface to Azure's management and storage
45
APIs.
56
'''
67

78
__author__ = "Microsoft Corporation <[email protected]>"
8-
__version__ = "0.0.1"
9+
__version__ = "0.0.3.dev0"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__import__('pkg_resources').declare_namespace(__name__)

src/azure/cli/commands/__init__.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
from .._argparse import IncorrectUsageError
1+
from pip import get_installed_distributions
2+
3+
from .._argparse import IncorrectUsageError
24
from .._logging import logger
35

4-
# TODO: Alternatively, simply scan the directory for all modules
5-
COMMAND_MODULES = [
6-
'account',
7-
'login',
8-
'logout',
9-
'network',
10-
'resource',
11-
'storage',
12-
'vm',
13-
]
6+
# Find our command modules, they start with 'azure-cli-'
7+
INSTALLED_COMMAND_MODULES = [dist.key.replace('azure-cli-', '') for dist in get_installed_distributions(local_only=False) if dist.key.startswith('azure-cli-')]
148

159
_COMMANDS = {}
1610

@@ -48,15 +42,16 @@ def add_to_parser(parser, command_name=None):
4842
loaded = False
4943
if command_name:
5044
try:
51-
__import__('azure.cli.commands.' + command_name)
45+
# Try and load the installed command module
46+
__import__('azure.cli.command_modules.'+command_name)
5247
loaded = True
5348
except ImportError:
54-
# Unknown command - we'll load all below
49+
# Unknown command - we'll load all installed modules below
5550
pass
5651

5752
if not loaded:
58-
for mod in COMMAND_MODULES:
59-
__import__('azure.cli.commands.' + mod)
53+
for installed_mods in INSTALLED_COMMAND_MODULES:
54+
__import__('azure.cli.command_modules.'+installed_mods)
6055
loaded = True
6156

6257
for handler, info in _COMMANDS.items():
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Microsoft Azure CLI 'account' Command Module
2+
==================================
3+
4+
This package is for the 'account' module.
5+
i.e. 'az account'
6+
7+
This package has [not] been tested [much] with Python 2.7, 3.4 and 3.5.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__import__('pkg_resources').declare_namespace(__name__)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__import__('pkg_resources').declare_namespace(__name__)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__import__('pkg_resources').declare_namespace(__name__)

0 commit comments

Comments
 (0)