Skip to content

Commit a708199

Browse files
Copilotmsyyc
andauthored
Remove multiapi documentation (#42749)
* Initial plan * Remove multiapi documentation and references as requested Co-authored-by: msyyc <[email protected]> * Fix remaining reference to removed multi_api folder Co-authored-by: msyyc <[email protected]> * Update generation.md * Address reviewer feedback: remove multiapi sentence and restore changelog link to commit Co-authored-by: msyyc <[email protected]> * Remove outdated multi-api reference from get_private_package.md Co-authored-by: msyyc <[email protected]> * Remove empty multiapi section and renumber steps in get_private_package.md Co-authored-by: msyyc <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: msyyc <[email protected]> Co-authored-by: Yuchao Yan <[email protected]>
1 parent 5879399 commit a708199

File tree

13 files changed

+8
-638
lines changed

13 files changed

+8
-638
lines changed

doc/dev/mgmt/generation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ Autorest doesn't write the version number in the generated code, but a few indic
2828
A basic autorest command line will looks like this:
2929

3030
```shell
31-
autorest readme.md --python --use="@microsoft.azure/autorest.python@~4.0.71" --python-mode=update --python-sdks-folder=<root of sdk clone>/sdks/ --no-async --multiapi
31+
autorest readme.md --python --use="@microsoft.azure/autorest.python@~4.0.71" --python-mode=update --python-sdks-folder=<root of sdk clone>/sdks/ --no-async
3232
```
3333

34-
Which means "Generate the Python code for the Swagger mentioned in this readme, using autorest for Pyton v4.0.71 or above (but not v5), do not generate async files, generate multiapi if supported (if not ignore), and assume the package was already generated and it's an update"
34+
Which means "Generate the Python code for the Swagger mentioned in this readme, using autorest for Python v4.0.71 or above (but not v5), do not generate async files, and assume the package was already generated and it's an update"
3535

3636
In practical terms, this is not necessary since the Python SDK has the necessary tooling to simplify to just specify the readme.md:
3737

doc/dev/mgmt/mgmt_release.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,7 @@ Example:
125125
- Added operation group TrafficManagerUserMetricsKeysOperations
126126
```
127127
128-
### Note on multi-api packages
129128
130-
If a package is using multi-api, this means it contains several Autorest generated folder. The tool will then build one report per Autorest generation.
131-
132-
To simplify the change log call, the code report also build a "merged_report" that will merge correctly all api-versions and build a report suitable *for the default floating latest*
133129
134130
Example of output if call with network:
135131
```shell

doc/dev/mgmt/multiapi.md

Lines changed: 0 additions & 119 deletions
This file was deleted.

doc/dev/mgmt/swagger/multi_api/readme.md

Lines changed: 0 additions & 67 deletions
This file was deleted.

doc/dev/mgmt/swagger/multi_api/readme.python.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

doc/dev/mgmt/swagger_conf.md

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ In practical terms, we want to control the version of Autorest used, the output
1414

1515
## Writing the readme
1616

17-
Writing the readme is the responsibility of the Python SDK team. There is currently two types of templates for Python readmes:
17+
Writing the readme is the responsibility of the Python SDK team. There is currently one type of template for Python readmes:
1818
- Readme that handles only one API version, and generates packages that handle one API version only
19-
- Readme that handles several API versions, and generates packages with multiples API and profile supports
2019

21-
These templates can be found in the [single_api](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/mgmt/swagger/single_api) and the [multi_api](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/mgmt/swagger/multi_api) folders.
20+
Templates can be found in the [single_api](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/mgmt/swagger/single_api) folder.
2221

2322

2423
### Single API readmes
@@ -27,31 +26,5 @@ This one is the most simple:
2726
- Copy the [readme.python.md](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/mgmt/swagger/single_api/readme.python.md) and replace `servicetoreplace` by your service name
2827
- Be sure the main [readme.md](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/mgmt/swagger/single_api/readme.md) contains a "swagger-to-sdk" section with Python
2928

30-
### Multi API readmes
3129

32-
When doing multi-api packages, it means you have shipping several "tags" of the main readme as one package. Autorest is calling this process a "batch" call, and this is the purpose of the "batch" section in [readme.python.md](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/mgmt/swagger/multi_api/readme.python.md).
33-
34-
In order to be sure the correct tags exist, you can use the following script:
35-
```shell
36-
python ./scripts/multi_api_readme_help.py /azure-rest-api-specs/specification/service/resource-manager/
37-
```
38-
39-
This script will analyze the Swaggers available, and suggests on stdout:
40-
- A list of tags for the main [readme.md](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/mgmt/swagger/multi_api/readme.md)
41-
- A batch declaration for the [readme.python.md](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/mgmt/swagger/multi_api/readme.python.md)
42-
43-
This script is not perfect that it *does* require manual review of the output and not a direct copy/paste.
44-
45-
It's important for Python that tags represents only *ONE* unique API version. It's why it's pretty common that Python uses a set of tags that other languages don't use.
46-
47-
Once you know the list of tags you need to generate:
48-
49-
- Copy the [readme.python.md](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/mgmt/swagger/multi_api/readme.python.md) and replace `servicetoreplace` by your service name
50-
- Update the batch list of [readme.python.md](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/mgmt/swagger/multi_api/readme.python.md)
51-
- Be sure you have one tag section for each batch entry in [readme.python.md](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/mgmt/swagger/multi_api/readme.python.md)
52-
- Be sure the main [readme.md](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/mgmt/swagger/multi_api/readme.md) contains a "swagger-to-sdk" section with Python with an `afterscripts` section like the one in the template.
53-
54-
The `afterscripts` will execute a Jinja template to create a client to link together all the batch generated autorest ([example](https://github.com/Azure/azure-sdk-for-python/blob/4a7c67189591b052fe2b5769847ff68f7845386d/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py))
55-
56-
This script will infer a default `LATEST_PROFILE`. You can change this behavior and force the default API version if necessary ([example](https://github.com/Azure/azure-rest-api-specs/blob/49238f0b2917452311e71dd43c4164de70af3721/specification/authorization/resource-manager/readme.md#swagger-to-sdk))
5730

doc/dev/private_package/get_private_package.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,13 @@ Make sure your target tag is defined in `readme.md` and **default tag is same wi
1010

1111
![](default_tag.png)
1212

13-
## 2.Configure `readme.python.md`
14-
15-
If there is no `Python multi-api` in `readme.python.md`(i.e. [datadog](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/datadog/resource-manager/readme.python.md)), skip this step.
16-
17-
If there is `Python multi-api` in `readme.python.md` (i.e. [network](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/network/resource-manager/readme.python.md#python-multi-api)), you need additional configuration: [Python Multiapi Configuration](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/private_package/python_multiapi_configuration.md)
18-
19-
## 3.Trigger pipeline
13+
## 2.Trigger pipeline
2014

2115
Submit a PR or draft PR to [Azure/azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs)
2216

2317
![](unreleased_package_guide_example1.png)
2418

25-
## 4.Get private package
19+
## 3.Get private package
2620

2721
Wait until pipelines finish, then there will be wheel and zip of the package. Just Click to download them.
2822

@@ -32,7 +26,7 @@ If there is no link in the figure above, it may be folded. You can also find it
3226

3327
![img.png](unreleased_package_guide_example3.png)
3428

35-
## 5.Build private package locally (backup solution)
29+
## 4.Build private package locally (backup solution)
3630

3731
Because of security issue, maybe there is no private link to download. Since there is still auto generated PR provided, you can build the private package locally based on the PR with [guidance](https://github.com/Azure/azure-sdk-for-python/wiki/Common-issues-about-Python-SDK#build-private-package-with-pr)
3832

0 commit comments

Comments
 (0)