@@ -315,6 +315,21 @@ def main(generate_input, generate_output):
315315 if data .get ("runMode" ) in ["spec-pull-request" , "release" ]:
316316 apiview_start_time = time .time ()
317317 try :
318+ _LOGGER .info (f"install apiview generation tool" )
319+ check_call (
320+ [
321+ "python" ,
322+ "-m" ,
323+ "pip" ,
324+ "install" ,
325+ "-r" ,
326+ "eng/apiview_reqs.txt" ,
327+ "--index-url=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/" ,
328+ ],
329+ timeout = 600 ,
330+ stderr = None if data .get ("runMode" ) == "release" else subprocess .DEVNULL ,
331+ )
332+
318333 _LOGGER .info ("generate apiview artifacts" )
319334 package_path = Path (sdk_folder , folder_name , package_name )
320335 cmds = [
@@ -324,16 +339,16 @@ def main(generate_input, generate_output):
324339 "--extract-metadata" ,
325340 package_name ,
326341 "--dest-dir" ,
327- package_path .absolute (),
342+ package_path .absolute (). as_posix () ,
328343 ]
329344 _LOGGER .info (f"generate apiview file for package { package_name } " )
330345 check_call (
331346 cmds ,
332347 timeout = 900 if data .get ("runMode" ) == "spec-pull-request" else 36000 ,
333- cwd = "." ,
334348 # known issue that higher python version meet install warning with lower pylint.
335349 # we skip the output here to reduce confusion and will remove it after apiview tool upgrade to higher pylint version.
336- stderr = subprocess .DEVNULL ,
350+ # in "release" mode we keep stderr so the output is visible for debugging.
351+ stderr = None if data .get ("runMode" ) == "release" else subprocess .DEVNULL ,
337352 )
338353 for file in os .listdir (package_path ):
339354 if "_python.json" in file and package_name in file :
0 commit comments