Skip to content

Commit

Permalink
Add support to extension whl metadata (#501)
Browse files Browse the repository at this point in the history
* add include_whl_extensions for command metadata export
  • Loading branch information
AllyW authored Jan 23, 2025
1 parent 8242020 commit a87723d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Release History
===============
0.1.94
++++++
* `azdev command-change meta-export`: Enable meta exporting for extension installed using `.whl` package by `include_whl_extensions`

0.1.93
++++++
* `azdev linter`: Fix `None` path for added files in `git diff` for `missing_command_example` rule
Expand Down
2 changes: 1 addition & 1 deletion azdev/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# license information.
# -----------------------------------------------------------------------------

__VERSION__ = '0.1.93'
__VERSION__ = '0.1.94'
2 changes: 1 addition & 1 deletion azdev/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
short-summary: Diff the command meta between provided meta files.
examples:
- name: Diff the command meta change from fileA to fileB
text: azdev statistics meta-diff --base-meta-file fileA --diff-meta-file fileB --only-break
text: azdev command-change meta-diff --base-meta-file fileA --diff-meta-file fileB --only-break
"""

helps['command-change tree-export'] = """
Expand Down
7 changes: 4 additions & 3 deletions azdev/operations/command_change/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def diff_export_format_choices():

# pylint: disable=too-many-statements
def export_command_meta(modules=None, git_source=None, git_target=None, git_repo=None,
with_help=False, with_example=False,
with_help=False, with_example=False, include_whl_extensions=False,
meta_output_path=None):
require_azure_cli()

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

selected_modules = get_path_table(include_only=modules)
selected_modules = get_path_table(include_only=modules, include_whl_extensions=include_whl_extensions)

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

# trim command table to selected_modules
command_loader = filter_modules(command_loader, modules=selected_mod_names)
command_loader = filter_modules(command_loader, modules=selected_mod_names,
include_whl_extensions=include_whl_extensions)

if not command_loader.command_table:
logger.warning('No commands selected to check.')
Expand Down
2 changes: 2 additions & 0 deletions azdev/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ def load_arguments(self, _):
c.argument('with_help', action="store_true", help="State whether to include help message")
c.argument('with_example', action="store_true", help="State whether to include examples")
c.argument('meta_output_path', help='command meta json file path to store')
c.argument('include_whl_extensions', action='store_true',
help="Allow running cmd loader on extensions installed by `az extension add --source xxx.whl`.")

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

0 comments on commit a87723d

Please sign in to comment.