Skip to content

Commit e4017fb

Browse files
authored
Fix import dependencies on azure.cli.core in breaking change collect (#482)
1 parent 8aa045a commit e4017fb

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

‎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.84
6+
++++++
7+
* `azdev generate-breaking-change-report`: Fix `azdev -h` error caused by global importing `azure.cli.core` in `breaking-change.py` module.
8+
59
0.1.83
610
++++++
711
* `azdev generate-breaking-change-report`: Fix `azdev.operations.breaking_change` not included in `setup.py`.

‎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.83'
7+
__VERSION__ = '0.1.84'

‎azdev/operations/breaking_change/__init__.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
from importlib import import_module
1010

1111
import packaging.version
12-
from azure.cli.core.breaking_change import MergedStatusTag, UpcomingBreakingChangeTag, TargetVersion
13-
from knack.deprecation import Deprecated
1412
from knack.log import get_logger
1513

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

8381

8482
def _handle_status_tag(module, command, status_tag):
83+
from knack.deprecation import Deprecated
84+
from azure.cli.core.breaking_change import MergedStatusTag, UpcomingBreakingChangeTag, TargetVersion
85+
8586
if isinstance(status_tag, MergedStatusTag):
8687
for tag in status_tag.tags:
8788
yield from _handle_status_tag(module, command, tag)
@@ -107,6 +108,8 @@ def _handle_command_deprecation(module, command, deprecate_info):
107108

108109

109110
def _calc_target_of_arg_deprecation(arg_name, arg_settings):
111+
from knack.deprecation import Deprecated
112+
110113
option_str_list = []
111114
depr = arg_settings.get('deprecate_info')
112115
for option in arg_settings.get('option_list', []):
@@ -128,6 +131,8 @@ def _handle_arg_deprecation(module, command, target, deprecation_info):
128131

129132

130133
def _handle_options_deprecation(module, command, options):
134+
from knack.deprecation import Deprecated
135+
131136
deprecate_option_map = defaultdict(lambda: [])
132137
for option in options:
133138
if isinstance(option, Deprecated):

0 commit comments

Comments
 (0)