-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Describe the bug
When running az network bastion ssh commands we recieve
/.azure/cliextensions/bastion/azext_bastion/custom.py:107: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
from pkg_resources import parse_version
This warning breaks our tooling, can the warning be silenced or the pkg_resource dependency be removed?
We've tried
- export PYTHONWARNINGS=ignore
- --only-show-errors
- pip install setuptools==80.8.0 --force-reinstall
Ref (was fixed on other parts of az cli):
Azure/azure-cli#31591
Versions:
azure-cli 2.75.0
core 2.75.0
telemetry 1.1.0
Extensions:
azure-devops 1.0.2
bastion 1.4.1
ssh 2.0.6
Related command
az network bastion ssh
Errors
UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
from pkg_resources import parse_version
Issue script & Debug output
UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
from pkg_resources import parse_version
Expected behavior
No Warning should be produced, the shell should be shown
Environment Summary
azure-cli 2.75.0
core 2.75.0
telemetry 1.1.0
Extensions:
azure-devops 1.0.2
bastion 1.4.1
ssh 2.0.6
Dependencies:
msal 1.33.0b1
azure-mgmt-resource 23.3.0
Python location '/opt/az/bin/python3'
Config directory '/home/alex/.azure'
Extensions directory '/home/alex/.azure/cliextensions'
Python (Linux) 3.12.10 (main, Jun 24 2025, 10:15:05) [GCC 11.4.0]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
No response