@@ -86,8 +86,7 @@ This is not used by Autorest itself.
86
86
87
87
``` yaml $(swagger-to-sdk)
88
88
swagger-to-sdk:
89
- - repo: azure-sdk-for-python // for track1 SDK
90
- - repo: azure-sdk-for-python-track2 // for track2 SDK
89
+ - repo: azure-sdk-for-python-track2
91
90
- ...
92
91
93
92
@@ -103,58 +102,32 @@ A typical readme.python.md is like this:
103
102
~~~
104
103
// file: readme.python.md
105
104
106
-
107
105
## Python
108
106
109
107
These settings apply only when `--python` is specified on the command line.
110
108
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.
111
109
Use `--python-mode=update` if you already have a setup.py and just want to update the code itself.
112
110
113
- ``` yaml !$(track2) // For track1: basic Python package information
114
- python-mode: create
115
- python:
116
- azure-arm: true
117
- license-header: MICROSOFT_MIT_NO_VERSION
118
- payload-flattening-threshold: 2
119
- namespace: azure.mgmt.appconfiguration
120
- package-name: azure-mgmt-appconfiguration
121
- package-version: 0.1.0
122
- clear-output-folder: true
123
- ```
124
-
125
- ``` yaml $(python-mode) == 'update' && !$(track2)
126
- python:
127
- no-namespace-folders: true
128
- output-folder: $(python-sdks-folder)/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration
129
- ```
130
111
131
- ``` yaml $(python-mode) == 'create' && !$(track2)
132
- python:
133
- basic-setup-py: true
134
- output-folder: $(python-sdks-folder)/appconfiguration/azure-mgmt-appconfiguration
135
- ```
112
+ ## Python
136
113
137
- These settings apply only when `--track2` is specified on the command line.
114
+ These settings apply only when `--python` is specified on the command line.
115
+ Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.
138
116
139
- ``` yaml $(track2) // For track2: basic Python package information
117
+ ``` yaml $(python)
140
118
azure-arm: true
141
119
license-header: MICROSOFT_MIT_NO_VERSION
142
- package-name: azure-mgmt-appconfiguration
143
- no-namespace-folders: true
144
- package-version: 0.1.0
120
+ package-name: azure-mgmt-[[ServiceName]]
121
+ namespace: azure.mgmt.[[ServiceName]]
122
+ package-version: 1.0.0b1
123
+ clear-output-folder: true
145
124
```
146
125
147
- ``` yaml $(python-mode) == 'update' && $(track2 )
126
+ ``` yaml $(python)
148
127
no-namespace-folders: true
149
- output-folder: $(python-sdks-folder)/appconfiguration /azure-mgmt-appconfiguration /azure/mgmt/appconfiguration
128
+ output-folder: $(python-sdks-folder)/[[ServiceName]] /azure-mgmt-[[ServiceName]] /azure/mgmt/[[ServiceName]]
150
129
```
151
130
152
- ``` yaml $(python-mode) == 'create' && $(track2)
153
- basic-setup-py: true
154
- output-folder: $(python-sdks-folder)/appconfiguration/azure-mgmt-appconfiguration
155
- ```
156
- ~~~
157
-
158
131
## Multi-API
159
132
Multi-API SDK is a package that support multiple REST api-versions. With Python multi-api SDK, the end user can assign api-version for REST calls explicitly; nevertheless, they can also use the default api-version which is choosed as the latest stable api-version.
160
133
@@ -170,23 +143,16 @@ The batch is a tag list which are used in the multi-api package. For example:
170
143
171
144
Generate all API versions currently shipped for this package
172
145
173
- ```yaml $(multiapi) && !$(track2) // For track1
174
- batch:
175
- - tag: package-2020-06-01-only
176
- - tag: package-2020-05-01-only
177
- ```
178
-
179
- ```yaml $(multiapi) && $(track2) // For track2
146
+ ``` yaml $(multiapi) && $(python)
180
147
clear-output-folder : true
181
148
batch :
182
149
- tag : package-2020-06-01-only
183
150
- tag : package-2020-05-01-only
184
151
- multiapiscript : true
185
152
` ` `
186
153
187
- ``` yaml $(multiapiscript) && $(track2) // For track2
154
+ ` ` ` yaml $(multiapiscript) && $(python)
188
155
output-folder : $(python-sdks-folder)/compute/azure-mgmt-compute/azure/mgmt/compute/
189
- clear-output-folder: false
190
156
perform-load : false
191
157
` ` `
192
158
~~~
@@ -201,40 +167,21 @@ Then, the output folder and namespace should be configured for each of the tag.
201
167
These settings apply only when ` --tag=package-2020-06-01-only --python` is specified on the command line.
202
168
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.
203
169
204
- ``` yaml $(tag) == 'package-2020-06-01-only' && $(track2) // For track2
170
+ ` ` ` yaml $(tag) == 'package-2020-06-01-only' && $(python)
205
171
namespace: azure.mgmt.compute.v2020_06_01
206
172
output-folder: $(python-sdks-folder)/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01
207
173
` ` `
208
174
~~~
209
175
210
176
211
- ### multi-api init script
212
- For track1, multi-api init script need to be configured in readme.md. For example:
213
-
214
- ~~~
215
- // file: readme.md
216
-
217
- swagger-to-sdk:
218
- - repo: azure-sdk-for-python
219
- after_scripts:
220
- - python ./scripts/multiapi_init_gen.py azure-mgmt-compute
221
- ~~~
222
-
223
-
224
177
# # Run codegen
225
178
After configure all the readme files, autorest can be used to generate SDK.
226
179
227
- ### Track1 (for Autorest V2)
228
- Track1 SDK is based on AutoRest version V2 that's going to be replaced by version V3.
229
-
230
- ~~~
231
- > autorest --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=C:\ZZ\projects\codegen\azure-sdk-for-python\sdk [email protected] /autorest.python@~4.0.71 --version=V2 ..\azure-rest-api-specs\specification\appconfiguration\resource-manager\readme.md
232
- ~~~
233
180
234
181
# ## Track2 (for latest Autorest)
235
182
Track 2 is based on the latest AutoRest code generator
236
183
237
184
~~~
238
185
> autorest --reset
239
186
> autorest --python --track2 --use=@autorest/[email protected] --python-sdks-folder=..\azure-sdk-for-python\sdk --multiapi --python-mode=update ..\azure-rest-api-specs\specification\appconfiguration\resource-manager\readme.md
240
- ~~~
187
+ ~~~
0 commit comments