Skip to content

Commit

Permalink
[Script] Auto release debug (#24833)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
BigCat20196 and msyyc committed Jun 15, 2022
1 parent 1568648 commit d7d3220
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions scripts/auto_release/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,21 +375,40 @@ def check_changelog_file(self):
else:
self.edit_changelog()

@staticmethod
def get_need_dependency():
template_path = Path('tools/azure-sdk-tools/packaging_tools/templates/setup.py')
with open(template_path, 'r') as fr:
content = fr.readlines()
for line in content:
if 'msrest>' in line:
target_msrest = line.strip().strip(',').strip('\'')
yield target_msrest
if 'azure-mgmt-core' in line:
target_mgmt_core = line.strip().strip(',').strip('\'')
yield target_mgmt_core

def check_ci_file_proc(self, dependency: str):
def edit_ci_file(content: List[str]):
new_line = f'#override azure-mgmt-{self.package_name} {dependency}'
dependency_name = dependency.split('>')[0]
for i in range(len(content)):
if new_line in content[i]:
return
if f'azure-mgmt-{self.package_name} {dependency_name}' in content[i]:
content[i] = new_line + '\n'
return
prefix = '' if '\n' in content[-1] else '\n'
content.append(prefix + new_line + '\n')

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

def check_ci_file(self):
self.check_ci_file_proc('msrest>=0.6.21')
self.check_ci_file_proc('azure-mgmt-core>=1.3.0,<2.0.0')
# eg: target_msrest = 'msrest>=0.6.21', target_mgmt_core = 'azure-mgmt-core>=1.3.0,<2.0.0'
target_msrest, target_mgmt_core = list(self.get_need_dependency())
self.check_ci_file_proc(target_msrest)
self.check_ci_file_proc(target_mgmt_core)

def check_file(self):
self.check_file_with_packaging_tool()
Expand Down

0 comments on commit d7d3220

Please sign in to comment.