@@ -72,30 +72,34 @@ def main(generate_input, generate_output):
72
72
_LOGGER .info (f"[PACKAGE]({ package_name } )[CHANGELOG]:{ md_output } " )
73
73
# Generate api stub File
74
74
folder_name = package ["path" ][0 ]
75
- apiview_start_time = time .time ()
76
- try :
77
- package_path = Path (sdk_folder , folder_name , package_name )
78
- check_call (
79
- [
80
- "python" ,
81
- "-m" ,
82
- "pip" ,
83
- "install" ,
84
- "-r" ,
85
- "../../../eng/apiview_reqs.txt" ,
86
- "--index-url=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi"
87
- "/simple/" ,
88
- ],
89
- cwd = package_path ,
90
- timeout = 600 ,
91
- )
92
- check_call (["apistubgen" , "--pkg-path" , "." ], cwd = package_path , timeout = 600 )
93
- for file in os .listdir (package_path ):
94
- if "_python.json" in file and package_name in file :
95
- package ["apiViewArtifact" ] = str (Path (package_path , file ))
96
- except Exception as e :
97
- _LOGGER .debug (f"Fail to generate ApiView token file for { package_name } : { e } " )
98
- _LOGGER .info (f"apiview generation cost time: { int (time .time () - apiview_start_time )} seconds" )
75
+
76
+ if package ["runInPipeline" ]:
77
+ apiview_start_time = time .time ()
78
+ try :
79
+ package_path = Path (sdk_folder , folder_name , package_name )
80
+ check_call (
81
+ [
82
+ "python" ,
83
+ "-m" ,
84
+ "pip" ,
85
+ "install" ,
86
+ "-r" ,
87
+ "../../../eng/apiview_reqs.txt" ,
88
+ "--index-url=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi"
89
+ "/simple/" ,
90
+ ],
91
+ cwd = package_path ,
92
+ timeout = 600 ,
93
+ )
94
+ check_call (["apistubgen" , "--pkg-path" , "." ], cwd = package_path , timeout = 600 )
95
+ for file in os .listdir (package_path ):
96
+ if "_python.json" in file and package_name in file :
97
+ package ["apiViewArtifact" ] = str (Path (package_path , file ))
98
+ except Exception as e :
99
+ _LOGGER .debug (f"Fail to generate ApiView token file for { package_name } : { e } " )
100
+ _LOGGER .info (f"apiview generation cost time: { int (time .time () - apiview_start_time )} seconds" )
101
+ else :
102
+ _LOGGER .info ("Skip ApiView generation for package that does not run in pipeline." )
99
103
100
104
# check generated files and update package["version"]
101
105
if package_name .startswith ("azure-mgmt-" ):
0 commit comments