Skip to content

Commit

Permalink
[python]track2 config for some services (#15007)
Browse files Browse the repository at this point in the history
* consumption

* delete track1 config
  • Loading branch information
msyyc authored Jun 29, 2021
1 parent 4bab0bf commit 0abc049
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 132 deletions.
50 changes: 5 additions & 45 deletions specification/advisor/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,62 +85,22 @@ This is not used by Autorest itself.
``` yaml $(swagger-to-sdk)
swagger-to-sdk:
- repo: azure-sdk-for-net
- repo: azure-sdk-for-python
- repo: azure-sdk-for-python-track2
- repo: azure-sdk-for-java
- repo: azure-sdk-for-go
- repo: azure-sdk-for-js
- repo: azure-sdk-for-node
- repo: azure-resource-manager-schemas
```

## Python

These settings apply only when `--python` is specified on the command line.
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.
Use `--python-mode=update` if you already have a setup.py and just want to update the code itself.

``` yaml $(python) && !$(track2)
python-mode: create
python:
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
payload-flattening-threshold: 2
namespace: azure.mgmt.advisor
package-name: azure-mgmt-advisor
package-version: 1.0.1
clear-output-folder: true
```

``` yaml $(python) && $(track2)
python-mode: create
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
namespace: azure.mgmt.advisor
package-name: azure-mgmt-advisor
package-version: 9.0.0b1
clear-output-folder: true
```

``` yaml $(python) && $(python-mode) == 'update'
no-namespace-folders: true
output-folder: $(python-sdks-folder)/advisor/azure-mgmt-advisor/azure/mgmt/advisor
python:
no-namespace-folders: true
output-folder: $(python-sdks-folder)/advisor/azure-mgmt-advisor/azure/mgmt/advisor
```

``` yaml $(python) && $(python-mode) == 'create'
basic-setup-py: true
output-folder: $(python-sdks-folder)/advisor/azure-mgmt-advisor
python:
basic-setup-py: true
output-folder: $(python-sdks-folder)/advisor/azure-mgmt-advisor
```

## Go

See configuration in [readme.go.md](./readme.go.md)

## Python

See configuration in [readme.python.md](./readme.python.md)

## C#

These settings apply only when `--csharp` is specified on the command line.
Expand Down
24 changes: 24 additions & 0 deletions specification/advisor/resource-manager/readme.python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Python

These settings apply only when `--python` is specified on the command line.
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.
Use `--python-mode=update` if you already have a setup.py and just want to update the code itself.

``` yaml $(python) && $(track2)
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
namespace: azure.mgmt.advisor
package-name: azure-mgmt-advisor
package-version: 9.0.0b1
clear-output-folder: true
```
``` yaml $(python) && $(python-mode) == 'update' && $(track2)
no-namespace-folders: true
output-folder: $(python-sdks-folder)/advisor/azure-mgmt-advisor/azure/mgmt/advisor
```
``` yaml $(python) && $(python-mode) == 'create' && $(track2)
basic-setup-py: true
output-folder: $(python-sdks-folder)/advisor/azure-mgmt-advisor
```
42 changes: 2 additions & 40 deletions specification/commerce/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ This is not used by Autorest itself.

``` yaml $(swagger-to-sdk)
swagger-to-sdk:
- repo: azure-sdk-for-python
after_scripts:
- python ./scripts/multiapi_init_gen.py azure-mgmt-commerce
- repo: azure-sdk-for-python-track2
- repo: azure-sdk-for-java
- repo: azure-sdk-for-go
- repo: azure-sdk-for-js
Expand All @@ -75,43 +73,7 @@ swagger-to-sdk:

## Python

These settings apply only when `--python` is specified on the command line.
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.
Use `--python-mode=update` if you already have a setup.py and just want to update the code itself.

``` yaml $(python)
python-mode: create
python:
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
payload-flattening-threshold: 2
namespace: azure.mgmt.commerce
package-name: azure-mgmt-commerce
clear-output-folder: true
no-namespace-folders: true
```

### Python multi-api

Generate all API versions currently shipped for this package

```yaml $(python) && $(multiapi)
batch:
- tag: package-2015-06-preview
```

### Tag: package-2015-06-preview and python

These settings apply only when `--tag=package-2015-06-preview --python` is specified on the command line.
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.

``` yaml $(tag) == 'package-2015-06-preview' && $(python)
namespace: azure.mgmt.commerce.v2015_06_01_preview
output-folder: $(python-sdks-folder)/commerce/azure-mgmt-commerce/azure/mgmt/commerce/v2015_06_01_preview
python:
namespace: azure.mgmt.commerce.v2015_06_01_preview
output-folder: $(python-sdks-folder)/commerce/azure-mgmt-commerce/azure/mgmt/commerce/v2015_06_01_preview
```
See configuration in [readme.python.md](./readme.python.md)

## Go

Expand Down
48 changes: 48 additions & 0 deletions specification/commerce/resource-manager/readme.python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
## Python

These settings apply only when `--track2` is specified on the command line.

``` yaml $(track2)
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
package-name: azure-mgmt-commerce
package-version: 1.0.0b1
no-namespace-folders: true
```
### Python multi-api
Generate all API versions currently shipped for this package
```yaml $(multiapi)
clear-output-folder: true
batch:
- tag: package-2015-06-preview
- multiapiscript: true
```
``` yaml $(multiapiscript)
output-folder: $(python-sdks-folder)/commerce/azure-mgmt-commerce/azure/mgmt/commerce/
clear-output-folder: false
perform-load: false
```
### Tag: package-2015-06-preview and python
These settings apply only when `--tag=package-2015-06-preview --python` is specified on the command line.
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.

``` yaml $(tag) == 'package-2015-06-preview'
namespace: azure.mgmt.commerce.v2015_06_01_preview
output-folder: $(python-sdks-folder)/commerce/azure-mgmt-commerce/azure/mgmt/commerce/v2015_06_01_preview
```

``` yaml $(python) && $(track2)
modelerfour:
lenient-model-deduplication: true
directive:
- from: swagger-document
where: $.definitions.OfferTermInfo.properties.Name
transform: >
$['x-ms-enum']['name'] = 'OfferTermInfoEnum';
```
1 change: 0 additions & 1 deletion specification/consumption/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ This is not used by Autorest itself.
swagger-to-sdk:
- repo: azure-sdk-for-net
- repo: azure-sdk-for-go
- repo: azure-sdk-for-python
- repo: azure-sdk-for-python-track2
- repo: azure-sdk-for-java
- repo: azure-sdk-for-js
Expand Down
25 changes: 4 additions & 21 deletions specification/consumption/resource-manager/readme.python.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,23 @@ These settings apply only when `--python` is specified on the command line.
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.
Use `--python-mode=update` if you already have a setup.py and just want to update the code itself.

``` yaml $(python) && !$(track2)
python-mode: create
python:
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
payload-flattening-threshold: 2
namespace: azure.mgmt.consumption
package-name: azure-mgmt-consumption
package-version: 2.0.0
clear-output-folder: true
```

``` yaml $(python) && $(track2)
python-mode: create
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
payload-flattening-threshold: 2
namespace: azure.mgmt.consumption
package-name: azure-mgmt-consumption
package-version: 2.0.0
package-version: 1.0.0b1
clear-output-folder: true
```
``` yaml $(python) && $(python-mode) == 'update'
python:
no-namespace-folders: true
output-folder: $(python-sdks-folder)/consumption/azure-mgmt-consumption/azure/mgmt/consumption
``` yaml $(python) && $(python-mode) == 'update' && $(track2)
no-namespace-folders: true
output-folder: $(python-sdks-folder)/consumption/azure-mgmt-consumption/azure/mgmt/consumption
```
``` yaml $(python) && $(python-mode) == 'create'
python:
basic-setup-py: true
output-folder: $(python-sdks-folder)/consumption/azure-mgmt-consumption
``` yaml $(python) && $(python-mode) == 'create' && $(track2)
basic-setup-py: true
output-folder: $(python-sdks-folder)/consumption/azure-mgmt-consumption
```
1 change: 0 additions & 1 deletion specification/reservations/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ This is not used by Autorest itself.
``` yaml $(swagger-to-sdk)
swagger-to-sdk:
- repo: azure-sdk-for-net
- repo: azure-sdk-for-python
- repo: azure-sdk-for-python-track2
- repo: azure-sdk-for-go
- repo: azure-sdk-for-js
Expand Down
25 changes: 1 addition & 24 deletions specification/reservations/resource-manager/readme.python.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,15 @@ These settings apply only when `--python` is specified on the command line.
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.
Use `--python-mode=update` if you already have a setup.py and just want to update the code itself.

``` yaml $(python) && !$(track2)
python-mode: create
python:
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
payload-flattening-threshold: 2
namespace: azure.mgmt.reservations
package-name: azure-mgmt-reservations
package-version: 0.3.2
clear-output-folder: true
```
``` yaml $(python) && $(track2)
python-mode: create
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
namespace: azure.mgmt.reservations
package-name: azure-mgmt-reservations
package-version: 0.3.2
package-version: 1.0.0b1
clear-output-folder: true
```
``` yaml $(python) && $(python-mode) == 'update' && !$(track2)
python:
no-namespace-folders: true
output-folder: $(python-sdks-folder)/reservations/azure-mgmt-reservations/azure/mgmt/reservations
```
``` yaml $(python) && $(python-mode) == 'create' && !$(track2)
python:
basic-setup-py: true
output-folder: $(python-sdks-folder)/reservations/azure-mgmt-reservations
```
``` yaml $(python) && $(python-mode) == 'update' && $(track2)
no-namespace-folders: true
output-folder: $(python-sdks-folder)/reservations/azure-mgmt-reservations/azure/mgmt/reservations
Expand Down

0 comments on commit 0abc049

Please sign in to comment.