aaz-dev


Nameaaz-dev JSON
Version 3.1.0 PyPI version JSON
download
home_pagehttps://github.com/Azure/aaz-dev-tools
SummaryMicrosoft Atomic Azure CLI Commands Developer Tools
upload_time2024-10-18 06:30:56
maintainerNone
docs_urlNone
authorMicrosoft Corporation
requires_python>=3.8
licenseMIT
keywords azure
VCS
bugtrack_url
requirements No requirements were recorded.
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 and <= 3.12 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.12
    ```bash
    python3.12 --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.12 -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 aaz-dev-tools

- For Windows
    - Powershell
    ```
    pip install aaz-dev
    ```
    - Command Prompt
    ```
    pip install aaz-dev
    ```
- For linux
    ```bash
    pip install aaz-dev
    ```

#### 4.2 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
  ```

### 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/a7/fd/616a13626e46794414ee6a54a0dbe63fa0ab4ab6aa473c99439f1f349f73/aaz_dev-3.1.0.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 and <= 3.12 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.12\n    ```bash\n    python3.12 --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.12 -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 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\n#### 4.2 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\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": "3.1.0",
    "project_urls": {
        "Homepage": "https://github.com/Azure/aaz-dev-tools"
    },
    "split_keywords": [
        "azure"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fdc1d6d18b4c2d2a2b853e3908818188052f89bd60f64e9f57625c66cfa78dae",
                "md5": "f2adf67fca220ea0395c35983bfe0c45",
                "sha256": "03471931da44545d4533dc219f57b65e315877de05f9e48ae1595493b9138718"
            },
            "downloads": -1,
            "filename": "aaz_dev-3.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f2adf67fca220ea0395c35983bfe0c45",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 1552822,
            "upload_time": "2024-10-18T06:30:58",
            "upload_time_iso_8601": "2024-10-18T06:30:58.492803Z",
            "url": "https://files.pythonhosted.org/packages/fd/c1/d6d18b4c2d2a2b853e3908818188052f89bd60f64e9f57625c66cfa78dae/aaz_dev-3.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a7fd616a13626e46794414ee6a54a0dbe63fa0ab4ab6aa473c99439f1f349f73",
                "md5": "1185f3bbb177a6b863862353ca9796c3",
                "sha256": "6a9b4ee8cc1c930bb3b9b52f932ce4e83e61c42c8deca8dea228e93d5c6444a3"
            },
            "downloads": -1,
            "filename": "aaz_dev-3.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1185f3bbb177a6b863862353ca9796c3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1477158,
            "upload_time": "2024-10-18T06:30:56",
            "upload_time_iso_8601": "2024-10-18T06:30:56.421197Z",
            "url": "https://files.pythonhosted.org/packages/a7/fd/616a13626e46794414ee6a54a0dbe63fa0ab4ab6aa473c99439f1f349f73/aaz_dev-3.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-18 06:30:56",
    "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": [],
    "lcname": "aaz-dev"
}
        
Elapsed time: 0.34139s