Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/serviceconnector-passwordless/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Release History
===============
3.3.4
++++++
* Some improvements and issue fixes.

3.3.3
++++++
* Add documentation explaining manual steps required for connecting to SQL database in Fabric.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from azure.cli.core._profile import Profile
from azure.cli.command_modules.serviceconnector._utils import (
generate_random_string,
is_packaged_installed,
get_object_id_of_current_user
)
from azure.cli.command_modules.serviceconnector._resource_config import (
Expand All @@ -32,7 +31,14 @@
get_source_resource_name,
get_target_resource_name,
)
from ._utils import run_cli_cmd, get_local_ip, confirm_all_ip_allow, confirm_admin_set, confirm_enable_entra_auth
from ._utils import (
run_cli_cmd,
get_local_ip,
confirm_all_ip_allow,
confirm_admin_set,
confirm_enable_entra_auth,
is_packaged_installed
)
logger = get_logger(__name__)

AUTHTYPES = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,15 @@ def confirm_admin_set():
logger.warning(
'Unable to prompt for confirmation as no tty available. Use --yes to enable the operation.')
return False


def is_packaged_installed(package_name):
"""Check if a package is installed in the current Python environment."""
try:
__import__(package_name)
return True
except ImportError:
return False
Comment on lines +146 to +149
Copy link

Copilot AI Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using 'import' to check package installation, consider using 'importlib.util.find_spec' to avoid executing package code for a simple presence check.

Suggested change
__import__(package_name)
return True
except ImportError:
return False
from importlib.util import find_spec
return find_spec(package_name) is not None

Copilot uses AI. Check for mistakes.
except Exception as e:
logger.error("Error checking for package %s: %s", package_name, str(e))
return False
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# --------------------------------------------------------------------------------------------


VERSION = '3.3.3'
VERSION = '3.3.4'
NAME = 'serviceconnector-passwordless'
2 changes: 1 addition & 1 deletion src/serviceconnector-passwordless/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
logger.warn("Wheel is not available, disabling bdist_wheel hook")


VERSION = '3.3.3'
VERSION = '3.3.4'

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