@@ -414,6 +414,28 @@ def check_model_flatten(self):
414414 issue .create_comment (f"@{ assignee } , { message } " )
415415 raise Exception (message )
416416
417+ @return_origin_path
418+ def check_pyproject_toml (self ):
419+ os .chdir (Path ("sdk" ) / self .sdk_folder / self .whole_package_name )
420+ # add `breaking = false` in pyproject.toml
421+ toml = Path ("pyproject.toml" )
422+ if not toml .exists ():
423+ with open (toml , "w" ) as file :
424+ file .write ("[tool.azure-sdk-build]\n breaking = false\n " )
425+ _LOG .info ("create pyproject.toml" )
426+
427+ def edit_toml (content : List [str ]):
428+ has_breaking = False
429+ for line in content :
430+ if "breaking = false" in line :
431+ has_breaking = True
432+ break
433+ if not has_breaking :
434+ _LOG .info ("add breaking = false to pyproject.toml" )
435+ content .append ("breaking = false\n " )
436+
437+ modify_file (str (toml ), edit_toml )
438+
417439 def check_file (self ):
418440 self .check_file_with_packaging_tool ()
419441 self .check_pprint_name ()
@@ -423,6 +445,7 @@ def check_file(self):
423445 self .check_dev_requirement ()
424446 self .check_package_size ()
425447 self .check_model_flatten ()
448+ self .check_pyproject_toml ()
426449
427450 def sdk_code_path (self ) -> str :
428451 return str (Path (f"sdk/{ self .sdk_folder } /{ self .whole_package_name } " ))
@@ -491,7 +514,7 @@ def run_test(self):
491514 self .prepare_test_env ()
492515 self .run_test_proc ()
493516 self .clean_test_env ()
494- self .upload_recording_files ()
517+ # self.upload_recording_files()
495518
496519 def create_pr_proc (self ):
497520 api = GhApi (owner = "Azure" , repo = "azure-sdk-for-python" , token = self .bot_token )
@@ -502,7 +525,6 @@ def create_pr_proc(self):
502525 pr_body = pr_body + "{} \n {} \n {}" .format (self .issue_link , self .test_result , self .pipeline_link )
503526 if self .has_multi_packages :
504527 pr_body += f"\n BuildTargetingString\n { self .whole_package_name } \n Skip.CreateApiReview"
505- pr_body += "\n Skip.BreakingChanges\n true"
506528 res_create = api .pulls .create (pr_title , pr_head , pr_base , pr_body )
507529
508530 # Add issue link on PR
0 commit comments