Skip to content

Commit d7d3220

Browse files
BigCat20196msyyc
andauthored
[Script] Auto release debug (Azure#24833)
* fix auto-ask-check bug * update comment * update comment * fix bug * Update main.py * Update main.py * Update main.py * fix changelog format for new service * fix check_pprint_name bug * Update main.py * fix check_pprint_name bug * Update main.py * Update main.py * test * test * change to azclibot * change to azure * fix push * test * update * update * test * test * reduction * update main * delete f * Update main.py * test * test * test * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * remove surplus code * Update PythonSdkLiveTest.yml for Azure Pipelines * Update main.py * Update main.py * Update main.py * Update main.py * Update main.py * Update main.py * Update main.py * Update main.py * Update main.py * Update main.py * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * fix bug * update * test * update code * update bot * update main bot * Update PythonSdkLiveTest.yml for Azure Pipelines * Update main.py * Update main.py * change branch for test * for test * for test * for test * add python_tag * restore branch * Update PythonSdkLiveTest.yml * update global_conf * Update auto_codegen.py * Update generate_sdk.py * Update generate_sdk.py * Update generate_sdk.py * Update main.py * Update main.py * Update PythonSdkLiveTest.yml for Azure Pipelines * uodate edit_sdk_setup * fix * test * test * fix bug * debug * fix bug * fix bug * Update main.py * move to ci check * Update main.py Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
1 parent 1568648 commit d7d3220

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

scripts/auto_release/main.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,21 +375,40 @@ def check_changelog_file(self):
375375
else:
376376
self.edit_changelog()
377377

378+
@staticmethod
379+
def get_need_dependency():
380+
template_path = Path('tools/azure-sdk-tools/packaging_tools/templates/setup.py')
381+
with open(template_path, 'r') as fr:
382+
content = fr.readlines()
383+
for line in content:
384+
if 'msrest>' in line:
385+
target_msrest = line.strip().strip(',').strip('\'')
386+
yield target_msrest
387+
if 'azure-mgmt-core' in line:
388+
target_mgmt_core = line.strip().strip(',').strip('\'')
389+
yield target_mgmt_core
390+
378391
def check_ci_file_proc(self, dependency: str):
379392
def edit_ci_file(content: List[str]):
380393
new_line = f'#override azure-mgmt-{self.package_name} {dependency}'
394+
dependency_name = dependency.split('>')[0]
381395
for i in range(len(content)):
382396
if new_line in content[i]:
383397
return
398+
if f'azure-mgmt-{self.package_name} {dependency_name}' in content[i]:
399+
content[i] = new_line + '\n'
400+
return
384401
prefix = '' if '\n' in content[-1] else '\n'
385402
content.append(prefix + new_line + '\n')
386403

387404
modify_file(str(Path('shared_requirements.txt')), edit_ci_file)
388405
print_exec('git add shared_requirements.txt')
389406

390407
def check_ci_file(self):
391-
self.check_ci_file_proc('msrest>=0.6.21')
392-
self.check_ci_file_proc('azure-mgmt-core>=1.3.0,<2.0.0')
408+
# eg: target_msrest = 'msrest>=0.6.21', target_mgmt_core = 'azure-mgmt-core>=1.3.0,<2.0.0'
409+
target_msrest, target_mgmt_core = list(self.get_need_dependency())
410+
self.check_ci_file_proc(target_msrest)
411+
self.check_ci_file_proc(target_mgmt_core)
393412

394413
def check_file(self):
395414
self.check_file_with_packaging_tool()

0 commit comments

Comments
 (0)