Skip to content

Commit

Permalink
azdev initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
microsoftopensource authored and tjprescott committed Nov 21, 2018
1 parent 784fedf commit 744d6aa
Show file tree
Hide file tree
Showing 48 changed files with 3,101 additions and 103 deletions.
110 changes: 7 additions & 103 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,104 +1,8 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.vs/
src/aztool.egg-info/
src/aztool/__pycache__/__init__.cpython-36.pyc
src/aztool/__pycache__/
src/azdev.egg-info/*
*.pyc
.vscode/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Microsoft Corporation. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# azdev
Knack-based devtools for AzureCLI
69 changes: 69 additions & 0 deletions azdev.pyproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6285073d-e427-48c1-9783-abddf33fa22c}</ProjectGuid>
<ProjectHome />
<StartupFile>src\azdev\__init__.py</StartupFile>
<SearchPath />
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<ProjectTypeGuids>{888888a0-9f3d-457c-b088-3a5042f75d52}</ProjectTypeGuids>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<InterpreterId>MSBuild|env|$(MSBuildProjectFullPath)</InterpreterId>
<CommandLineArguments>test -h</CommandLineArguments>
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'" />
<PropertyGroup Condition="'$(Configuration)' == 'Release'" />
<PropertyGroup>
<VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="src\azdev\commands.py" />
<Compile Include="src\azdev\custom.py" />
<Compile Include="src\azdev\help.py" />
<Compile Include="src\azdev\params.py" />
<Compile Include="src\azdev\utilities\const.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="src\azdev\utilities\display.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="src\azdev\utilities\command.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="src\azdev\utilities\path.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="src\azdev\utilities\pypi.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="src\azdev\utilities\__init__.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="src\azdev\validators.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="src\azdev\__init__.py" />
<Compile Include="src\setup.py" />
</ItemGroup>
<ItemGroup>
<Folder Include="src" />
<Folder Include="src\azdev\" />
<Folder Include="src\azdev\utilities\" />
</ItemGroup>
<ItemGroup>
<Interpreter Include="env\">
<Id>env</Id>
<Version>3.6</Version>
<Description>env (Python 3.6 (32-bit))</Description>
<InterpreterPath>Scripts\python.exe</InterpreterPath>
<WindowsInterpreterPath>Scripts\pythonw.exe</WindowsInterpreterPath>
<PathEnvironmentVariable>PYTHONPATH</PathEnvironmentVariable>
<Architecture>X86</Architecture>
</Interpreter>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
</Project>
23 changes: 23 additions & 0 deletions azdev.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2016
MinimumVisualStudioVersion = 10.0.40219.1
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "azdev", "azdev.pyproj", "{6285073D-E427-48C1-9783-ABDDF33FA22C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6285073D-E427-48C1-9783-ABDDF33FA22C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6285073D-E427-48C1-9783-ABDDF33FA22C}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B538A664-C4F4-40F0-9BE6-321562C2AA09}
EndGlobalSection
EndGlobal
41 changes: 41 additions & 0 deletions src/azdev/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -----------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -----------------------------------------------------------------------------

from __future__ import print_function
import sys

from knack import CLI, CLICommandsLoader

from azdev.help import helps
from azdev.utilities import get_azdev_config_dir


__VERSION__ = "0.1.0"


class AzDevCli(CLI):
def get_cli_version(self):
return __VERSION__


class AzDevCommandsLoader(CLICommandsLoader):
def load_command_table(self, args):
from azdev.commands import load_command_table

load_command_table(self, args)
return super(AzDevCommandsLoader, self).load_command_table(args)

def load_arguments(self, command):
from azdev.params import load_arguments

load_arguments(self, command)
super(AzDevCommandsLoader, self).load_arguments(command)


azdev = AzDevCli(cli_name='azdev', commands_loader_cls=AzDevCommandsLoader,
config_dir=get_azdev_config_dir())
exit_code = azdev.invoke(sys.argv[1:])
sys.exit(exit_code)
62 changes: 62 additions & 0 deletions src/azdev/commands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# -----------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -----------------------------------------------------------------------------

from knack.commands import CommandGroup


def load_command_table(self, args):

def operation_group(name):
return 'azdev.operations.{}#{{}}'.format(name)

# TODO: Experimental - can remove
# with CommandGroup(self, 'github', operation_group('github')) as g:
# g.command('list-issues', 'list_issues')
# g.command('diff', 'show_diff')

with CommandGroup(self, '', operation_group('setup')) as g:
g.command('setup', 'setup')

# TODO: enhance with tox support
with CommandGroup(self, '', operation_group('tests')) as g:
g.command('test', 'run_tests')

with CommandGroup(self, '', operation_group('style')) as g:
g.command('style', 'check_style')

with CommandGroup(self, '', operation_group('linter')) as g:
g.command('linter', 'run_linter')

with CommandGroup(self, 'verify', operation_group('pypi')) as g:
g.command('history', 'check_history')
g.command('version', 'check_versions')

with CommandGroup(self, 'verify', operation_group('help')) as g:
g.command('document-map', 'check_document_map')

with CommandGroup(self, 'verify', operation_group('legal')) as g:
g.command('license', 'check_license_headers')

with CommandGroup(self, 'perf', operation_group('performance')) as g:
g.command('load-times', 'check_load_time')

with CommandGroup(self, 'sdk', operation_group('python_sdk')) as g:
g.command('draft', 'install_draft_sdk')

# TODO: implement
# with CommandGroup(self, operation_group('help')) as g:
# g.command('generate', 'generate_help_xml')
# g.command('convert', 'convert_help_to_yaml')

# TODO: implement
# with CommandGroup(self, 'coverage', command_path) as g:
# g.command('command', 'command_coverage')
# g.command('code', 'code_coverage')

# TODO: implement
# with CommandGroup(self, 'verify', command_path) as g:
# g.command('package', 'verify_packages')
# g.command('dependencies', 'verify_dependencies')
18 changes: 18 additions & 0 deletions src/azdev/config/cli.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[flake8]
max-line-length = 120
max-complexity = 10
ignore =
E501, # line too long, it is covered by pylint
E722, # bare except, bad practice, to be removed in the future
F401, # imported but unused, too many violations, to be removed in the future
F811, # redefinition of unused, to be removed in the future
C901 # code flow is too complex, too many violations, to be removed in the future
W504 # line break after binary operator effect on readability is subjective
exclude =
azure_bdist_wheel.py
build
tools
scripts
doc
build_scripts
*/grammar/
Loading

0 comments on commit 744d6aa

Please sign in to comment.