Skip to content

Commit ec499b9

Browse files
authored
[APIView] update the UI Python build wheel command (#12016)
1 parent 08722bb commit ec499b9

3 files changed

Lines changed: 66 additions & 66 deletions

File tree

src/dotnet/APIView/APIViewWeb/Pages/Shared/_ReviewUploadHelp.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<ol>
4242
<li>
4343
Generate wheel for the package.
44-
<code>python setup.py bdist_wheel -d [dest_folder]</code>
44+
<code>pip install build; python -m build --wheel --outdir [dest_folder]</code>
4545
</li>
4646
<li>
4747
Upload generated whl file
Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
1-
# APIView
2-
3-
APIView tool is used by archboard reviewers to review API signatures of all public APIs available in Azure SDK packages. This tool generates public API surface level revisions which shows all publicly available classes, methods, properties etc. This makes it easier to identify if there are any breaking changes.
4-
5-
## How does it retrieve public API information
6-
7-
Developers can upload package or an abstract file generated based on each language into APIView tool. APIView tool has a language processor for each language it supports and these individual language processor extracts API stub information and create json APIView file that is processed by tool. APIView tool stores original uploaded file and generated json file in its data store. Revision pages are rendered using this generated json file which contains tokens to present language keywords, links etc. Tool also allows user to recreate review json from stored original file if language package processor itself is updated.
8-
9-
## How to create an API revision manually
10-
11-
API revisions can be created by uploading an artifact to APIView tool. Type of the artifact is different across each language. Some language, for e.g., Swift requires developer to run parser tool locally to generate stub file and upload json stub file instead of any artifact. Following are the detailed instructions on how to create revisions for each language.
12-
13-
### C#
14-
Run `dotnet pack` for the required package to generate Nuget file. Upload the resulting .nupkg file using `Create Review` link in APIView.
15-
16-
### C
17-
1. Install clang 10 or later.
18-
2. Run clang [inputs like az_*.h] -Xclang -ast-dump=json -I ..\..\..\core\core\inc -I "c:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.26.28801\include\" > az_core.ast
19-
3. Archive the file Compress-Archive az_core.ast -DestinationPath az_core.zip
20-
4. Upload the resulting archive using `Create Review` link in APIView.
21-
22-
### C++
23-
1. Install clang 10 or later. Your environment may require additional include directories.
24-
2. Run clang++ [input like .\sdk\storage\azure-storage-files-datalake\inc\azure\storage\files\datalake\datalake.hpp] -I .\sdk\storage\azure-storage-files-datalake\inc -I .\sdk\core\azure-core\inc -Xclang -ast-dump -I .\sdk\storage\azure-storage-common\inc -I .\sdk\storage\azure-storage-blobs\inc > Azure_Storage_Files_Datalake.ast
25-
3. Archive the file Compress-Archive Azure_Storage_Files_Datalake.ast -DestinationPath Azure_Storage_Files_Datalake.zip
26-
4. Rename the file Rename-Item Azure_Storage_Files_Datalake.zip -NewName Azure_Storage_Files_Datalake.cppast
27-
5. Upload the resulting archive using `Create Review` link in APIView.
28-
29-
### Go
30-
1. Archive source module directory in which go.mod is present. Compress-Archive ./sdk/azcore -DestinationPath azcore.zip
31-
2. Rename the file Rename-Item azcore.zip -NewName azcore.gosource
32-
3. Upload the resulting archive.
33-
34-
### Java
35-
1. Run `mvn package` build on your project, which will generate a number of build artifacts in the `/target` directory. In there, find the file ending `sources.jar`, and select it.
36-
2. Upload the selected file to APIView tool using `Create Review` link.
37-
38-
### JS/TS
39-
1. Use api-extractor to generate a [docModel](https://api-extractor.com/pages/setup/generating_docs/) file
40-
2. Upload generated api.json file using `Create Review` link.
41-
42-
### Python
43-
1. Generate wheel for the package. python setup.py bdist_wheel -d [dest_folder]
44-
2. Upload generated whl file
45-
46-
### Swagger
47-
Swagger API revisions can be generated manually by uploading swagger file to APIView if you are trying to generate API revision for a single swagger file. Swagger API revision is automatically generated when swagger files are modified in a pull request and pull request comment shows a link to generated APIView. Automatically generated API revision from pull request creates a diff using existing swagger files in the target branch as baseline to show API level changes in pull request.
48-
49-
You can rename a swagger file as mentioned below and upload it to APIView if you need to generate an API revision manually from swagger.
50-
1. Rename swagger json to replace file extension to .swagger `Rename-Item PetSwagger.json -NewName PetSwagger.swagger`
51-
2. Upload renamed `.swagger` file
52-
53-
### TypeSpec
54-
TypeSpec API revision is generated automatically from a pull request and this should be good enough in most scenarios. You can also generate API revision manually for a TypeSpec package by providing URL path to TypeSpec package specification root path.
55-
1. Click and `Create Review` and select TypeSpec from language dropdown.
56-
2. Provide URL to typespec project root path.
1+
# APIView
2+
3+
APIView tool is used by archboard reviewers to review API signatures of all public APIs available in Azure SDK packages. This tool generates public API surface level revisions which shows all publicly available classes, methods, properties etc. This makes it easier to identify if there are any breaking changes.
4+
5+
## How does it retrieve public API information
6+
7+
Developers can upload package or an abstract file generated based on each language into APIView tool. APIView tool has a language processor for each language it supports and these individual language processor extracts API stub information and create json APIView file that is processed by tool. APIView tool stores original uploaded file and generated json file in its data store. Revision pages are rendered using this generated json file which contains tokens to present language keywords, links etc. Tool also allows user to recreate review json from stored original file if language package processor itself is updated.
8+
9+
## How to create an API revision manually
10+
11+
API revisions can be created by uploading an artifact to APIView tool. Type of the artifact is different across each language. Some language, for e.g., Swift requires developer to run parser tool locally to generate stub file and upload json stub file instead of any artifact. Following are the detailed instructions on how to create revisions for each language.
12+
13+
### C#
14+
Run `dotnet pack` for the required package to generate Nuget file. Upload the resulting .nupkg file using `Create Review` link in APIView.
15+
16+
### C
17+
1. Install clang 10 or later.
18+
2. Run clang [inputs like az_*.h] -Xclang -ast-dump=json -I ..\..\..\core\core\inc -I "c:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.26.28801\include\" > az_core.ast
19+
3. Archive the file Compress-Archive az_core.ast -DestinationPath az_core.zip
20+
4. Upload the resulting archive using `Create Review` link in APIView.
21+
22+
### C++
23+
1. Install clang 10 or later. Your environment may require additional include directories.
24+
2. Run clang++ [input like .\sdk\storage\azure-storage-files-datalake\inc\azure\storage\files\datalake\datalake.hpp] -I .\sdk\storage\azure-storage-files-datalake\inc -I .\sdk\core\azure-core\inc -Xclang -ast-dump -I .\sdk\storage\azure-storage-common\inc -I .\sdk\storage\azure-storage-blobs\inc > Azure_Storage_Files_Datalake.ast
25+
3. Archive the file Compress-Archive Azure_Storage_Files_Datalake.ast -DestinationPath Azure_Storage_Files_Datalake.zip
26+
4. Rename the file Rename-Item Azure_Storage_Files_Datalake.zip -NewName Azure_Storage_Files_Datalake.cppast
27+
5. Upload the resulting archive using `Create Review` link in APIView.
28+
29+
### Go
30+
1. Archive source module directory in which go.mod is present. Compress-Archive ./sdk/azcore -DestinationPath azcore.zip
31+
2. Rename the file Rename-Item azcore.zip -NewName azcore.gosource
32+
3. Upload the resulting archive.
33+
34+
### Java
35+
1. Run `mvn package` build on your project, which will generate a number of build artifacts in the `/target` directory. In there, find the file ending `sources.jar`, and select it.
36+
2. Upload the selected file to APIView tool using `Create Review` link.
37+
38+
### JS/TS
39+
1. Use api-extractor to generate a [docModel](https://api-extractor.com/pages/setup/generating_docs/) file
40+
2. Upload generated api.json file using `Create Review` link.
41+
42+
### Python
43+
1. Generate wheel for the package. pip install build; python -m build --wheel --outdir [dest_folder]
44+
2. Upload generated whl file
45+
46+
### Swagger
47+
Swagger API revisions can be generated manually by uploading swagger file to APIView if you are trying to generate API revision for a single swagger file. Swagger API revision is automatically generated when swagger files are modified in a pull request and pull request comment shows a link to generated APIView. Automatically generated API revision from pull request creates a diff using existing swagger files in the target branch as baseline to show API level changes in pull request.
48+
49+
You can rename a swagger file as mentioned below and upload it to APIView if you need to generate an API revision manually from swagger.
50+
1. Rename swagger json to replace file extension to .swagger `Rename-Item PetSwagger.json -NewName PetSwagger.swagger`
51+
2. Upload renamed `.swagger` file
52+
53+
### TypeSpec
54+
TypeSpec API revision is generated automatically from a pull request and this should be good enough in most scenarios. You can also generate API revision manually for a TypeSpec package by providing URL path to TypeSpec package specification root path.
55+
1. Click and `Create Review` and select TypeSpec from language dropdown.
56+
2. Provide URL to typespec project root path.

src/dotnet/APIView/ClientSPA/src/app/_components/revisions-list/revisions-list.component.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export class RevisionsListComponent implements OnInit, OnChanges {
130130
details = (filters.details.value != null) ? filters.details.value.map((item: any) => item.data): details;
131131
}
132132

133-
this.apiRevisionsService.getAPIRevisions(noOfItemsRead, pageSize, reviewId, label, author, details, sortField, sortOrder,
133+
this.apiRevisionsService.getAPIRevisions(noOfItemsRead, pageSize, reviewId, label, author, details, sortField, sortOrder,
134134
this.showDeletedAPIRevisions, this.showAPIRevisionsAssignedToMe).subscribe({
135135
next: (response: any) => {
136136
if (response.result && response.pagination) {
@@ -176,7 +176,7 @@ export class RevisionsListComponent implements OnInit, OnChanges {
176176
{ label: 'Restore', icon: 'pi pi-folder-open', disabled: disableDeleteOrRestore, command: () => this.viewRevision(this.selectedRevision) }
177177
];
178178
}
179-
else
179+
else
180180
{
181181
this.contextMenuItems = [
182182
{ label: 'View', icon: 'pi pi-folder-open', command: () => this.viewRevision(this.selectedRevision) },
@@ -203,7 +203,7 @@ export class RevisionsListComponent implements OnInit, OnChanges {
203203
];
204204
}
205205

206-
createRevisionFilters() {
206+
createRevisionFilters() {
207207
this.details = [
208208
{
209209
label: 'Status',
@@ -240,7 +240,7 @@ export class RevisionsListComponent implements OnInit, OnChanges {
240240
this.apiRevisionsService.openDiffOfAPIRevisions(this.selectedRevisions[0], this.selectedRevisions[1], this.route);
241241
}
242242
}
243-
243+
244244
viewRevision(apiRevision: APIRevision) {
245245
if (!this.showDeletedAPIRevisions)
246246
{
@@ -293,7 +293,7 @@ export class RevisionsListComponent implements OnInit, OnChanges {
293293
*/
294294
tableHasFilters() : boolean {
295295
return (
296-
this.sortField != "lastUpdatedOn" || this.sortOrder != 1 ||
296+
this.sortField != "lastUpdatedOn" || this.sortOrder != 1 ||
297297
(this.filters && (this.filters.label.value != null || this.filters.author.value != null || this.filters.details.value != null)) ||
298298
this.showDeletedAPIRevisions || this.showAPIRevisionsAssignedToMe);
299299
}
@@ -495,7 +495,7 @@ export class RevisionsListComponent implements OnInit, OnChanges {
495495
switch(this.createRevisionForm.get('selectedCRLanguage')?.value?.data){
496496
case "C":
497497
this.createRevisionInstruction = [
498-
`Install clang 10 or later.`,
498+
`Install clang 10 or later.`,
499499
`Run <code>clang [inputs like az_*.h] -Xclang -ast-dump=json -I ..\\..\\..\\core\\core\\inc -I "c:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.26.28801\\include\\" > az_core.ast</code>`,
500500
`Archive the file <code>Compress-Archive az_core.ast -DestinationPath az_core.zip</code>`,
501501
`Upload the resulting archive.`
@@ -506,7 +506,7 @@ export class RevisionsListComponent implements OnInit, OnChanges {
506506
break;
507507
case "C#":
508508
this.createRevisionInstruction = [
509-
`Run <code>dotnet pack</code>`,
509+
`Run <code>dotnet pack</code>`,
510510
`Upload the resulting .nupkg or .dll file.`
511511
];
512512
this.acceptedFilesForReviewUpload = ".nupkg, .dll";
@@ -532,7 +532,7 @@ export class RevisionsListComponent implements OnInit, OnChanges {
532532
break;
533533
case "Python":
534534
this.createRevisionInstruction = [
535-
`Generate wheel for the package. <code>python setup.py bdist_wheel -d [dest_folder]</code>`,
535+
`Generate wheel for the package. <code>pip install build; python -m build --wheel --outdir [dest_folder]</code>`,
536536
`Upload generated whl file`
537537
];
538538
this.acceptedFilesForReviewUpload = ".whl";
@@ -598,7 +598,7 @@ export class RevisionsListComponent implements OnInit, OnChanges {
598598
this.acceptedFilesForReviewUpload = undefined;
599599
}
600600

601-
if (this.revisionCreationFileUpload) {
601+
if (this.revisionCreationFileUpload) {
602602
this.revisionCreationFileUpload.clear();
603603
}
604604

0 commit comments

Comments
 (0)