Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the automation code #1660

Merged
merged 2 commits into from
Jan 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ adal==0.4.3
applicationinsights==0.10.0
argcomplete==1.3.0
colorama==0.3.7
coverage==4.2
jmespath
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing this dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is moved to automation package's setup.py.

mock==1.3.0
nose==1.3.7
Expand Down
29 changes: 29 additions & 0 deletions scripts/automation/style/pep8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------


def fix_p2p8(directory):
import autopep8
import multiprocessing

autopep8.fix_multiple_files([directory],
options=autopep8._get_options(
{
'jobs': multiprocessing.cpu_count(),
'verbose': True,
'recursive': True,
'in_place': True,
'max_line_length': 100
}, False))


if __name__ == '__main__':
import sys

if len(sys.argv) < 2:
print('usage: python automation.style.pep8 <directory>')
sys.exit(1)

fix_p2p8(sys.argv[1])
4 changes: 4 additions & 0 deletions scripts/dev_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..'))


def exec_command(command):
try:
print('Executing: ' + command)
Expand All @@ -28,6 +29,9 @@ def exec_command(command):
# install general requirements
exec_command('pip install -r requirements.txt')

# install automation package
exec_command('pip install -e ./scripts')

# command modules have dependency on azure-cli-core so install this first
exec_command('pip install -e src/azure-cli-nspkg')
exec_command('pip install -e src/azure-cli-core')
Expand Down
1 change: 0 additions & 1 deletion scripts/run_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

export PYTHONPATH=${PYTHONPATH}:$(cd $(dirname $0); pwd)
python -m automation.coverage.run
1 change: 0 additions & 1 deletion scripts/run_pylint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

export PYTHONPATH=${PYTHONPATH}:$(cd $(dirname $0); pwd)
python -m automation.style.run
1 change: 0 additions & 1 deletion scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

export PYTHONPATH=${PYTHONPATH}:$(cd $(dirname $0); pwd)
python -m automation.tests.run
50 changes: 50 additions & 0 deletions scripts/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/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.
# --------------------------------------------------------------------------------------------

from setuptools import setup

VERSION = "0.1.0"

CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'License :: OSI Approved :: MIT License',
]

DEPENDENCIES = [
'autopep8==1.2.4',
'coverage==4.2',
'pycodestyle==2.2.0'
]

setup(
name='automation',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, please change name as even though we won't be releasing this package, it conflicts with https://pypi.python.org/pypi/automation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix this right now.

version=VERSION,
description='Microsoft Azure Command-Line Tools - Automation Utility',
long_description='',
license='MIT',
author='Microsoft Corporation',
author_email='azpycli@microsoft.com',
url='https://github.com/Azure/azure-cli',
namespace_packages=[
],
packages=[
'automation',
'automation.style',
'automation.tests',
'automation.setup',
'automation.coverage'
],
install_requires=DEPENDENCIES
)