Skip to content

Commit 41be9eb

Browse files
authored
{Misc.} Remove pkg_resources (#31616)
1 parent 0929347 commit 41be9eb

5 files changed

Lines changed: 2 additions & 10 deletions

File tree

doc/sphinx/azhelpgen/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
5-
import pkg_resources
6-
pkg_resources.declare_namespace(__name__)

doc/sphinx/cligroup/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
5-
import pkg_resources
6-
pkg_resources.declare_namespace(__name__)

src/azure-cli/azure/cli/command_modules/maps/tests/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
5-
import pkg_resources
6-
pkg_resources.declare_namespace(__name__)

src/azure-cli/azure/cli/command_modules/maps/tests/latest/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
5-
import pkg_resources
6-
pkg_resources.declare_namespace(__name__)

tools/automation/verify/verify_packages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import filecmp
1313
import logging
1414
import unittest
15-
from pkg_resources import working_set
15+
from importlib.metadata import distributions
1616

1717
import automation.utilities.path as automation_path
1818
from automation.utilities.const import COMMAND_MODULE_PREFIX
@@ -48,7 +48,7 @@ def test_azure_cli_installation(self):
4848
def test_azure_cli_module_installation(self):
4949
expected_modules = set([n for n, _ in automation_path.get_command_modules_paths(include_prefix=True)])
5050

51-
installed_command_modules = [dist.key for dist in list(working_set) if dist.key.startswith(COMMAND_MODULE_PREFIX)]
51+
installed_command_modules = [dist.metadata['Name'] for dist in distributions() if dist.metadata['Name'].startswith(COMMAND_MODULE_PREFIX)]
5252

5353
logger.info('Installed command modules %s', installed_command_modules)
5454

0 commit comments

Comments
 (0)