aaz-dev


Nameaaz-dev JSON
Version 2.6.2 PyPI version JSON
download
home_pagehttps://github.com/Azure/aaz-dev-tools
SummaryMicrosoft Atomic Azure CLI Commands Developer Tools
upload_time2024-04-26 07:28:48
maintainerNone
docs_urlNone
authorMicrosoft Corporation
requires_python>=3.8
licenseMIT
keywords azure
VCS
bugtrack_url
requirements schematics pyyaml pytest fuzzywuzzy inflect msrestazure lxml flask cachelib xmltodict packaging Jinja2 MarkupSafe jsonschema click
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Microsoft Atomic Azure CLI Dev Tools

The *aaz-dev* tool is designed to generate atomic Azure CLI commands from OpenAPI specifications. For more information, please refer to [document](https://azure.github.io/aaz-dev-tools/) and [video](https://microsoft.sharepoint.com/teams/AzureCLITools237/_layouts/15/embed.aspx?UniqueId=97905452-69c2-4f7c-8c6b-b411c7fd0013&embed=%7B%22ust%22%3Atrue%2C%22hv%22%3A%22CopyEmbedCode%22%7D&referrer=StreamWebApp&referrerScenario=EmbedDialog.Create).

## Installation
Currently, we can install it with a [.whl file](https://github.com/Azure/aaz-dev-tools/releases). Later on, we'll publish it to PyPI to support *pip install* way of installation.

## Setting up your development environment

### 1 Code repos

Please `Fork` the following repos in your github account and `Clone` them in your local disk:
   
   - [Azure CLI](https://github.com/Azure/azure-cli)
   - [Azure CLI Extension](https://github.com/Azure/azure-cli-extensions)
   - [AAZ](https://github.com/Azure/aaz): Used to upload the command model generated.
   - [azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs) or [azure-rest-api-specs-pr](https://github.com/Azure/azure-rest-api-specs-pr)

After clone you can add `upstream` for every repos in your local clone by using `git remote add upstream`.

### 2 Setup python

#### 2.1 Install python
Please install python with version >= 3.8 in your local machine.

- For windows: You can download and run full installer from [Python Download](https://www.python.org/downloads/).
- For linux: You can install python from Package Manager or build a stable relase from source code

Check the version of python, make use it's not less than 3.8.
- For windows:
    You can run:
    ```PowerShell
    C:\Users\{xxxx}\AppData\Local\Programs\Python\Python3{xxxx}\python --version
    ```
    `C:\Users\{xxxx}\AppData\Local\Programs\Python\Python3{xxxx}` is the python installation path.
- For linux:
    ```bash
    python --version
    ```
    You can also specify the version number when you have multiple versions installed. For example if you want to run version 3.8
    ```bash
    python3.8 --version
    ```

#### 2.2 Setup a python virtual environment

You can use venv to create virtual environments, optionally isolated from system site directories. Each virtual environment has its own Python binary (which matches the version of the binary that was used to create this environment) and can have its own independent set of installed Python packages in its site directories.

You can run the following command to create a new virtual environment:
- For windows:
    ```PowerShell
    C:\Users\{xxxx}\AppData\Local\Programs\Python\Python3{xxxx}\python -m venv {some path}\{venv name}
    ```
- For linux:
    ```bash
    python3.8 -m venv {some path}/{venv name}
    ```

### 3 Active existing virtual environment

You should __always__ active the virtual environment for azure-cli development.

- For Windows:
    - Powershell
    ```powershell
    {some path}\{venv name}\Scripts\Activate.ps1
    ```
    - Command Prompt
    ```Command Prompt
    {some path}\{venv name}\Scripts\activate.bat
    ```
- For Linux:
```bash
source {some path}/{venv name}/bin/activate
```
After active the virtual environment, the `python` command will always be the one creates this virtual environment and you can always use `python`
```
python --version
```

### 4 Install tools for azure-cli development

#### 4.1 Install [azure-cli-dev-tools](https://github.com/Azure/azure-cli-dev-tools)
Both for windows and linux
```
pip install azdev
```

#### 4.2 Install aaz-dev-tools

- For Windows
    - Powershell
    ```
    pip install aaz-dev
    ```
    - Command Prompt
    ```
    pip install aaz-dev
    ```
- For linux
    ```bash
    pip install aaz-dev
    ```
#### 4.3 Set up build env
- For linux users, set up python3 build tools would avoid other unseen installation issues
  ```
  Ubuntu: apt-get install python3-dev build-essential
  Centos: yum install python3-devel
  ```
#### 4.4 Possible problems
- For windows users, dependency python-levenshtein installation might run into trouble. developers might need to download [.whl](https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-levenshtein) file and install it manually (reference to [link](https://stackoverflow.com/questions/37676623/cant-install-levenshtein-distance-package-on-windows-python-3-5/46414982))

### 5. Code repos setup

#### 5.1 azure-cli
Before start to the development task, you should always sync the code in the `dev` branch of `upstream`(Azure/Azure-cli).
If your commands will generated to azure-cli repo, you should checkout a new branch with `feature-` prefix.

#### 5.2 azure-cli-extensions
If your commands will generated to azure-cli-extension repo, you should sync the code in the `main` branch of `upstream`(Azure/Azure-cli-extensions), and checkout a new branch with `feature-` prefix.

#### 5.3 aaz
Before start to the development task, you should always sync the change in the `main` branch of `upstream`, and checkout a new branch with `feature-` prefix.

#### 5.4 run `azdev setup`
You should always run the following command everytime you sync `azure-cli` code of `upstream`.
```
azdev setup --cli {path to azure-cli} --repo {path to azure-cli-extensions}
```

### 6 Run aaz-dev-tools

```bash
aaz-dev run -c {path to azure-cli} -e {path to azure-cli-extensions} -s {path swagger or swagger-pr} -a {path to aaz}
```

## Before using generated commands

1. Make sure you have logined by `az login`.
2. Make sure you have switched to the subscription for test by `az account set -s {subscription ID for test}`
3. If your commands are in extensions, make sure you have loaded this extension by `azdev extension add {your extension name}`

## Other documentations

- [extension](https://github.com/Azure/azure-cli/blob/dev/doc/extensions/README.md)
- [command guidelines](https://github.com/Azure/azure-cli/blob/dev/doc/command_guidelines.md)
- [authoring tests](https://github.com/Azure/azure-cli/blob/dev/doc/authoring_tests.md)
- [shorthand syntax](https://github.com/Azure/azure-cli/blob/dev/doc/shorthand_syntax.md): Azure cli shorthand syntax can help cli users to pass complicated argument values. Only the arguments of AAZ(Atomic Azure CLI) commands generated by aaz-dev tool support shorthand syntax.

## Submit code and command models

After finish the development, you should push the change in your forked repos first, and the create a Pull Request to upstream repos.

- azure-cli: create a Pull Request to `dev` branch of `Azure/azure-cli`
- azure-cli-extensions: create a Pull Request to `main` branch of `Azure/azure-cli-extensions` 
- aaz: create a Pull Request to `main` branch of `Azure/azz`


## Reporting issues and feedback
If you encounter any bugs with the tool please file an issue in the [Issues](https://github.com/Azure/aaz-dev-tools/issues) section of our GitHub repository.

## License
```
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.
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Azure/aaz-dev-tools",
    "name": "aaz-dev",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "azure",
    "author": "Microsoft Corporation",
    "author_email": "azpycli@microsoft.com",
    "download_url": "https://files.pythonhosted.org/packages/f1/0c/64e0bc826ec3d018f4ad1b7aad9dc293e5cdb89fdac5984bb488d5baf7c4/aaz_dev-2.6.2.tar.gz",
    "platform": null,
    "description": "# Microsoft Atomic Azure CLI Dev Tools\n\nThe *aaz-dev* tool is designed to generate atomic Azure CLI commands from OpenAPI specifications. For more information, please refer to [document](https://azure.github.io/aaz-dev-tools/) and [video](https://microsoft.sharepoint.com/teams/AzureCLITools237/_layouts/15/embed.aspx?UniqueId=97905452-69c2-4f7c-8c6b-b411c7fd0013&embed=%7B%22ust%22%3Atrue%2C%22hv%22%3A%22CopyEmbedCode%22%7D&referrer=StreamWebApp&referrerScenario=EmbedDialog.Create).\n\n## Installation\nCurrently, we can install it with a [.whl file](https://github.com/Azure/aaz-dev-tools/releases). Later on, we'll publish it to PyPI to support *pip install* way of installation.\n\n## Setting up your development environment\n\n### 1 Code repos\n\nPlease `Fork` the following repos in your github account and `Clone` them in your local disk:\n   \n   - [Azure CLI](https://github.com/Azure/azure-cli)\n   - [Azure CLI Extension](https://github.com/Azure/azure-cli-extensions)\n   - [AAZ](https://github.com/Azure/aaz): Used to upload the command model generated.\n   - [azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs) or [azure-rest-api-specs-pr](https://github.com/Azure/azure-rest-api-specs-pr)\n\nAfter clone you can add `upstream` for every repos in your local clone by using `git remote add upstream`.\n\n### 2 Setup python\n\n#### 2.1 Install python\nPlease install python with version >= 3.8 in your local machine.\n\n- For windows: You can download and run full installer from [Python Download](https://www.python.org/downloads/).\n- For linux: You can install python from Package Manager or build a stable relase from source code\n\nCheck the version of python, make use it's not less than 3.8.\n- For windows:\n    You can run:\n    ```PowerShell\n    C:\\Users\\{xxxx}\\AppData\\Local\\Programs\\Python\\Python3{xxxx}\\python --version\n    ```\n    `C:\\Users\\{xxxx}\\AppData\\Local\\Programs\\Python\\Python3{xxxx}` is the python installation path.\n- For linux:\n    ```bash\n    python --version\n    ```\n    You can also specify the version number when you have multiple versions installed. For example if you want to run version 3.8\n    ```bash\n    python3.8 --version\n    ```\n\n#### 2.2 Setup a python virtual environment\n\nYou can use venv to create virtual environments, optionally isolated from system site directories. Each virtual environment has its own Python binary (which matches the version of the binary that was used to create this environment) and can have its own independent set of installed Python packages in its site directories.\n\nYou can run the following command to create a new virtual environment:\n- For windows:\n    ```PowerShell\n    C:\\Users\\{xxxx}\\AppData\\Local\\Programs\\Python\\Python3{xxxx}\\python -m venv {some path}\\{venv name}\n    ```\n- For linux:\n    ```bash\n    python3.8 -m venv {some path}/{venv name}\n    ```\n\n### 3 Active existing virtual environment\n\nYou should __always__ active the virtual environment for azure-cli development.\n\n- For Windows:\n    - Powershell\n    ```powershell\n    {some path}\\{venv name}\\Scripts\\Activate.ps1\n    ```\n    - Command Prompt\n    ```Command Prompt\n    {some path}\\{venv name}\\Scripts\\activate.bat\n    ```\n- For Linux:\n```bash\nsource {some path}/{venv name}/bin/activate\n```\nAfter active the virtual environment, the `python` command will always be the one creates this virtual environment and you can always use `python`\n```\npython --version\n```\n\n### 4 Install tools for azure-cli development\n\n#### 4.1 Install [azure-cli-dev-tools](https://github.com/Azure/azure-cli-dev-tools)\nBoth for windows and linux\n```\npip install azdev\n```\n\n#### 4.2 Install aaz-dev-tools\n\n- For Windows\n    - Powershell\n    ```\n    pip install aaz-dev\n    ```\n    - Command Prompt\n    ```\n    pip install aaz-dev\n    ```\n- For linux\n    ```bash\n    pip install aaz-dev\n    ```\n#### 4.3 Set up build env\n- For linux users, set up python3 build tools would avoid other unseen installation issues\n  ```\n  Ubuntu: apt-get install python3-dev build-essential\n  Centos: yum install python3-devel\n  ```\n#### 4.4 Possible problems\n- For windows users, dependency python-levenshtein installation might run into trouble. developers might need to download [.whl](https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-levenshtein) file and install it manually (reference to [link](https://stackoverflow.com/questions/37676623/cant-install-levenshtein-distance-package-on-windows-python-3-5/46414982))\n\n### 5. Code repos setup\n\n#### 5.1 azure-cli\nBefore start to the development task, you should always sync the code in the `dev` branch of `upstream`(Azure/Azure-cli).\nIf your commands will generated to azure-cli repo, you should checkout a new branch with `feature-` prefix.\n\n#### 5.2 azure-cli-extensions\nIf your commands will generated to azure-cli-extension repo, you should sync the code in the `main` branch of `upstream`(Azure/Azure-cli-extensions), and checkout a new branch with `feature-` prefix.\n\n#### 5.3 aaz\nBefore start to the development task, you should always sync the change in the `main` branch of `upstream`, and checkout a new branch with `feature-` prefix.\n\n#### 5.4 run `azdev setup`\nYou should always run the following command everytime you sync `azure-cli` code of `upstream`.\n```\nazdev setup --cli {path to azure-cli} --repo {path to azure-cli-extensions}\n```\n\n### 6 Run aaz-dev-tools\n\n```bash\naaz-dev run -c {path to azure-cli} -e {path to azure-cli-extensions} -s {path swagger or swagger-pr} -a {path to aaz}\n```\n\n## Before using generated commands\n\n1. Make sure you have logined by `az login`.\n2. Make sure you have switched to the subscription for test by `az account set -s {subscription ID for test}`\n3. If your commands are in extensions, make sure you have loaded this extension by `azdev extension add {your extension name}`\n\n## Other documentations\n\n- [extension](https://github.com/Azure/azure-cli/blob/dev/doc/extensions/README.md)\n- [command guidelines](https://github.com/Azure/azure-cli/blob/dev/doc/command_guidelines.md)\n- [authoring tests](https://github.com/Azure/azure-cli/blob/dev/doc/authoring_tests.md)\n- [shorthand syntax](https://github.com/Azure/azure-cli/blob/dev/doc/shorthand_syntax.md): Azure cli shorthand syntax can help cli users to pass complicated argument values. Only the arguments of AAZ(Atomic Azure CLI) commands generated by aaz-dev tool support shorthand syntax.\n\n## Submit code and command models\n\nAfter finish the development, you should push the change in your forked repos first, and the create a Pull Request to upstream repos.\n\n- azure-cli: create a Pull Request to `dev` branch of `Azure/azure-cli`\n- azure-cli-extensions: create a Pull Request to `main` branch of `Azure/azure-cli-extensions` \n- aaz: create a Pull Request to `main` branch of `Azure/azz`\n\n\n## Reporting issues and feedback\nIf you encounter any bugs with the tool please file an issue in the [Issues](https://github.com/Azure/aaz-dev-tools/issues) section of our GitHub repository.\n\n## License\n```\nMIT License\n\nCopyright (c) Microsoft Corporation. All rights reserved.\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Microsoft Atomic Azure CLI Commands Developer Tools",
    "version": "2.6.2",
    "project_urls": {
        "Homepage": "https://github.com/Azure/aaz-dev-tools"
    },
    "split_keywords": [
        "azure"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e984e3a4cb5dd358287b38ab0d4b7a819fbabf1f39123af033d14ac22bec223b",
                "md5": "28e54d39d6074a7211e064f4daa089aa",
                "sha256": "01999977bde7e76366789af5b36060c959ab0df63310da8e154770414384f859"
            },
            "downloads": -1,
            "filename": "aaz_dev-2.6.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "28e54d39d6074a7211e064f4daa089aa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 1112430,
            "upload_time": "2024-04-26T07:28:51",
            "upload_time_iso_8601": "2024-04-26T07:28:51.178675Z",
            "url": "https://files.pythonhosted.org/packages/e9/84/e3a4cb5dd358287b38ab0d4b7a819fbabf1f39123af033d14ac22bec223b/aaz_dev-2.6.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f10c64e0bc826ec3d018f4ad1b7aad9dc293e5cdb89fdac5984bb488d5baf7c4",
                "md5": "abc2d5b68708c04788a3d67f9ab4ceff",
                "sha256": "c5fe645520e3806747af30420875b8f72ba070f8af85de21128cf08ba45c4d30"
            },
            "downloads": -1,
            "filename": "aaz_dev-2.6.2.tar.gz",
            "has_sig": false,
            "md5_digest": "abc2d5b68708c04788a3d67f9ab4ceff",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1048425,
            "upload_time": "2024-04-26T07:28:48",
            "upload_time_iso_8601": "2024-04-26T07:28:48.462917Z",
            "url": "https://files.pythonhosted.org/packages/f1/0c/64e0bc826ec3d018f4ad1b7aad9dc293e5cdb89fdac5984bb488d5baf7c4/aaz_dev-2.6.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-26 07:28:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Azure",
    "github_project": "aaz-dev-tools",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "schematics",
            "specs": [
                [
                    "~=",
                    "2.1.1"
                ]
            ]
        },
        {
            "name": "pyyaml",
            "specs": [
                [
                    "==",
                    "5.3.1"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "~=",
                    "6.2.0"
                ]
            ]
        },
        {
            "name": "fuzzywuzzy",
            "specs": [
                [
                    "~=",
                    "0.18.0"
                ]
            ]
        },
        {
            "name": "inflect",
            "specs": [
                [
                    "~=",
                    "5.3.0"
                ]
            ]
        },
        {
            "name": "msrestazure",
            "specs": [
                [
                    "~=",
                    "0.6.4"
                ]
            ]
        },
        {
            "name": "lxml",
            "specs": [
                [
                    "~=",
                    "4.9.2"
                ]
            ]
        },
        {
            "name": "flask",
            "specs": [
                [
                    "~=",
                    "2.1.3"
                ]
            ]
        },
        {
            "name": "cachelib",
            "specs": [
                [
                    "~=",
                    "0.5.0"
                ]
            ]
        },
        {
            "name": "xmltodict",
            "specs": [
                [
                    "~=",
                    "0.12.0"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    ">=",
                    "21.3"
                ]
            ]
        },
        {
            "name": "Jinja2",
            "specs": [
                [
                    "~=",
                    "3.0.3"
                ]
            ]
        },
        {
            "name": "MarkupSafe",
            "specs": [
                [
                    "~=",
                    "2.0.1"
                ]
            ]
        },
        {
            "name": "jsonschema",
            "specs": [
                [
                    "~=",
                    "4.17.1"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    "~=",
                    "8.1.2"
                ]
            ]
        }
    ],
    "lcname": "aaz-dev"
}
        
Elapsed time: 0.25827s