@@ -59,13 +59,8 @@ def main(generate_input, generate_output):
59
59
package ["version" ] = last_version
60
60
61
61
_LOGGER .info (f"[PACKAGE]({ package_name } )[CHANGELOG]:{ md_output } " )
62
- # Built package
63
- create_package (prefolder , package_name )
64
- folder_name = package ["path" ][0 ]
65
- dist_path = Path (sdk_folder , folder_name , package_name , "dist" )
66
- package ["artifacts" ] = [str (dist_path / package_file ) for package_file in os .listdir (dist_path )]
67
- package ["result" ] = "succeeded"
68
62
# Generate api stub File
63
+ folder_name = package ["path" ][0 ]
69
64
try :
70
65
package_path = Path (sdk_folder , folder_name , package_name )
71
66
check_call (
@@ -87,22 +82,31 @@ def main(generate_input, generate_output):
87
82
package ["apiViewArtifact" ] = str (Path (package_path , file ))
88
83
except Exception as e :
89
84
_LOGGER .debug (f"Fail to generate ApiView token file for { package_name } : { e } " )
85
+
86
+ # check generated files and update package["version"]
87
+ if package_name .startswith ("azure-mgmt-" ):
88
+ try :
89
+ check_file (package )
90
+ except Exception as e :
91
+ _LOGGER .error (f"Fail to check generated files for { package_name } : { e } " )
92
+
93
+ # Built package
94
+ create_package (prefolder , package_name )
95
+ dist_path = Path (sdk_folder , folder_name , package_name , "dist" )
96
+ package ["artifacts" ] = [str (dist_path / package_file ) for package_file in os .listdir (dist_path )]
97
+ for artifact in package ["artifacts" ]:
98
+ if ".whl" in artifact :
99
+ package ["language" ] = "Python"
100
+ break
90
101
# Installation package
91
102
package ["installInstructions" ] = {
92
103
"full" : "You can install the use using pip install of the artifacts." ,
93
104
"lite" : f"pip install { package_name } " ,
94
105
}
95
- for artifact in package ["artifacts" ]:
96
- if ".whl" in artifact :
97
- package ["language" ] = "Python"
98
- break
106
+ package ["result" ] = "succeeded"
99
107
package ["packageFolder" ] = package ["path" ][0 ]
100
108
result ["packages" ].append (package )
101
109
102
- # check generated files
103
- if package_name .startswith ("azure-mgmt-" ):
104
- check_file (package )
105
-
106
110
with open (generate_output , "w" ) as writer :
107
111
json .dump (result , writer )
108
112
0 commit comments