@@ -164,6 +164,10 @@ def __init__(self, package_info: Dict[str, Any]):
164
164
self ._next_version = None
165
165
self .version_suggestion = ""
166
166
167
+ @property
168
+ def pprint_name (self ) -> str :
169
+ return " " .join ([word .capitalize () for word in self .package_name .split ("-" )])
170
+
167
171
@property
168
172
def next_version (self ) -> str :
169
173
if self ._next_version is None :
@@ -186,7 +190,7 @@ def check_file_with_packaging_tool(self):
186
190
os .chdir (Path (f"sdk/{ self .sdk_folder } " ))
187
191
# add `title` and update `is_stable` in sdk_packaging.toml
188
192
toml = Path (self .whole_package_name ) / "sdk_packaging.toml"
189
- stable_config = " is_stable = " + ( " true" if self .tag_is_stable else "false" ) + " \n "
193
+ stable_config = f' is_stable = { " true" if self .tag_is_stable and self . next_version != "1.0.0b1" else "false" } \n '
190
194
if toml .exists ():
191
195
192
196
def edit_toml (content : List [str ]):
@@ -214,25 +218,24 @@ def sdk_code_path(self) -> str:
214
218
return str (Path (f"sdk/{ self .sdk_folder } /{ self .whole_package_name } " ))
215
219
216
220
def check_pprint_name (self ):
217
- pprint_name = self .package_name .capitalize ()
218
221
219
222
def edit_file_for_pprint_name (content : List [str ]):
220
223
for i in range (0 , len (content )):
221
- content [i ] = content [i ].replace ("MyService" , pprint_name )
224
+ content [i ] = content [i ].replace ("MyService" , self . pprint_name )
222
225
223
226
for file in os .listdir (self .sdk_code_path ()):
224
227
file_path = str (Path (self .sdk_code_path ()) / file )
225
228
if os .path .isfile (file_path ):
226
229
modify_file (file_path , edit_file_for_pprint_name )
227
- _LOGGER .info (f' replace "MyService" with "{ pprint_name } " successfully ' )
230
+ _LOGGER .info (f' replace "MyService" with "{ self . pprint_name } " successfully ' )
228
231
229
232
def check_sdk_readme (self ):
230
233
sdk_readme = str (Path (f"sdk/{ self .sdk_folder } /{ self .whole_package_name } /README.md" ))
231
234
232
235
def edit_sdk_readme (content : List [str ]):
233
236
for i in range (0 , len (content )):
234
237
if content [i ].find ("MyService" ) > 0 :
235
- content [i ] = content [i ].replace ("MyService" , self .package_name . capitalize () )
238
+ content [i ] = content [i ].replace ("MyService" , self .pprint_name )
236
239
237
240
modify_file (sdk_readme , edit_sdk_readme )
238
241
@@ -325,7 +328,7 @@ def edit_changelog_proc(content: List[str]):
325
328
326
329
def check_dev_requirement (self ):
327
330
file = Path (f"sdk/{ self .sdk_folder } /{ self .whole_package_name } /dev_requirements.txt" )
328
- content = ["-e ../../../tools/azure-sdk-tools\n " , "../../identity/azure-identity\n " ]
331
+ content = ["-e ../../../tools/azure-sdk-tools\n " , "../../identity/azure-identity\n aiohttp \ n " ]
329
332
if not file .exists ():
330
333
with open (file , "w" ) as file_out :
331
334
file_out .writelines (content )
0 commit comments