From 44d9ea12bc1dc79e486e8ee5d8574b88804948cc Mon Sep 17 00:00:00 2001 From: ZelinWang Date: Wed, 9 Aug 2023 11:44:02 +0800 Subject: [PATCH 1/4] Revert "{CI} Update the --dependent-file parameter to be an optional argument to avoid introducing a breaking change. (#6521)" This reverts commit b442cf03b2426f8be19d317da47138a708cc2b3d. --- scripts/ci/index_ref_doc.py | 6 ++---- scripts/refdoc/generate.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/ci/index_ref_doc.py b/scripts/ci/index_ref_doc.py index 910685f0b2d..361c0e65205 100644 --- a/scripts/ci/index_ref_doc.py +++ b/scripts/ci/index_ref_doc.py @@ -55,15 +55,13 @@ def test(self): if dep_url.get(ext_name): dep_file = get_whl_from_url(dep_url[ext_name][0], dep_url[ext_name][1], self.whl_dir) else: - dep_file = None + dep_file = '' ext_file = get_whl_from_url(ext_url, filename, self.whl_dir) ref_doc_out_dir = os.path.join(REF_DOC_OUT_DIR, ext_name) if not os.path.isdir(ref_doc_out_dir): os.mkdir(ref_doc_out_dir) script_args = [sys.executable, REF_GEN_SCRIPT, '--extension-file', ext_file, '--output-dir', - ref_doc_out_dir] - if dep_file: - script_args.extend(['--dependent-file', dep_file]) + ref_doc_out_dir, '--dependent-file', dep_file] try: check_call(script_args) except CalledProcessError as e: diff --git a/scripts/refdoc/generate.py b/scripts/refdoc/generate.py index 18211d22632..5fd723dfbda 100644 --- a/scripts/refdoc/generate.py +++ b/scripts/refdoc/generate.py @@ -82,6 +82,6 @@ def _type_path(val): parser.add_argument('-o', '--output-dir', dest='output_dir', help='Path to place the generated documentation. By default, a temporary directory will be created.', required=False, type=_type_path) parser.add_argument('-d', '--dependent-file', dest='dep_file', - help='Path to the dependent extension .whl file.', required=False, type=str) + help='Path to the dependent extension .whl file.', required=True, type=str) args = parser.parse_args() generate(args.ext_file, args.output_dir, args.dep_file) From 83653a1e09ec23ce7916bf854cbc13f4bbd7d09e Mon Sep 17 00:00:00 2001 From: ZelinWang Date: Wed, 9 Aug 2023 11:44:35 +0800 Subject: [PATCH 2/4] Revert "{CI} Fix verify ref docs (#6507)" This reverts commit f12d92241d9c659b4422e319ca6fddb00cbae894. --- scripts/ci/index_ref_doc.py | 15 +++------------ scripts/refdoc/generate.py | 13 +++---------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/scripts/ci/index_ref_doc.py b/scripts/ci/index_ref_doc.py index 361c0e65205..63589122d34 100644 --- a/scripts/ci/index_ref_doc.py +++ b/scripts/ci/index_ref_doc.py @@ -50,18 +50,14 @@ class TestIndexRefDocsMeta(type): def __new__(mcs, name, bases, _dict): - def gen_test(ext_name, ext_url, filename, dep_url): + def gen_test(ext_name, ext_url, filename): def test(self): - if dep_url.get(ext_name): - dep_file = get_whl_from_url(dep_url[ext_name][0], dep_url[ext_name][1], self.whl_dir) - else: - dep_file = '' ext_file = get_whl_from_url(ext_url, filename, self.whl_dir) ref_doc_out_dir = os.path.join(REF_DOC_OUT_DIR, ext_name) if not os.path.isdir(ref_doc_out_dir): os.mkdir(ref_doc_out_dir) script_args = [sys.executable, REF_GEN_SCRIPT, '--extension-file', ext_file, '--output-dir', - ref_doc_out_dir, '--dependent-file', dep_file] + ref_doc_out_dir] try: check_call(script_args) except CalledProcessError as e: @@ -69,14 +65,9 @@ def test(self): raise e return test - dep_url = {} for ext_name, ext_url, filename in ALL_TESTS: test_name = "test_ref_doc_%s" % ext_name - # The containerapp-preview extension is a special case, - # it must depend on the continerapp extension and cannot run independently. - if ext_name == 'containerapp': - dep_url['containerapp-preview'] = [ext_url, filename] - _dict[test_name] = gen_test(ext_name, ext_url, filename, dep_url) + _dict[test_name] = gen_test(ext_name, ext_url, filename) return type.__new__(mcs, name, bases, _dict) diff --git a/scripts/refdoc/generate.py b/scripts/refdoc/generate.py index 5fd723dfbda..ae5778ae142 100644 --- a/scripts/refdoc/generate.py +++ b/scripts/refdoc/generate.py @@ -21,7 +21,7 @@ def print_status(msg=''): print('-- '+msg) -def generate(ext_file, output_dir, dep_file): +def generate(ext_file, output_dir): # Verify sphinx installed in environment before we get started check_call(['sphinx-build', '--version']) if not output_dir: @@ -29,12 +29,6 @@ def generate(ext_file, output_dir, dep_file): print_status('Using output directory {}'.format(output_dir)) temp_extension_dir = tempfile.mkdtemp() try: - if dep_file: - pip_cmd = [sys.executable, '-m', 'pip', 'install', '--target', - os.path.join(temp_extension_dir, 'extension'), - dep_file, '--disable-pip-version-check', '--no-cache-dir'] - print_status('Executing "{}"'.format(' '.join(pip_cmd))) - check_call(pip_cmd) pip_cmd = [sys.executable, '-m', 'pip', 'install', '--target', os.path.join(temp_extension_dir, 'extension'), ext_file, '--disable-pip-version-check', '--no-cache-dir'] print_status('Executing "{}"'.format(' '.join(pip_cmd))) @@ -81,7 +75,6 @@ def _type_path(val): help='Path to the extension .whl file.', required=True, type=_type_ext_file) parser.add_argument('-o', '--output-dir', dest='output_dir', help='Path to place the generated documentation. By default, a temporary directory will be created.', required=False, type=_type_path) - parser.add_argument('-d', '--dependent-file', dest='dep_file', - help='Path to the dependent extension .whl file.', required=True, type=str) + args = parser.parse_args() - generate(args.ext_file, args.output_dir, args.dep_file) + generate(args.ext_file, args.output_dir) From 9d19e03b73447b41a9061ae3064db645c6433dd5 Mon Sep 17 00:00:00 2001 From: ZelinWang Date: Wed, 9 Aug 2023 11:45:32 +0800 Subject: [PATCH 3/4] Revert "{CI} Fix command tree broken issue (#6573)" This reverts commit 3df4a817d1113c6373942c1324265872184df780. --- scripts/ci/build_ext_cmd_tree.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/scripts/ci/build_ext_cmd_tree.sh b/scripts/ci/build_ext_cmd_tree.sh index bc8552d1c91..53bed033b85 100644 --- a/scripts/ci/build_ext_cmd_tree.sh +++ b/scripts/ci/build_ext_cmd_tree.sh @@ -20,15 +20,7 @@ export AZURE_EXTENSION_INDEX_URL=https://raw.githubusercontent.com/Azure/azure-c output=$(az extension list-available --query [].name -otsv) # azure-cli-ml is replaced by ml # disable alias which relies on Jinja2 2.10 -# ----------------------------------------------- -# When two extensions have the same command, the following error will be reported: -# `Exception: Key: show already exists in containerapp. 2 extensions cannot have the same command!` -# Temporarily skip the containerapp-preview extension, -# Which will cause the containerapp-preview extension to be unable to use the dynamic load function. -# That is, when using the unique command of containerapp-preview, the extension cannot be automatically prompted to install. -# TODO: remove this after support for building dependencies in command index between extensions -# ----------------------------------------------- -blocklist=("azure-cli-ml" "alias" "containerapp-preview") +blocklist=("azure-cli-ml" "alias") rm -f ~/.azure/extCmdTreeToUpload.json From 4d15801b848d270dbc66d530da0f972b849abd6c Mon Sep 17 00:00:00 2001 From: ZelinWang Date: Wed, 9 Aug 2023 11:45:55 +0800 Subject: [PATCH 4/4] revert linter --- scripts/ci/verify_linter.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/scripts/ci/verify_linter.py b/scripts/ci/verify_linter.py index ebe6f3100d9..7fee6294307 100644 --- a/scripts/ci/verify_linter.py +++ b/scripts/ci/verify_linter.py @@ -70,17 +70,9 @@ def _cmd(cmd): check_call(cmd, shell=True) def add_from_code(self): - # The containerapp-preview extension is a special case, - # it must depend on the continerapp extension and cannot run independently. - if self.extension_name == 'containerapp-preview': - self._cmd('azdev extension add containerapp') self._cmd('azdev extension add {}'.format(self.extension_name)) def remove(self): - # The containerapp-preview extension is a special case, - # it must depend on the continerapp extension and cannot run independently. - if self.extension_name == 'containerapp-preview': - self._cmd('azdev extension remove containerapp') self._cmd('azdev extension remove {}'.format(self.extension_name)) def linter(self):