Skip to content

Commit a87723d

Browse files
authored
Add support to extension whl metadata (#501)
* add include_whl_extensions for command metadata export
1 parent 8242020 commit a87723d

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
33
Release History
44
===============
5+
0.1.94
6+
++++++
7+
* `azdev command-change meta-export`: Enable meta exporting for extension installed using `.whl` package by `include_whl_extensions`
8+
59
0.1.93
610
++++++
711
* `azdev linter`: Fix `None` path for added files in `git diff` for `missing_command_example` rule

azdev/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# license information.
55
# -----------------------------------------------------------------------------
66

7-
__VERSION__ = '0.1.93'
7+
__VERSION__ = '0.1.94'

azdev/help.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@
243243
short-summary: Diff the command meta between provided meta files.
244244
examples:
245245
- name: Diff the command meta change from fileA to fileB
246-
text: azdev statistics meta-diff --base-meta-file fileA --diff-meta-file fileB --only-break
246+
text: azdev command-change meta-diff --base-meta-file fileA --diff-meta-file fileB --only-break
247247
"""
248248

249249
helps['command-change tree-export'] = """

azdev/operations/command_change/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def diff_export_format_choices():
2828

2929
# pylint: disable=too-many-statements
3030
def export_command_meta(modules=None, git_source=None, git_target=None, git_repo=None,
31-
with_help=False, with_example=False,
31+
with_help=False, with_example=False, include_whl_extensions=False,
3232
meta_output_path=None):
3333
require_azure_cli()
3434

@@ -38,7 +38,7 @@ def export_command_meta(modules=None, git_source=None, git_target=None, git_repo
3838
if cli_only or ext_only:
3939
modules = None
4040

41-
selected_modules = get_path_table(include_only=modules)
41+
selected_modules = get_path_table(include_only=modules, include_whl_extensions=include_whl_extensions)
4242

4343
if cli_only:
4444
selected_modules['ext'] = {}
@@ -84,7 +84,8 @@ def export_command_meta(modules=None, git_source=None, git_target=None, git_repo
8484
help_info[help_item.command] = help_item
8585

8686
# trim command table to selected_modules
87-
command_loader = filter_modules(command_loader, modules=selected_mod_names)
87+
command_loader = filter_modules(command_loader, modules=selected_mod_names,
88+
include_whl_extensions=include_whl_extensions)
8889

8990
if not command_loader.command_table:
9091
logger.warning('No commands selected to check.')

azdev/params.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ def load_arguments(self, _):
165165
c.argument('with_help', action="store_true", help="State whether to include help message")
166166
c.argument('with_example', action="store_true", help="State whether to include examples")
167167
c.argument('meta_output_path', help='command meta json file path to store')
168+
c.argument('include_whl_extensions', action='store_true',
169+
help="Allow running cmd loader on extensions installed by `az extension add --source xxx.whl`.")
168170

169171
with ArgumentsContext(self, 'command-change meta-diff') as c:
170172
c.argument('base_meta_file', required=True, help='command meta json file')

0 commit comments

Comments
 (0)