Skip to content

Commit

Permalink
Fix import dependencies on azure.cli.core in breaking change collect (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ReaNAiveD authored Oct 12, 2024
1 parent 8aa045a commit e4017fb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 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.84
++++++
* `azdev generate-breaking-change-report`: Fix `azdev -h` error caused by global importing `azure.cli.core` in `breaking-change.py` module.

0.1.83
++++++
* `azdev generate-breaking-change-report`: Fix `azdev.operations.breaking_change` not included in `setup.py`.
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.83'
__VERSION__ = '0.1.84'
9 changes: 7 additions & 2 deletions azdev/operations/breaking_change/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
from importlib import import_module

import packaging.version
from azure.cli.core.breaking_change import MergedStatusTag, UpcomingBreakingChangeTag, TargetVersion
from knack.deprecation import Deprecated
from knack.log import get_logger

from azdev.operations.statistics import _create_invoker_and_load_cmds # pylint: disable=protected-access
Expand Down Expand Up @@ -82,6 +80,9 @@ def _handle_custom_breaking_change(module, command, breaking_change):


def _handle_status_tag(module, command, status_tag):
from knack.deprecation import Deprecated
from azure.cli.core.breaking_change import MergedStatusTag, UpcomingBreakingChangeTag, TargetVersion

if isinstance(status_tag, MergedStatusTag):
for tag in status_tag.tags:
yield from _handle_status_tag(module, command, tag)
Expand All @@ -107,6 +108,8 @@ def _handle_command_deprecation(module, command, deprecate_info):


def _calc_target_of_arg_deprecation(arg_name, arg_settings):
from knack.deprecation import Deprecated

option_str_list = []
depr = arg_settings.get('deprecate_info')
for option in arg_settings.get('option_list', []):
Expand All @@ -128,6 +131,8 @@ def _handle_arg_deprecation(module, command, target, deprecation_info):


def _handle_options_deprecation(module, command, options):
from knack.deprecation import Deprecated

deprecate_option_map = defaultdict(lambda: [])
for option in options:
if isinstance(option, Deprecated):
Expand Down

0 comments on commit e4017fb

Please sign in to comment.