moving VSTS CLI to Az Dev CLI extension

This commit is contained in:
Gaurav Saral 2018-09-27 14:23:55 +05:30
Родитель d212e2068b
Коммит 852569e3e5
173 изменённых файлов: 913 добавлений и 2717 удалений

3
.gitignore поставляемый
Просмотреть файл

@ -295,3 +295,6 @@ paket-files/
*.btm.cs
*.odx.cs
*.xsd.cs
#pytest
.pytest_cache/

2
.vscode/settings.json поставляемый
Просмотреть файл

@ -5,5 +5,5 @@
"**/*__pycache__": true,
"**/*.egg-info": true
},
"python.pythonPath": "${workspaceRoot}/env/Scripts/python"
"python.pythonPath": "C:\\Users\\gsaral\\AppData\\Local\\Programs\\Python\\Python37-32\\python.exe"
}

Просмотреть файл

@ -1,11 +1,16 @@
[![Visual Studio Team services](https://mseng.visualstudio.com/_apis/public/build/definitions/698eacea-9ea2-4eb8-80a4-d06170edf6bc/5908/badge)](https://mseng.visualstudio.com/vsts-cli/_build/index?context=mine&path=%5C&definitionId=6169&_a=completed)
Windows: [![Build Status](https://dev.azure.com/AzureDevOpsCliOrg/AzureDevOpsCli/_apis/build/status/Master%20Branch%20-%20Windows)](https://dev.azure.com/AzureDevOpsCliOrg/AzureDevOpsCli/_build/latest?definitionId=6)
Mac: [![Build Status](https://dev.azure.com/AzureDevOpsCliOrg/AzureDevOpsCli/_apis/build/status/Master%20Branch%20-%20Mac)](https://dev.azure.com/AzureDevOpsCliOrg/AzureDevOpsCli/_build/latest?definitionId=7)
Ubuntu: [![Build Status](https://dev.azure.com/AzureDevOpsCliOrg/AzureDevOpsCli/_apis/build/status/Master%20Branch%20-%20Ubuntu)](https://dev.azure.com/AzureDevOpsCliOrg/AzureDevOpsCli/_build/latest?definitionId=5)
[![Python](https://img.shields.io/pypi/pyversions/vsts-cli.svg)](https://pypi.python.org/pypi/vsts-cli)
# Microsoft Visual Studio Team Services CLI
# Azure Devops
VSTS CLI is a new command line interface for [Visual Studio Team Services](https://www.visualstudio.com/team-services/) (VSTS) and [Team Foundation Server](https://www.visualstudio.com/tfs/) (TFS) 2017 Update 2 and later.
Azure Devops CLI is a new command line interface for [Azure Devops Service](https://azure.microsoft.com/en-in/services/devops/)
> VSTS CLI is currently in preview but we encourage you to give it a try and provide feedback (or contribute).
> Azure Devops CLI is currently in preview but we encourage you to give it a try and provide feedback (or contribute).
## Get started
@ -16,50 +21,49 @@ Also refer to the ["get started" guide](https://aka.ms/vsts-cli-docs-getstarted)
For help, pass the `-h` or `--help` argument, for example:
```bash
vsts -h
vsts code -h
az dev -h
az dev code -h
```
### Commands
Use the VSTS CLI to work with and manage build, code repositories, projects, work items, and more in your VSTS account or on-premises Team Foundation Server collection.
Use the Azure Devops CLI to work with and manage build, code repositories, projects, work items, and more in your Azure Devops account or on-premises Team Foundation Server collection.
Here are just a few of the commands:
* vsts build queue
* vsts code pr create
* vsts code pr list
* vsts code pr complete
* vsts code pr reviewers add
* vsts code pr work-items list
* vsts project create
* vsts work item create
* vsts work item update
* az dev build queue
* az dev code pr list
* az dev code pr complete
* az dev code pr reviewers add
* az dev code pr work-items list
* az dev project create
* az dev work item create
* az dev work item update
See the full list of [available commands](https://aka.ms/vsts-cli-commands).
### Login (setup credentials)
Create a personal access token and provide to the VSTS CLI via the login command:
Create a personal access token and provide to the Azure Devops CLI via the login command:
```bash
vsts login --instance https://MYACCOUNT.visualstudio.com --token MYTOKEN
az dev login --instance https://MYACCOUNT.visualstudio.com --token MYTOKEN
```
### Using VSTS CLI Behind a Proxy
### Using Azure Devops CLI Behind a Proxy
The VSTS CLI picks the network proxy configuration from the environment variables `HTTP_PROXY`, and `HTTPS_PROXY`.
The Azure Devops CLI picks the network proxy configuration from the environment variables `HTTP_PROXY`, and `HTTPS_PROXY`.
### Configure defaults, Git aliases, and more
You can change your default settings using the `vsts configure` command, for example you can set the default output format for all commands. The options are:
You can change your default settings using the `az dev configure` command, for example you can set the default output format for all commands. The options are:
* JSON
* JSON (with color highlighting)
* Table (human-readable tabular output)
* TSV (tab and new line delimited)
You can also add aliases in Git for certain VSTS CLI commands. For example, `git pr list` will be an alias for `vsts code pr list`.
You can also add aliases in Git for certain Azure Devops CLI commands. For example, `git pr list` will be an alias for `az dev code pr list`.
### Querying and filtering output
@ -75,7 +79,7 @@ Fabrikam Fiber
### Examples and snippets
For more usage examples, see the official VSTS CLI [documentation](https://aka.ms/vsts-cli-docs-overview).
For more usage examples, see the official Azure Devops CLI [documentation](https://aka.ms/vsts-cli-docs-overview).
## Developer setup
@ -84,7 +88,7 @@ To contribute or to just play with the CLI in your development environment, see
## License
```
VSTS CLI
Azure Devops CLI
MIT License
@ -111,15 +115,15 @@ MIT License
## Telemetry
VSTS CLI collects usage data and sends it to Microsoft to help improve our products and services. Read our [privacy statement](https://privacy.microsoft.com/en-us/privacystatement) to learn more.
Azure Devops CLI collects usage data and sends it to Microsoft to help improve our products and services. Read our [privacy statement](https://privacy.microsoft.com/en-us/privacystatement) to learn more.
To disable telemetry use the `vsts configure` command.
To disable telemetry use the `az dev configure` command.
## Feedback
If you have any issues, questions, comments, or feature requests regarding this tool, please file an issue within this github repo using our contribution guidelines.
To find where to provide feedback from the CLI, run `vsts feedback`.
To find where to provide feedback from the CLI, run `az dev feedback`.
## Contribute

Просмотреть файл

@ -0,0 +1,4 @@
1.0.0
---------------------
* Initial preview release.

Просмотреть файл

@ -0,0 +1,2 @@
Microsoft DevOps CLI Extension for Windows, Mac and Linux
=========================================================

Просмотреть файл

@ -0,0 +1,49 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from knack.help_files import helps
from azure.cli.core import AzCommandsLoader
helps['hello world'] = """
type: command
short-summary: Say hello world.
"""
class DevCommandsLoader(AzCommandsLoader):
def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
custom_type = CliCommandType(operations_tmpl='azext_dev#{}')
super(DevCommandsLoader, self).__init__(cli_ctx=cli_ctx,
custom_command_type=custom_type)
def load_command_table(self, args):
from azext_dev.dev.admin.commands import load_admin_commands
load_admin_commands(self, args)
from azext_dev.dev.boards.commands import load_work_commands
load_work_commands(self, args)
from azext_dev.dev.pipelines.commands import load_build_commands
load_build_commands(self, args)
from azext_dev.dev.repos.commands import load_code_commands
load_code_commands(self, args)
from azext_dev.dev.team.commands import load_team_commands
load_team_commands(self, args)
return self.command_table
def load_arguments(self, command):
from azext_dev.dev.admin.arguments import load_admin_arguments
load_admin_arguments(self, command)
from azext_dev.dev.boards.arguments import load_work_arguments
load_work_arguments(self, command)
from azext_dev.dev.pipelines.arguments import load_build_arguments
load_build_arguments(self, command)
from azext_dev.dev.repos.arguments import load_code_arguments
load_code_arguments(self, command)
from azext_dev.dev.team.arguments import load_team_arguments
load_team_arguments(self, command)
COMMAND_LOADER_CLS = DevCommandsLoader

Просмотреть файл

@ -6,7 +6,7 @@ import pkg_resources
pkg_resources.declare_namespace(__name__)
import knack.help # pylint: disable=unused-import
from ._help import load_admin_help
def load_params(_):
import knack.arguments # pylint: disable=redefined-outer-name
@ -14,3 +14,5 @@ def load_params(_):
def load_commands():
import knack.commands # pylint: disable=redefined-outer-name
load_admin_help()

Просмотреть файл

@ -7,8 +7,9 @@ from knack.help_files import helps # pylint: disable=unused-import
# pylint: disable=line-too-long
helps['admin'] = """
def load_admin_help():
helps['dev admin'] = """
type: group
short-summary: Administration commands.
long-summary:
"""
"""

Просмотреть файл

@ -0,0 +1,20 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from knack.arguments import enum_choice_list, ArgumentsContext
_ORGANIZATION_LICENSE_TYPES_FOR_ADD = ['advanced', 'express', 'professional', 'stakeholder']
_TYPE_FOR_BANNER = ['info', 'warning', 'error']
def load_admin_arguments(self, _):
with self.argument_context('dev admin') as context:
context.argument('team_instance', options_list=['-i', '--instance'])
with self.argument_context('dev admin user') as context:
context.argument('user_id', options_list='--id')
context.argument('access_level', **enum_choice_list(_ORGANIZATION_LICENSE_TYPES_FOR_ADD))
with self.argument_context('dev admin banner') as context:
context.argument('message', options_list=['-m', '--message'])
context.argument('message_id', options_list='--id')
context.argument('banner_type', options_list=['-t', '--type'], **enum_choice_list(_TYPE_FOR_BANNER))

Просмотреть файл

@ -3,7 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from vsts.cli.common.arguments import convert_date_string_to_iso8601
from azext_dev.dev.common.arguments import convert_date_string_to_iso8601
from .setting import setting_add_or_update, setting_list, setting_remove, GLOBAL_MESSAGE_BANNERS_KEY, USER_SCOPE_HOST

Просмотреть файл

@ -0,0 +1,18 @@
# --------------------------------------------------------------------------------------------
# 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
from ._format import transform_banner_table_output
from .banner import banner_list, banner_show, banner_add, banner_remove, banner_update
def load_admin_commands(self, _):
with self.command_group('dev admin banner') as g:
g.custom_command('list', 'dev.admin.banner.banner_list', table_transformer=transform_banner_table_output)
g.custom_command('show', 'dev.admin.banner.banner_show', table_transformer=transform_banner_table_output)
g.custom_command('add', 'dev.admin.banner.banner_add', table_transformer=transform_banner_table_output)
g.custom_command('remove', 'dev.admin.banner.banner_remove')
g.custom_command('update', 'dev.admin.banner.banner_update', table_transformer=transform_banner_table_output)

Просмотреть файл

@ -3,7 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from vsts.cli.common.services import (get_settings_client,
from azext_dev.dev.common.services import (get_settings_client,
resolve_instance)

Просмотреть файл

@ -5,6 +5,8 @@
import pkg_resources
pkg_resources.declare_namespace(__name__)
from ._help import load_boards_help
import knack.help # pylint: disable=unused-import
@ -14,3 +16,5 @@ def load_params(_):
def load_commands():
import knack.commands # pylint: disable=redefined-outer-name
load_boards_help()

Просмотреть файл

@ -62,7 +62,7 @@ def transform_work_item_query_result_table_output(result):
def transform_work_item_query_result_row_output(row):
from vsts.cli.work.common.work_item import get_last_query_result
from azext_dev.dev.common.work_item import get_last_query_result
table_row = OrderedDict()
max_columns = 5
i = 0

Просмотреть файл

@ -7,14 +7,15 @@ from knack.help_files import helps # pylint: disable=unused-import
# pylint: disable=line-too-long
helps['work'] = """
def load_boards_help():
helps['dev work'] = """
type: group
short-summary: Commands to work with and manage work items.
long-summary:
"""
"""
helps['work item'] = """
helps['dev work item'] = """
type: group
short-summary: Manage work items.
long-summary:
"""
"""

Просмотреть файл

@ -0,0 +1,26 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from knack.arguments import enum_choice_list, ArgumentsContext
_ON_OFF_SWITCH_VALUES = ['on', 'off']
def load_work_arguments(self, _):
with self.argument_context('dev work') as context:
context.argument('open_browser', options_list='--open')
context.argument('project', options_list=('--project', '-p'))
context.argument('team_instance', options_list=('--instance', '-i'))
context.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
with self.argument_context('dev work item') as context:
context.argument('work_item_id', type=int, options_list='--id')
context.argument('work_item_type', type=str, options_list='--type')
context.argument('fields', nargs='*', options_list=('--fields', '-f'))
context.argument('description', options_list=('--description', '-d'))
with self.argument_context('dev work item query') as context:
context.argument('query_id', type=str, options_list='--id')

Просмотреть файл

@ -0,0 +1,17 @@
# --------------------------------------------------------------------------------------------
# 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
from ._format import (transform_work_item_table_output,
transform_work_item_query_result_table_output)
from .work_item import show_work_item, create_work_item, query_work_items, update_work_item
def load_work_commands(self, _):
with self.command_group('dev work item') as g:
g.custom_command('show', 'dev.boards.work_item.show_work_item', table_transformer=transform_work_item_table_output)
g.custom_command('create', 'dev.boards.work_item.create_work_item', table_transformer=transform_work_item_table_output)
g.custom_command('query', 'dev.boards.work_item.query_work_items', table_transformer=transform_work_item_query_result_table_output)
g.custom_command('update', 'dev.boards.work_item.update_work_item', table_transformer=transform_work_item_table_output)

Просмотреть файл

@ -10,11 +10,11 @@ from knack.util import CLIError
from vsts.exceptions import VstsServiceError
from vsts.work_item_tracking.v4_0.models.json_patch_operation import JsonPatchOperation
from vsts.work_item_tracking.v4_0.models.wiql import Wiql
from vsts.cli.common.identities import (ME, get_current_identity, resolve_identity)
from vsts.cli.common.services import (get_work_item_tracking_client,
from azext_dev.dev.common.identities import (ME, get_current_identity, resolve_identity)
from azext_dev.dev.common.services import (get_work_item_tracking_client,
resolve_instance,
resolve_instance_and_project)
from vsts.cli.common.uri import uri_quote
from azext_dev.dev.common.uri import uri_quote
logger = get_logger(__name__)

Просмотреть файл

@ -121,11 +121,11 @@ OUTPUT_LIST = [
{'name': 'tsv', 'desc': 'Tab and Newline delimited, great for GREP, AWK, etc.'}
]
MSG_INTRO = '\nWelcome to the VSTS CLI! This command will guide you through setting some default values.\n'
MSG_INTRO = '\nWelcome to the Azure Dev CLI! This command will guide you through setting some default values.\n'
MSG_CLOSING = '\nYou\'re all set! Here are some commands to try:\n' \
' $ vsts login\n' \
' $ vsts code pr list\n{}' \
' $ vsts feedback\n'
' $ az dev login\n' \
' $ az dev code pr list\n{}' \
' $ az dev feedback\n'
MSG_CLOSING_GIT_COMMAND = ' $ git pr list\n'

Просмотреть файл

@ -0,0 +1,21 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)
from ._help import load_pipelines_help
import knack.help # pylint: disable=unused-import
def load_params(_):
import knack.arguments # pylint: disable=redefined-outer-name
def load_commands():
import knack.commands # pylint: disable=redefined-outer-name
load_pipelines_help()

Просмотреть файл

@ -23,7 +23,7 @@ def transform_build_table_output(result):
def _transform_build_row(row):
from vsts.cli.common.git import REF_HEADS_PREFIX
from azext_dev.dev.common.git import REF_HEADS_PREFIX
table_row = OrderedDict()
table_row['ID'] = row['id']
table_row['Number'] = row['buildNumber']

Просмотреть файл

@ -7,14 +7,15 @@ from knack.help_files import helps # pylint: disable=unused-import
# pylint: disable=line-too-long
helps['build'] = """
def load_pipelines_help():
helps['dev build'] = """
type: group
short-summary: Commands to work with and manage builds.
long-summary:
"""
"""
helps['build definition'] = """
helps['dev build definition'] = """
type: group
short-summary: Manage build definitions.
long-summary:
"""
"""

Просмотреть файл

@ -0,0 +1,34 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from knack.arguments import enum_choice_list, ArgumentsContext
_ON_OFF_SWITCH_VALUES = ['on', 'off']
def load_build_arguments(self, _):
with self.argument_context('build') as context:
context.argument('open_browser', options_list='--open')
context.argument('project', options_list=('--project', '-p'))
context.argument('team_instance', options_list=('--instance', '-i'))
context.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
with self.argument_context('build list') as context:
context.argument('definition_ids', nargs='*', type=int)
context.argument('tags', nargs='*')
with self.argument_context('build queue') as context:
context.argument('definition_id', type=int)
context.argument('variables', nargs='*')
with self.argument_context('build show') as context:
context.argument('build_id', options_list='--id', type=int)
with self.argument_context('build definition show') as context:
context.argument('definition_id', options_list='--id', type=int)
with self.argument_context('build task') as context:
context.argument('task_id', options_list='--id', type=str)

Просмотреть файл

@ -8,11 +8,11 @@ from webbrowser import open_new
from knack.log import get_logger
from vsts.build.v4_0.models.build import Build
from vsts.build.v4_0.models.definition_reference import DefinitionReference
from vsts.cli.common.git import resolve_git_ref_heads
from vsts.cli.common.identities import resolve_identity_as_id
from vsts.cli.common.services import (get_build_client,
from azext_dev.dev.common.git import resolve_git_ref_heads
from azext_dev.dev.common.identities import resolve_identity_as_id
from azext_dev.dev.common.services import (get_build_client,
resolve_instance_and_project)
from vsts.cli.common.uri import uri_quote
from azext_dev.dev.common.uri import uri_quote
from .build_definition import get_definition_id_from_name
logger = get_logger(__name__)

Просмотреть файл

@ -6,11 +6,11 @@
from webbrowser import open_new
from knack.log import get_logger
from vsts.cli.common.services import (get_build_client, get_git_client,
from azext_dev.dev.common.services import (get_build_client, get_git_client,
resolve_instance_and_project,
resolve_instance_project_and_repo)
from vsts.cli.common.uri import uri_quote
from vsts.cli.common.uuid import is_uuid
from azext_dev.dev.common.uri import uri_quote
from azext_dev.dev.common.uuid import is_uuid
logger = get_logger(__name__)

Просмотреть файл

@ -0,0 +1,31 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from ._format import (transform_build_table_output,
transform_builds_table_output,
transform_definition_table_output,
transform_definitions_table_output,
transform_tasks_table_output,
transform_task_table_output)
from knack.commands import CommandGroup
from .build import build_list, build_queue, build_show
from .build_definition import build_definition_list, build_definition_show
from .task import task_list, task_show
def load_build_commands(self, _):
with self.command_group('dev') as g:
# basic vsts_cli_build commands
g.custom_command('build list', 'dev.pipelines.build.build_list', table_transformer=transform_builds_table_output)
g.custom_command('build queue', 'dev.pipelines.build.build_queue', table_transformer=transform_build_table_output)
g.custom_command('build show', 'dev.pipelines.build.build_show', table_transformer=transform_build_table_output)
# basic vsts_cli_build definition commands
g.custom_command('build definition list', 'dev.pipelines.build_definition.build_definition_list', table_transformer=transform_definitions_table_output)
g.custom_command('build definition show', 'dev.pipelines.build_definition.build_definition_show', table_transformer=transform_definition_table_output)
# basic vsts_cli_build task commands
g.custom_command('build task list', 'dev.pipelines.task.task_list', table_transformer=transform_tasks_table_output)
g.custom_command('build task show', 'dev.pipelines.task.task_show', table_transformer=transform_task_table_output)

Просмотреть файл

@ -4,9 +4,9 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from vsts.cli.common.services import (get_task_agent_client,
from azext_dev.dev.common.services import (get_task_agent_client,
resolve_instance)
from vsts.cli.common.uuid import is_uuid
from azext_dev.dev.common.uuid import is_uuid
def task_list(team_instance=None, task_id=None, detect=None):

Просмотреть файл

@ -5,6 +5,8 @@
import pkg_resources
pkg_resources.declare_namespace(__name__)
from ._help import load_repos_help
import knack.help # pylint: disable=unused-import
@ -14,3 +16,5 @@ def load_params(_):
def load_commands():
import knack.commands # pylint: disable=redefined-outer-name
load_repos_help()

Просмотреть файл

@ -134,9 +134,9 @@ def _get_vote_from_vote_number(number):
def transform_policies_table_output(result):
from vsts.cli.common.identities import (ensure_display_names_in_cache,
from azext_dev.dev.common.identities import (ensure_display_names_in_cache,
get_display_name_from_identity_id)
from vsts.cli.common.services import get_first_vss_instance_uri
from azext_dev.dev.common.services import get_first_vss_instance_uri
table_output = []
reviewer_ids = []
for item in result:
@ -240,7 +240,7 @@ def transform_repo_table_output(result):
def _transform_repo_row(row):
from vsts.cli.common.git import get_branch_name_from_ref
from azext_dev.dev.common.git import get_branch_name_from_ref
table_row = OrderedDict()
table_row['ID'] = row['id']
table_row['Name'] = row['name']

Просмотреть файл

@ -7,38 +7,39 @@ from knack.help_files import helps # pylint: disable=unused-import
# pylint: disable=line-too-long
helps['code'] = """
def load_repos_help():
helps['dev code'] = """
type: group
short-summary: Commands to work with and manage code repositories.
long-summary:
"""
"""
helps['code pr'] = """
helps['dev code pr'] = """
type: group
short-summary: Manage pull requests.
long-summary:
"""
"""
helps['code pr policies'] = """
helps['dev code pr policies'] = """
type: group
short-summary: Manage pull request policy.
long-summary:
"""
"""
helps['code pr reviewers'] = """
helps['dev code pr reviewers'] = """
type: group
short-summary: Manage pull request reviewers.
long-summary:
"""
"""
helps['code pr work-items'] = """
helps['dev code pr work-items'] = """
type: group
short-summary: Manage work items associated with pull requests.
long-summary:
"""
"""
helps['code repo'] = """
helps['dev code repo'] = """
type: group
short-summary: Manage repositories.
long-summary:
"""
"""

Просмотреть файл

@ -0,0 +1,56 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from knack.arguments import enum_choice_list, ArgumentsContext
# CUSTOM CHOICE LISTS
_ON_OFF_SWITCH_VALUES = ['on', 'off']
_VOTE_VALUES = ['approve', 'approve-with-suggestions', 'reset', 'wait-for-author', 'reject']
_PR_STATUS_VALUES = ['all', 'active', 'completed', 'abandoned']
def load_code_arguments(self, _):
with self.argument_context('dev code') as context:
context.argument('open_browser', options_list='--open')
context.argument('project', options_list=('--project', '-p'))
context.argument('team_instance', options_list=('--instance', '-i'))
context.argument('reviewers', nargs='*')
context.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
with self.argument_context('dev code pr') as context:
context.argument('description', type=str, options_list=('--description', '-d'), nargs='*')
context.argument('pull_request_id', type=int, options_list='--id')
context.argument('repository', options_list=('--repository', '-r'))
context.argument('source_branch', options_list=('--source-branch', '-s'))
context.argument('target_branch', options_list=('--target-branch', '-t'))
context.argument('title', type=str)
with self.argument_context('dev code pr create') as context:
context.argument('work_items', nargs='*')
with self.argument_context('dev code pr list') as context:
context.argument('status', **enum_choice_list(_PR_STATUS_VALUES))
with self.argument_context('dev code pr reviewers') as context:
context.argument('reviewers', nargs='+')
with self.argument_context('dev code pr work-items') as context:
context.argument('work_items', nargs='+')
with self.argument_context('dev code pr update') as context:
context.argument('auto_complete', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
context.argument('squash', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
context.argument('delete_source_branch', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
context.argument('bypass_policy', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
context.argument('transition_work_items', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
with self.argument_context('dev code pr policies') as context:
context.argument('evaluation_id', options_list=('--evaluation-id', '-e'))
with self.argument_context('dev code pr set-vote') as context:
context.argument('vote', **enum_choice_list(_VOTE_VALUES))
with self.argument_context('dev code repo') as context:
context.argument('repo_id', options_list='--id')

Просмотреть файл

@ -0,0 +1,69 @@
# --------------------------------------------------------------------------------------------
# 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
from ._format import (transform_pull_request_table_output,
transform_pull_requests_table_output,
transform_repo_table_output,
transform_repos_table_output,
transform_reviewers_table_output,
transform_reviewer_table_output,
transform_policies_table_output,
transform_policy_table_output,
transform_work_items_table_output)
from .pull_request import (create_pull_request,
update_pull_request,
show_pull_request,
list_pull_requests,
complete_pull_request,
abandon_pull_request,
reactivate_pull_request,
create_pull_request_reviewers,
list_pull_request_reviewers,
delete_pull_request_reviewers,
add_pull_request_work_items,
list_pull_request_work_items,
remove_pull_request_work_items,
vote_pull_request,
list_pr_policies,
queue_pr_policy)
from .repository import create_repo, list_repos, show_repo
def load_code_commands(self, _):
with self.command_group('dev code') as g:
# basic pr commands
g.custom_command('pr create', 'dev.repos.pull_request.create_pull_request', table_transformer=transform_pull_request_table_output)
g.custom_command('pr update', 'dev.repos.pull_request.update_pull_request', table_transformer=transform_pull_request_table_output)
g.custom_command('pr show', 'dev.repos.pull_request.show_pull_request', table_transformer=transform_pull_request_table_output)
g.custom_command('pr list', 'dev.repos.pull_request.list_pull_requests', table_transformer=transform_pull_request_table_output)
# pr status update commands
g.custom_command('pr complete', 'dev.repos.pull_request.complete_pull_request', table_transformer=transform_pull_request_table_output)
g.custom_command('pr abandon', 'dev.repos.pull_request.abandon_pull_request', table_transformer=transform_pull_request_table_output)
g.custom_command('pr reactivate', 'dev.repos.pull_request.reactivate_pull_request', table_transformer=transform_pull_request_table_output)
# pr reviewer commands
g.custom_command('pr reviewers add', 'dev.repos.pull_request.create_pull_request_reviewers', table_transformer=transform_reviewers_table_output)
g.custom_command('pr reviewers list', 'dev.repos.pull_request.list_pull_request_reviewers', table_transformer=transform_reviewers_table_output)
g.custom_command('pr reviewers remove', 'dev.repos.pull_request.delete_pull_request_reviewers', table_transformer=transform_reviewers_table_output)
# pr work item commands
g.custom_command('pr work-items add', 'dev.repos.pull_request.add_pull_request_work_items', table_transformer=transform_work_items_table_output)
g.custom_command('pr work-items list', 'dev.repos.pull_request.list_pull_request_work_items', table_transformer=transform_work_items_table_output)
g.custom_command('pr work-items remove', 'dev.repos.pull_request.remove_pull_request_work_items', table_transformer=transform_work_items_table_output)
# pr set-vote commands
g.custom_command('pr set-vote', 'dev.repos.pull_request.vote_pull_request', table_transformer=transform_reviewer_table_output)
# pr policy commands
g.custom_command('pr policies list', 'dev.repos.pull_request.list_pr_policies', table_transformer=transform_policies_table_output)
g.custom_command('pr policies queue', 'dev.repos.pull_request.queue_pr_policy', table_transformer=transform_policies_table_output)
# repository commands
g.custom_command('repo create', 'dev.repos.repository.create_repo', table_transformer=transform_repo_table_output)
g.custom_command('repo list', 'dev.repos.repository.list_repos', table_transformer=transform_repo_table_output)
g.custom_command('repo show', 'dev.repos.repository.show_repo', table_transformer=transform_repo_table_output)

Просмотреть файл

@ -3,7 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from vsts.cli.common.git import is_git_alias_setup, setup_git_alias, clear_git_alias
from azext_dev.dev.common.git import is_git_alias_setup, setup_git_alias, clear_git_alias
def setup_git_aliases(local=False):

Просмотреть файл

@ -16,12 +16,12 @@ from vsts.git.v4_0.models.identity_ref_with_vote import IdentityRefWithVote
from vsts.git.v4_0.models.resource_ref import ResourceRef
from vsts.work_item_tracking.v4_0.models.json_patch_operation import JsonPatchOperation
from vsts.work_item_tracking.v4_0.models.work_item_relation import WorkItemRelation
from vsts.cli.common.arguments import resolve_on_off_switch, should_detect
from vsts.cli.common.git import get_current_branch_name, resolve_git_ref_heads
from vsts.cli.common.identities import ME, resolve_identity_as_id
from vsts.cli.common.uri import uri_quote
from vsts.cli.common.uuid import EMPTY_UUID
from vsts.cli.common.services import (get_git_client,
from azext_dev.dev.common.arguments import resolve_on_off_switch, should_detect
from azext_dev.dev.common.git import get_current_branch_name, resolve_git_ref_heads
from azext_dev.dev.common.identities import ME, resolve_identity_as_id
from azext_dev.dev.common.uri import uri_quote
from azext_dev.dev.common.uuid import EMPTY_UUID
from azext_dev.dev.common.services import (get_git_client,
get_policy_client,
get_work_item_tracking_client,
resolve_instance,

Просмотреть файл

@ -7,9 +7,9 @@ import webbrowser
from knack.util import CLIError
from vsts.git.v4_0.models.git_repository_create_options import GitRepositoryCreateOptions
from vsts.cli.common.services import (get_git_client,
from azext_dev.dev.common.services import (get_git_client,
resolve_instance_and_project)
from vsts.cli.common.uri import uri_quote
from azext_dev.dev.common.uri import uri_quote
from knack.log import get_logger
logger = get_logger(__name__)

Просмотреть файл

@ -2,12 +2,12 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)
import knack.help # pylint: disable=unused-import
from ._help import load_team_help
def load_params(_):
import knack.arguments # pylint: disable=redefined-outer-name
@ -15,3 +15,5 @@ def load_params(_):
def load_commands():
import knack.commands # pylint: disable=redefined-outer-name
load_team_help()

Просмотреть файл

@ -19,7 +19,7 @@ def transform_project_table_output(result):
def _transform_project_row(row):
from vsts.cli.team.common.project import (PROCESS_TEMPLATE_CAPABILITY_NAME,
from .project import (PROCESS_TEMPLATE_CAPABILITY_NAME,
VERSION_CONTROL_CAPABILITY_NAME,
VERSION_CONTROL_CAPABILITY_ATTRIBUTE_NAME)
table_row = OrderedDict()

Просмотреть файл

@ -7,8 +7,9 @@ from knack.help_files import helps # pylint: disable=unused-import
# pylint: disable=line-too-long
helps['project'] = """
def load_team_help():
helps['dev project'] = """
type: group
short-summary: Commands to work with and manage team projects.
long-summary:
"""
"""

Просмотреть файл

@ -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 knack.arguments import ArgumentsContext, enum_choice_list
# CUSTOM CHOICE LISTS
_ON_OFF_SWITCH_VALUES = ['on', 'off']
_YES_NO_SWITCH_VALUES = ['yes', 'no']
_OUTPUT_VALUES = ['json', 'jsonc', 'table', 'tsv']
_SOURCE_CONTROL_VALUES = ['git', 'tfvc']
_STATE_VALUES = ['invalid', 'unchanged', 'all', 'new', 'wellformed', 'deleting', 'createpending']
def load_team_arguments(self, _):
with self.argument_context('dev login') as context:
context.argument('team_instance', options_list=('--instance', '-i'))
context.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
with self.argument_context('dev logout') as context:
context.argument('team_instance', options_list=('--instance', '-i'))
context.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
with self.argument_context('dev configure') as context:
context.argument('defaults', options_list=('--defaults', '-d'), nargs='*')
with self.argument_context('dev project') as context:
context.argument('team_instance', options_list=('--instance', '-i'))
context.argument('process', options_list=('--process', '-p'))
context.argument('source_control', options_list=('--source-control', '-s'),
**enum_choice_list(_SOURCE_CONTROL_VALUES))
context.argument('description', options_list=('--description', '-d'))
context.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
context.argument('state', **enum_choice_list(_STATE_VALUES))
context.argument('project_id', options_list='--id')
with self.argument_context('dev configure') as context:
context.argument('collect_telemetry', **enum_choice_list(_YES_NO_SWITCH_VALUES))
context.argument('enable_log_file', **enum_choice_list(_YES_NO_SWITCH_VALUES))
context.argument('use_git_aliases', **enum_choice_list(_YES_NO_SWITCH_VALUES))
context.argument('suppress_update_message', **enum_choice_list(_YES_NO_SWITCH_VALUES))
context.argument('default_output', **enum_choice_list(_OUTPUT_VALUES))
context.argument('list_config', options_list=('--list', '-l'))

Просмотреть файл

@ -0,0 +1,21 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from ._format import transform_project_table_output, transform_projects_table_output
from .credentials import credential_set, credential_clear
from .feedback import feedback
from .configure import configure
from .project import create_project, show_project, list_projects
def load_team_commands(self, _):
with self.command_group('dev') as g:
g.custom_command('login', 'dev.team.credentials.credential_set')
g.custom_command('logout', 'dev.team.credentials.credential_clear')
g.custom_command('feedback', 'dev.team.feedback.feedback')
g.custom_command('configure', 'dev.team.configure.configure')
g.custom_command('project create', 'dev.team.project.create_project', table_transformer=transform_project_table_output)
g.custom_command('project show', 'dev.team.project.show_project', table_transformer=transform_project_table_output)
g.custom_command('project list', 'dev.team.project.list_projects', table_transformer=transform_projects_table_output)

Просмотреть файл

@ -7,12 +7,12 @@
from __future__ import print_function
from knack.util import CLIError
from vsts.cli.common.config import (set_global_config_value,
from azext_dev.dev.common.config import (set_global_config_value,
CORE_SECTION,
DEFAULTS_SECTION,
LOGGING_SECTION)
from vsts.cli.common.configure import interactive_configure, print_current_configuration
from vsts.cli.common.version import disable_command_version_checking, DISABLE_VERSION_CHECK_SETTING
from azext_dev.dev.common.configure import interactive_configure, print_current_configuration
from azext_dev.dev.common.version import disable_command_version_checking, DISABLE_VERSION_CHECK_SETTING
def configure(defaults=None, collect_telemetry=None, enable_log_file=None, use_git_aliases=None,
@ -61,7 +61,7 @@ def configure(defaults=None, collect_telemetry=None, enable_log_file=None, use_g
if disable_version_check:
set_global_config_value(CORE_SECTION, DISABLE_VERSION_CHECK_SETTING, disable_version_check)
if use_git_aliases is not None:
from vsts.cli.code.common.git_alias import setup_git_aliases, clear_git_aliases
from azext_dev.dev.repos.git_alias import setup_git_aliases, clear_git_aliases
if use_git_aliases == 'yes':
setup_git_aliases()
elif use_git_aliases == 'no':

Просмотреть файл

@ -10,9 +10,9 @@ from knack.log import get_logger
from knack.prompting import NoTTYException, prompt_pass
from knack.util import CLIError
from msrest.authentication import BasicAuthentication
from vsts.cli.common._credentials import clear_credential, set_credential
from vsts.cli.common.services import _get_vss_connection, get_base_url
from vsts.cli.common.version import disable_command_version_checking, DISABLE_VERSION_CHECK_SETTING
from azext_dev.dev.common._credentials import clear_credential, set_credential
from azext_dev.dev.common.services import _get_vss_connection, get_base_url
from azext_dev.dev.common.version import disable_command_version_checking, DISABLE_VERSION_CHECK_SETTING
logger = get_logger(__name__)

Просмотреть файл

@ -6,7 +6,7 @@
from __future__ import print_function
from vsts.cli.common.version import disable_command_version_checking, DISABLE_VERSION_CHECK_SETTING
from azext_dev.dev.common.version import disable_command_version_checking, DISABLE_VERSION_CHECK_SETTING
def feedback():

Просмотреть файл

@ -8,10 +8,10 @@ import webbrowser
from knack.log import get_logger
from knack.util import CLIError
from vsts.core.v4_0.models.team_project import TeamProject
from vsts.cli.common.operations import wait_for_long_running_operation
from vsts.cli.common.services import (get_core_client,
from azext_dev.dev.common.operations import wait_for_long_running_operation
from azext_dev.dev.common.services import (get_core_client,
resolve_instance)
from vsts.cli.common.uri import uri_quote
from azext_dev.dev.common.uri import uri_quote
logger = get_logger(__name__)

Просмотреть файл

@ -2,3 +2,5 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
VERSION = "1.0.0-rc1"

Просмотреть файл

@ -0,0 +1,39 @@
# # --------------------------------------------------------------------------------------------
# # Copyright (c) Microsoft Corporation. All rights reserved.
# # Licensed under the MIT License. See License.txt in the project root for license information.
# # --------------------------------------------------------------------------------------------
# from knack.help import CLIHelp
# from azure.cli.dev.common.version import VERSION
# class VstsCLIHelp(CLIHelp):
# def __init__(self, cli_ctx=None):
# # import command group help
# import azure.cli.dev.admin._help
# import azure.cli.dev.pipelines._help
# import azure.cli.dev.repos._help
# import azure.cli.dev.team._help
# import azure.cli.dev.boards._help
# import azure.cli.dev.artifacts._help
# super(VstsCLIHelp, self).__init__(cli_ctx=cli_ctx,
# privacy_statement=PRIVACY_STATEMENT,
# welcome_message=WELCOME_MESSAGE)
# PRIVACY_STATEMENT = """Visual Studio Team Services CLI {}
# Telemetry
# ---------
# The VSTS CLI collects usage data in order to improve your experience.
# The data is anonymous and does not include commandline argument values.
# The data is collected by Microsoft.
# You can change your telemetry settings with `vsts configure`.
# """.format(VERSION)
# WELCOME_MESSAGE = """Visual Studio Team Services CLI {}
# Use `vsts -h` to see available commands or go to https://aka.ms/vsts-cli.
# Available commands:""".format(VERSION)

Просмотреть файл

@ -0,0 +1,3 @@
#basic
#setuptools==30.4.0
azure-cli>=2.0.46

Просмотреть файл

@ -0,0 +1,33 @@
#!/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 sys
import os
from subprocess import check_call, CalledProcessError
root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..'))
print('Running dev setup...')
print('Root directory \'{}\'\n'.format(root_dir))
def exec_command(command):
try:
print('Executing: ' + command)
check_call(command.split(), cwd=root_dir)
print()
except CalledProcessError as err:
print(err, file=sys.stderr)
sys.exit(1)
# install general requirements and azure-cli
exec_command('python -m pip install --upgrade pip')
exec_command('pip install -r requirements.txt')
# upgrade to latest az-dev-cli
exec_command('pip install --upgrade .')
#exec_command('pip install wheel')

Просмотреть файл

@ -1,2 +1,2 @@
[bdist_wheel]
universal=1
universal=1

Просмотреть файл

@ -3,10 +3,12 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import os
import re
from codecs import open
from setuptools import setup, find_packages
NAME = 'vsts-cli'
VERSION = '0.1.3'
NAME = 'azure-cli-dev'
# To install the library, run the following
#
@ -16,17 +18,20 @@ VERSION = '0.1.3'
# http://pypi.python.org/pypi/setuptools
REQUIRES = [
'knack==0.4.1',
'setuptools',
'vsts-cli-common==' + VERSION,
'vsts-cli-admin==' + VERSION,
'vsts-cli-build==' + VERSION,
'vsts-cli-code==' + VERSION,
'vsts-cli-team==' + VERSION,
'vsts-cli-package==' + VERSION,
'vsts-cli-work==' + VERSION
'knack==0.4.3',
'python-dateutil==2.7.3',
'vsts~=0.1.16.dev',
'keyring~=13.2.1',
'colorama>=0.3.9',
'humanfriendly==4.7',
'setuptools'
]
# Version extraction inspired from 'requests'
with open(os.path.join('azext_dev', 'version.py'), 'r') as fd:
VERSION = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
@ -39,11 +44,17 @@ CLASSIFIERS = [
'License :: OSI Approved :: MIT License',
]
with open('README.rst', 'r', encoding='utf-8') as f:
README = f.read()
with open('HISTORY.rst', 'r', encoding='utf-8') as f:
HISTORY = f.read()
setup(
name=NAME,
version=VERSION,
license='MIT',
description="VSTS Command Line Interface",
description="Azure Dev Command Line Interface",
long_description=README + '\n\n' + HISTORY,
author="Microsoft Corporation",
author_email="vstscli@microsoft.com",
url="https://github.com/Microsoft/vsts-cli",
@ -53,10 +64,8 @@ setup(
classifiers=CLASSIFIERS,
entry_points={
'console_scripts': [
'vsts = vsts.cli.__main__:main'
'vsts = azure.cli.dev.__main__:main'
]
},
include_package_data=True,
long_description="""\
"""
)

35
scripts/runTests.ps1 Normal file
Просмотреть файл

@ -0,0 +1,35 @@
$rootPath = Get-Location
$extensionDirectory = Join-Path -Path $rootPath -ChildPath "azure-dev-cli-extensions"
Set-Location $extensionDirectory
Write-Host "installing azure dev cli extension"
pip install --upgrade .
Write-Host "done"
Write-Host "creating wheel"
python setup.py bdist_wheel
Write-Host "done"
Set-Location $rootPath
$ErrorActionPreference = "Continue"
try {
$uninstallCommand = "az extension remove -n azure-cli-dev **2>&1 | Write-Host**"
Invoke-Expression $uninstallCommand
Write-Host "extension was installed and it was removed"
}
catch {
Write-Host "extension was not installed"
}
$ErrorActionPreference = "Stop"
Write-Host "installing azure dev cli extension"
$extensions = Get-ChildItem -Path $sourceDir -Filter "*.whl" -Recurse | Select-Object FullName
az extension add --source $extensions[0].FullName -y
Write-Host "done"
az dev -h
$testDirectory = Join-Path -Path $rootPath -ChildPath "tests"
$basicPrTests = Join-Path -Path $testDirectory -ChildPath "basicPrTest.py"
pytest $basicPrTests

Просмотреть файл

@ -0,0 +1,31 @@
Write-Output "upgrading pip"
python -m pip install --upgrade pip
Write-Output "done"
Write-Output "installing wheel"
pip install wheel
Write-Output "done"
Write-Output "installing pytest"
pip install pytest
Write-Output "done"
pip install keyring
pip install keyrings.alt
# Install CLI & CLI testsdk
Write-Output "Installing azure-cli-testsdk and azure-cli..."
# Update the git commit or branch when we need a new version of azure-cli-testsdk
pip install --pre azure-cli --extra-index-url https://azurecliprod.blob.core.windows.net/edge
pip install "git+https://github.com/Azure/azure-cli@master#egg=azure-cli-testsdk&subdirectory=src/azure-cli-testsdk" -q
Write-Output "Installed."
az --h
try{
$logoutCommand = "az dev logout **2>&1 | Write-Host**"
Invoke-Expression $logoutCommand
Write-Host "logout done"
}
catch{
Write-Host "no credentials were stored"
}

Просмотреть файл

@ -1,21 +0,0 @@
Copyright (c) Microsoft Corporation. All rights reserved.
MIT License
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.

Просмотреть файл

@ -1,51 +0,0 @@
# --------------------------------------------------------------------------------------------
# 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, find_packages
NAME = 'vsts-cli-admin'
VERSION = '0.1.3'
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
REQUIRES = [
'knack==0.4.1',
'python-dateutil==2.7.3',
'vsts-cli-admin-common==' + VERSION
]
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.6',
'License :: OSI Approved :: MIT License',
]
setup(
name=NAME,
version=VERSION,
license='MIT',
description="VSTS Administration Command Line Interface",
author="Microsoft Corporation",
author_email="vstscli@microsoft.com",
url="https://github.com/Microsoft/vsts-cli",
keywords=["Microsoft", "VSTS", "Team Services", "SDK", "AzureTfs", "CLI", "Admin", "Administration"],
install_requires=REQUIRES,
classifiers=CLASSIFIERS,
packages=find_packages(),
include_package_data=True,
long_description="""\
"""
)

Просмотреть файл

@ -1,6 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)

Просмотреть файл

@ -1,22 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from knack.arguments import enum_choice_list, ArgumentsContext
_ORGANIZATION_LICENSE_TYPES_FOR_ADD = ['advanced', 'express', 'professional', 'stakeholder']
_TYPE_FOR_BANNER = ['info', 'warning', 'error']
def load_admin_arguments(cli_command_loader):
with ArgumentsContext(cli_command_loader, 'admin') as ac:
ac.argument('team_instance', options_list=['-i', '--instance'])
with ArgumentsContext(cli_command_loader, 'admin user') as ac:
ac.argument('user_id', options_list='--id')
ac.argument('access_level', **enum_choice_list(_ORGANIZATION_LICENSE_TYPES_FOR_ADD))
with ArgumentsContext(cli_command_loader, 'admin banner') as ac:
ac.argument('message', options_list=['-m', '--message'])
ac.argument('message_id', options_list='--id')
ac.argument('banner_type', options_list=['-t', '--type'], **enum_choice_list(_TYPE_FOR_BANNER))

Просмотреть файл

@ -1,17 +0,0 @@
# --------------------------------------------------------------------------------------------
# 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
from ._format import transform_banner_table_output
def load_admin_commands(cli_command_loader):
with CommandGroup(cli_command_loader, 'admin', 'vsts.cli.admin.common.banner#{}') as g:
g.command('banner list', 'banner_list', table_transformer=transform_banner_table_output)
g.command('banner show', 'banner_show', table_transformer=transform_banner_table_output)
g.command('banner add', 'banner_add', table_transformer=transform_banner_table_output)
g.command('banner remove', 'banner_remove')
g.command('banner update', 'banner_update', table_transformer=transform_banner_table_output)

Просмотреть файл

@ -1,21 +0,0 @@
Copyright (c) Microsoft Corporation. All rights reserved.
MIT License
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.

Просмотреть файл

@ -1,51 +0,0 @@
# --------------------------------------------------------------------------------------------
# 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, find_packages
NAME = 'vsts-cli-build'
VERSION = '0.1.3'
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
REQUIRES = [
'knack==0.4.1',
'python-dateutil==2.7.3',
'vsts-cli-build-common==' + VERSION
]
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.6',
'License :: OSI Approved :: MIT License',
]
setup(
name=NAME,
version=VERSION,
license='MIT',
description="VSTS Build Command Line Interface",
author="Microsoft Corporation",
author_email="vstscli@microsoft.com",
url="https://github.com/Microsoft/vsts-cli",
keywords=["Microsoft", "VSTS", "Team Services", "SDK", "AzureTfs", "CLI", "Build"],
install_requires=REQUIRES,
classifiers=CLASSIFIERS,
packages=find_packages(),
include_package_data=True,
long_description="""\
"""
)

Просмотреть файл

@ -1,6 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)

Просмотреть файл

@ -1,6 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)

Просмотреть файл

@ -1,34 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from knack.arguments import enum_choice_list, ArgumentsContext
_ON_OFF_SWITCH_VALUES = ['on', 'off']
def load_build_arguments(cli_command_loader):
with ArgumentsContext(cli_command_loader, 'build') as ac:
ac.argument('open_browser', options_list='--open')
ac.argument('project', options_list=('--project', '-p'))
ac.argument('team_instance', options_list=('--instance', '-i'))
ac.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
with ArgumentsContext(cli_command_loader, 'build list') as ac:
ac.argument('definition_ids', nargs='*', type=int)
ac.argument('tags', nargs='*')
with ArgumentsContext(cli_command_loader, 'build queue') as ac:
ac.argument('definition_id', type=int)
ac.argument('variables', nargs='*')
with ArgumentsContext(cli_command_loader, 'build show') as ac:
ac.argument('build_id', options_list='--id', type=int)
with ArgumentsContext(cli_command_loader, 'build definition show') as ac:
ac.argument('definition_id', options_list='--id', type=int)
with ArgumentsContext(cli_command_loader, 'build task') as ac:
ac.argument('task_id', options_list='--id', type=str)

Просмотреть файл

@ -1,33 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from ._format import (transform_build_table_output,
transform_builds_table_output,
transform_definition_table_output,
transform_definitions_table_output,
transform_tasks_table_output,
transform_task_table_output)
from knack.commands import CommandGroup
def load_build_commands(cli_command_loader):
with CommandGroup(cli_command_loader, 'build', 'vsts.cli.build.common.{}') as g:
# basic vsts_cli_build commands
g.command('list', 'build#build_list',
table_transformer=transform_builds_table_output)
g.command('queue', 'build#build_queue',
table_transformer=transform_build_table_output)
g.command('show', 'build#build_show',
table_transformer=transform_build_table_output)
# basic vsts_cli_build definition commands
g.command('definition list', 'build_definition#build_definition_list',
table_transformer=transform_definitions_table_output)
g.command('definition show', 'build_definition#build_definition_show',
table_transformer=transform_definition_table_output)
# basic vsts_cli_build task commands
g.command('task list', 'task#task_list', table_transformer=transform_tasks_table_output)
g.command('task show', 'task#task_show', table_transformer=transform_task_table_output)

Просмотреть файл

@ -1,21 +0,0 @@
Copyright (c) Microsoft Corporation. All rights reserved.
MIT License
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.

Просмотреть файл

@ -1,51 +0,0 @@
# --------------------------------------------------------------------------------------------
# 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, find_packages
NAME = 'vsts-cli-code'
VERSION = '0.1.3'
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
REQUIRES = [
'knack==0.4.1',
'python-dateutil==2.7.3',
'vsts-cli-code-common==' + VERSION
]
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.6',
'License :: OSI Approved :: MIT License',
]
setup(
name=NAME,
version=VERSION,
license='MIT',
description="VSTS Code Command Line Interface",
author="Microsoft Corporation",
author_email="vstscli@microsoft.com",
url="https://github.com/Microsoft/vsts-cli",
keywords=["Microsoft", "VSTS", "Team Services", "SDK", "AzureTfs", "CLI", "Code"],
install_requires=REQUIRES,
classifiers=CLASSIFIERS,
packages=find_packages(),
include_package_data=True,
long_description="""\
"""
)

Просмотреть файл

@ -1,6 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)

Просмотреть файл

@ -1,6 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)

Просмотреть файл

@ -1,56 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from knack.arguments import enum_choice_list, ArgumentsContext
# CUSTOM CHOICE LISTS
_ON_OFF_SWITCH_VALUES = ['on', 'off']
_VOTE_VALUES = ['approve', 'approve-with-suggestions', 'reset', 'wait-for-author', 'reject']
_PR_STATUS_VALUES = ['all', 'active', 'completed', 'abandoned']
def load_code_arguments(cli_command_loader):
with ArgumentsContext(cli_command_loader, 'code') as ac:
ac.argument('open_browser', options_list='--open')
ac.argument('project', options_list=('--project', '-p'))
ac.argument('team_instance', options_list=('--instance', '-i'))
ac.argument('reviewers', nargs='*')
ac.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
with ArgumentsContext(cli_command_loader, 'code pr') as ac:
ac.argument('description', type=str, options_list=('--description', '-d'), nargs='*')
ac.argument('pull_request_id', type=int, options_list='--id')
ac.argument('repository', options_list=('--repository', '-r'))
ac.argument('source_branch', options_list=('--source-branch', '-s'))
ac.argument('target_branch', options_list=('--target-branch', '-t'))
ac.argument('title', type=str)
with ArgumentsContext(cli_command_loader, 'code pr create') as ac:
ac.argument('work_items', nargs='*')
with ArgumentsContext(cli_command_loader, 'code pr list') as ac:
ac.argument('status', **enum_choice_list(_PR_STATUS_VALUES))
with ArgumentsContext(cli_command_loader, 'code pr reviewers') as ac:
ac.argument('reviewers', nargs='+')
with ArgumentsContext(cli_command_loader, 'code pr work-items') as ac:
ac.argument('work_items', nargs='+')
with ArgumentsContext(cli_command_loader, 'code pr update') as ac:
ac.argument('auto_complete', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
ac.argument('squash', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
ac.argument('delete_source_branch', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
ac.argument('bypass_policy', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
ac.argument('transition_work_items', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
with ArgumentsContext(cli_command_loader, 'code pr policies') as ac:
ac.argument('evaluation_id', options_list=('--evaluation-id', '-e'))
with ArgumentsContext(cli_command_loader, 'code pr set-vote') as ac:
ac.argument('vote', **enum_choice_list(_VOTE_VALUES))
with ArgumentsContext(cli_command_loader, 'code repo') as ac:
ac.argument('repo_id', options_list='--id')

Просмотреть файл

@ -1,64 +0,0 @@
# --------------------------------------------------------------------------------------------
# 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
from ._format import (transform_pull_request_table_output,
transform_pull_requests_table_output,
transform_repo_table_output,
transform_repos_table_output,
transform_reviewers_table_output,
transform_reviewer_table_output,
transform_policies_table_output,
transform_policy_table_output,
transform_work_items_table_output)
def load_code_commands(cli_command_loader):
with CommandGroup(cli_command_loader, 'code', 'vsts.cli.code.common.{}') as g:
# basic pr commands
g.command('pr create', 'pull_request#create_pull_request',
table_transformer=transform_pull_request_table_output)
g.command('pr update', 'pull_request#update_pull_request',
table_transformer=transform_pull_request_table_output)
g.command('pr show', 'pull_request#show_pull_request',
table_transformer=transform_pull_request_table_output)
g.command('pr list', 'pull_request#list_pull_requests',
table_transformer=transform_pull_requests_table_output)
# pr status update commands
g.command('pr complete', 'pull_request#complete_pull_request',
table_transformer=transform_pull_request_table_output)
g.command('pr abandon', 'pull_request#abandon_pull_request',
table_transformer=transform_pull_request_table_output)
g.command('pr reactivate', 'pull_request#reactivate_pull_request',
table_transformer=transform_pull_request_table_output)
# pr reviewer commands
g.command('pr reviewers add', 'pull_request#create_pull_request_reviewers',
table_transformer=transform_reviewers_table_output)
g.command('pr reviewers list', 'pull_request#list_pull_request_reviewers',
table_transformer=transform_reviewers_table_output)
g.command('pr reviewers remove', 'pull_request#delete_pull_request_reviewers',
table_transformer=transform_reviewers_table_output)
# pr work item commands
g.command('pr work-items add', 'pull_request#add_pull_request_work_items',
table_transformer=transform_work_items_table_output)
g.command('pr work-items list', 'pull_request#list_pull_request_work_items',
table_transformer=transform_work_items_table_output)
g.command('pr work-items remove', 'pull_request#remove_pull_request_work_items',
table_transformer=transform_work_items_table_output)
# pr set-vote commands
g.command('pr set-vote', 'pull_request#vote_pull_request', table_transformer=transform_reviewer_table_output)
# pr policy commands
g.command('pr policies list', 'pull_request#list_pr_policies', table_transformer=transform_policies_table_output)
g.command('pr policies queue', 'pull_request#queue_pr_policy', table_transformer=transform_policy_table_output)
# repository commands
g.command('repo create', 'repository#create_repo', table_transformer=transform_repo_table_output)
g.command('repo list', 'repository#list_repos', table_transformer=transform_repos_table_output)
g.command('repo show', 'repository#show_repo', table_transformer=transform_repo_table_output)

Просмотреть файл

@ -1,21 +0,0 @@
Copyright (c) Microsoft Corporation. All rights reserved.
MIT License
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.

Просмотреть файл

@ -1,51 +0,0 @@
# --------------------------------------------------------------------------------------------
# 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, find_packages
NAME = 'vsts-cli-package'
VERSION = '0.1.3'
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
REQUIRES = [
'knack==0.4.1',
'python-dateutil==2.7.3',
'vsts-cli-package-common==' + VERSION
]
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.6',
'License :: OSI Approved :: MIT License',
]
setup(
name=NAME,
version=VERSION,
license='MIT',
description="VSTS Packaging Command Line Interface",
author="Microsoft Corporation",
author_email="vstscli@microsoft.com",
url="https://github.com/Microsoft/vsts-cli",
keywords=["Microsoft", "VSTS", "Team Services", "SDK", "AzureTfs", "CLI", "Package", "Packaging"],
install_requires=REQUIRES,
classifiers=CLASSIFIERS,
packages=find_packages(),
include_package_data=True,
long_description="""\
"""
)

Просмотреть файл

@ -1,6 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)

Просмотреть файл

@ -1,6 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)

Просмотреть файл

@ -1,20 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from knack.help_files import helps # pylint: disable=unused-import
# pylint: disable=line-too-long
helps['package'] = """
type: group
short-summary: Commands to work with and manage packages
long-summary:
"""
helps['package universal'] = """
type: group
short-summary: (PREVIEW) Manage Universal Packages
long-summary:
"""

Просмотреть файл

@ -1,10 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from knack.arguments import ArgumentsContext
def load_package_arguments(cli_command_loader):
with ArgumentsContext(cli_command_loader, 'package universal') as ac:
ac.argument('team_instance', options_list=('--instance', '-i'))

Просмотреть файл

@ -1,13 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import platform
from knack.commands import CommandGroup
def load_package_commands(cli_command_loader):
with CommandGroup(cli_command_loader, 'package universal', 'vsts.cli.package.common.universal#{}') as g:
g.command('publish', 'publish_package')
g.command('download', 'download_package')

Просмотреть файл

@ -1,21 +0,0 @@
Copyright (c) Microsoft Corporation. All rights reserved.
MIT License
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.

Просмотреть файл

@ -1,51 +0,0 @@
# --------------------------------------------------------------------------------------------
# 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, find_packages
NAME = 'vsts-cli-team'
VERSION = '0.1.3'
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
REQUIRES = [
'knack==0.4.1',
'python-dateutil==2.7.3',
'vsts-cli-team-common==' + VERSION
]
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.6',
'License :: OSI Approved :: MIT License',
]
setup(
name=NAME,
version=VERSION,
license='MIT',
description="VSTS Team Command Line Interface",
author="Microsoft Corporation",
author_email="vstscli@microsoft.com",
url="https://github.com/Microsoft/vsts-cli",
keywords=["Microsoft", "VSTS", "Team Services", "SDK", "AzureTfs", "CLI", "Team"],
install_requires=REQUIRES,
classifiers=CLASSIFIERS,
packages=find_packages(),
include_package_data=True,
long_description="""\
"""
)

Просмотреть файл

@ -1,6 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)

Просмотреть файл

@ -1,6 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)

Просмотреть файл

@ -1,16 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)
import knack.help # pylint: disable=unused-import
def load_params(_):
import knack.arguments # pylint: disable=redefined-outer-name
def load_commands():
import knack.commands # pylint: disable=redefined-outer-name

Просмотреть файл

@ -1,41 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from knack.arguments import ArgumentsContext, enum_choice_list
# CUSTOM CHOICE LISTS
_ON_OFF_SWITCH_VALUES = ['on', 'off']
_YES_NO_SWITCH_VALUES = ['yes', 'no']
_OUTPUT_VALUES = ['json', 'jsonc', 'table', 'tsv']
_SOURCE_CONTROL_VALUES = ['git', 'tfvc']
_STATE_VALUES = ['invalid', 'unchanged', 'all', 'new', 'wellformed', 'deleting', 'createpending']
def load_team_arguments(cli_command_loader):
with ArgumentsContext(cli_command_loader, 'login') as ac:
ac.argument('team_instance', options_list=('--instance', '-i'))
ac.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
with ArgumentsContext(cli_command_loader, 'logout') as ac:
ac.argument('team_instance', options_list=('--instance', '-i'))
ac.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
with ArgumentsContext(cli_command_loader, 'configure') as ac:
ac.argument('defaults', options_list=('--defaults', '-d'), nargs='*')
with ArgumentsContext(cli_command_loader, 'project') as ac:
ac.argument('team_instance', options_list=('--instance', '-i'))
ac.argument('process', options_list=('--process', '-p'))
ac.argument('source_control', options_list=('--source-control', '-s'),
**enum_choice_list(_SOURCE_CONTROL_VALUES))
ac.argument('description', options_list=('--description', '-d'))
ac.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
ac.argument('state', **enum_choice_list(_STATE_VALUES))
ac.argument('project_id', options_list='--id')
with ArgumentsContext(cli_command_loader, 'configure') as ac:
ac.argument('collect_telemetry', **enum_choice_list(_YES_NO_SWITCH_VALUES))
ac.argument('enable_log_file', **enum_choice_list(_YES_NO_SWITCH_VALUES))
ac.argument('use_git_aliases', **enum_choice_list(_YES_NO_SWITCH_VALUES))
ac.argument('suppress_update_message', **enum_choice_list(_YES_NO_SWITCH_VALUES))
ac.argument('default_output', **enum_choice_list(_OUTPUT_VALUES))
ac.argument('list_config', options_list=('--list', '-l'))

Просмотреть файл

@ -1,37 +0,0 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from ._format import transform_project_table_output, transform_projects_table_output
def load_team_commands(cli_command_loader):
cli_command_loader.command_table['login'] = \
cli_command_loader.create_command(module_name='team', name='login',
operation='vsts.cli.team.common.credentials#credential_set')
cli_command_loader.command_table['logout'] = \
cli_command_loader.create_command(module_name='team', name='logout',
operation='vsts.cli.team.common.credentials#credential_clear')
cli_command_loader.command_table['feedback'] = \
cli_command_loader.create_command(module_name='team', name='feedback',
operation='vsts.cli.team.common.feedback#feedback')
cli_command_loader.command_table['configure'] = \
cli_command_loader.create_command(module_name='team', name='configure',
operation='vsts.cli.team.common.configure#configure')
cli_command_loader.command_table['project create'] = \
cli_command_loader.create_command(module_name='team', name='project create',
operation='vsts.cli.team.common.project#create_project',
table_transformer=transform_project_table_output)
cli_command_loader.command_table['project show'] = \
cli_command_loader.create_command(module_name='team', name='project show',
operation='vsts.cli.team.common.project#show_project',
table_transformer=transform_project_table_output)
cli_command_loader.command_table['project list'] = \
cli_command_loader.create_command(module_name='team', name='project list',
operation='vsts.cli.team.common.project#list_projects',
table_transformer=transform_projects_table_output)

Просмотреть файл

@ -1,21 +0,0 @@
Copyright (c) Microsoft Corporation. All rights reserved.
MIT License
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.

Просмотреть файл

@ -1,51 +0,0 @@
# --------------------------------------------------------------------------------------------
# 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, find_packages
NAME = 'vsts-cli-work'
VERSION = '0.1.3'
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
REQUIRES = [
'knack==0.4.1',
'python-dateutil==2.7.3',
'vsts-cli-work-common==' + VERSION
]
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.6',
'License :: OSI Approved :: MIT License',
]
setup(
name=NAME,
version=VERSION,
license='MIT',
description="VSTS Work Command Line Interface",
author="Microsoft Corporation",
author_email="vstscli@microsoft.com",
url="https://github.com/Microsoft/vsts-cli",
keywords=["Microsoft", "VSTS", "Team Services", "SDK", "AzureTfs", "CLI", "Work"],
install_requires=REQUIRES,
classifiers=CLASSIFIERS,
packages=find_packages(),
include_package_data=True,
long_description="""\
"""
)

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше