Skip to content

Commit f8acf70

Browse files
authored
[ServiceConnector-passwordless] improvements for pkg_resources is deprecated (#8833)
* improvements for pkg_resources is deprecated * lint * lint
1 parent 930a73d commit f8acf70

5 files changed

Lines changed: 26 additions & 4 deletions

File tree

src/serviceconnector-passwordless/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+
3.3.4
6+
++++++
7+
* Some improvements and issue fixes.
8+
59
3.3.3
610
++++++
711
* Add documentation explaining manual steps required for connecting to SQL database in Fabric.

src/serviceconnector-passwordless/azext_serviceconnector_passwordless/_credential_free.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from azure.cli.core._profile import Profile
2222
from azure.cli.command_modules.serviceconnector._utils import (
2323
generate_random_string,
24-
is_packaged_installed,
2524
get_object_id_of_current_user
2625
)
2726
from azure.cli.command_modules.serviceconnector._resource_config import (
@@ -32,7 +31,14 @@
3231
get_source_resource_name,
3332
get_target_resource_name,
3433
)
35-
from ._utils import run_cli_cmd, get_local_ip, confirm_all_ip_allow, confirm_admin_set, confirm_enable_entra_auth
34+
from ._utils import (
35+
run_cli_cmd,
36+
get_local_ip,
37+
confirm_all_ip_allow,
38+
confirm_admin_set,
39+
confirm_enable_entra_auth,
40+
is_packaged_installed
41+
)
3642
logger = get_logger(__name__)
3743

3844
AUTHTYPES = {

src/serviceconnector-passwordless/azext_serviceconnector_passwordless/_utils.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,15 @@ def confirm_admin_set():
138138
logger.warning(
139139
'Unable to prompt for confirmation as no tty available. Use --yes to enable the operation.')
140140
return False
141+
142+
143+
def is_packaged_installed(package_name):
144+
"""Check if a package is installed in the current Python environment."""
145+
try:
146+
__import__(package_name)
147+
return True
148+
except ImportError:
149+
return False
150+
except Exception as e:
151+
logger.error("Error checking for package %s: %s", package_name, str(e))
152+
return False

src/serviceconnector-passwordless/azext_serviceconnector_passwordless/config.py

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

66

7-
VERSION = '3.3.3'
7+
VERSION = '3.3.4'
88
NAME = 'serviceconnector-passwordless'

src/serviceconnector-passwordless/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
logger.warn("Wheel is not available, disabling bdist_wheel hook")
1616

1717

18-
VERSION = '3.3.3'
18+
VERSION = '3.3.4'
1919

2020
# The full list of classifiers is available at
2121
# https://pypi.python.org/pypi?%3Aaction=list_classifiers

0 commit comments

Comments
 (0)