-
Notifications
You must be signed in to change notification settings - Fork 3.4k
UserWarning pkg_resources is deprecated as an API #33128
Description
Describe the bug
I've been seeing this warning for some time now with some commands. Does this already have a solution or will one be released to address the deprecation?
C:\Users\user.name.azure\cliextensions\azure-devops\azext_devops\dev_init_.py:5: 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.
Related command
az pipelines agent list
Errors
C:\Users\user.name.azure\cliextensions\azure-devops\azext_devops\dev_init_.py:5: 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.
Issue script & Debug output
az pipelines agent list --pool-id 1 --query "[].{Name:name, Status:status, Enabled:enabled, Version: version, PendingUpdate: pendingUpdate}" --output table --debug
Warning on lines 15-16 of debug output.
PS > . 'agent-status.ps1'
cli.knack.cli: Command arguments: ['pipelines', 'agent', 'list', '--pool-id', '1', '--query', '[].{Name:name, Status:status, Enabled:enabled, Version: version, PendingUpdate: pendingUpdate}', '--output', 'table', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x000001E331D98720>, <function OutputProducer.on_global_arguments at 0x000001E332321A80>, <function CLIQuery.on_global_arguments at 0x000001E33237F9C0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'pipelines': ['azext_devops']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: Total (0) 0.000 0 0
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
C:\Users\user.name.azure\cliextensions\azure-devops\azext_devops\dev_init_.py:5: 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.
import pkg_resources
cli.azure.cli.core: azure-devops 0.230 60 192 C:\Users\user.name.azure\cliextensions\azure-devops
cli.azure.cli.core: Total (1) 0.230 60 192
cli.azure.cli.core: Loaded 60 groups, 192 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : pipelines agent list
cli.azure.cli.core: Command table: pipelines agent list
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x000001E334F114E0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\user.name.azure\commands\2026-04-02.13-09-20.pipelines_agent_list.47328.log'.
az_command_data_logger: command args: pipelines agent list --pool-id {} --query {} --output {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x000001E334F52A20>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x000001E334F7CD60>, <function register_cache_arguments..add_cache_arguments
at 0x000001E334F7CF40>, <function register_upcoming_breaking_change_info..update_breaking_change_info at 0x000001E334F7CFE0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x000001E332321B20>, <function CLIQuery.handle_query_parameter at 0x000001E33237FA60>, <function register_ids_argument..parse_ids_arguments at 0x000001E334F7CE00>, <function DevCommandsLoader.post_parse_args at 0x000001E334F93380>]
az_command_data_logger: extension name: azure-devops
az_command_data_logger: extension version: 0.26.0
cli.azext_devops.dev.common.vsts_git_url_info: Remote url: https://dev.azure.com/organizationName/projectName/_git/repoName
azext_devops.devops_sdk._file_cache: Loading cache file: C:\Users\user.name.azure\azuredevops\cache\remotes.json
azext_devops.devops_sdk._file_cache: attempting to read file C:\Users\user.name.azure\azuredevops\cache\remotes.json as utf-8-sig
cli.azext_devops.dev.common.services: Detect: Url discovery took 0:00:00.129977
cli.azext_devops.dev.common._credentials: Getting credential: azdevops-cli:https://dev.azure.com/organizationName
keyring.backend: Loading KWallet
keyring.backend: Loading SecretService
keyring.backend: Loading Windows
win32ctypes.core.cffi: Loaded cffi backend
keyring.backend: Loading chainer
keyring.backend: Loading macOS
cli.azext_devops.dev.common.credential_store: Keyring backend : keyring.backends.Windows.WinVaultKeyring (priority: 5)
cli.azext_devops.dev.common.services: PAT is present which can be used against this instance
cli.azure.cli.core: Current cloud config:
AzureCloud
cli.azext_devops.dev.common.services: az login is not present
cli.azext_devops.dev.common.services: There are no active accounts.
Traceback (most recent call last):
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/_profile.py", line 549, in get_current_account_user
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/_profile.py", line 558, in get_subscription
knack.util.CLIError: Please run 'az login' to setup account.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\user.name.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 61, in _get_credentials
token_from_az_login = get_token_from_az_logins(organization, pat_token_present)
File "C:\Users\user.name.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 118, in get_token_from_az_logins
dummy_user = profile.get_current_account_user() # noqa: F841
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/_profile.py", line 551, in get_current_account_user
knack.util.CLIError: There are no active accounts.
cli.azext_devops.dev.common._credentials: Getting credential: azdevops-cli:https://dev.azure.com/organizationName
cli.azext_devops.dev.common.credential_store: Keyring backend : keyring.backends.Windows.WinVaultKeyring (priority: 5)
cli.azext_devops.dev.common.services: Creating connection with personal access token.
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
cli.azext_devops.dev.common.telemetry: Azure devops telemetry enabled.
cli.azext_devops.dev.common.telemetry: Logging telemetry to azure devops server.
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk._file_cache: Loading cache file: C:\Users\user.name.azure-devops\python-sdk\cache\options.json
azext_devops.devops_sdk._file_cache: attempting to read file C:\Users\user.name.azure-devops\python-sdk\cache\options.json as utf-8-sig
azext_devops.devops_sdk.client: File cache hit for options on: https://dev.azure.com/organizationName
azext_devops.devops_sdk.client: Route template: _apis/{area}/{resource}
azext_devops.devops_sdk.client: Api version '5.0-preview.1'
azext_devops.devops_sdk.client: POST https://dev.azure.com/organizationName/_apis/CustomerIntelligence/Events
azext_devops.devops_sdk.client: Request content: [{'area': 'AzureDevopsCli', 'feature': 'pipelines', 'properties': {'Command': 'agent list', 'Args': 'pool_id', 'ShellType': 'cmd', 'IsInteractive': 'True', 'OutputType': 'table', 'OrgPresentInCommand': False, 'ProjectPresentInCommand': False, 'RepoPresentInCommand': False, 'OrgPickedFromGit': True, 'ProjectPickedFromGit': True, 'RepoPickedFromGit': True, 'OrgIgnoredFromConfig': True, 'ProjectIgnoredFromConfig': True}}]
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
azext_devops.devops_sdk._file_cache: Loading cache file: C:\Users\user.name.azure-devops\python-sdk\cache\resources.json
msrest.universal_http: Evaluate proxies against ENV settings: True
azext_devops.devops_sdk._file_cache: attempting to read file C:\Users\user.name.azure-devops\python-sdk\cache\resources.json as utf-8-sig
urllib3.connectionpool: Starting new HTTPS connection (1): dev.azure.com:443
azext_devops.devops_sdk.connection: File cache hit for resources on: https://dev.azure.com/organizationName
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk.client: Route template: _apis/{area}/pools/{poolId}/{resource}/{agentId}
azext_devops.devops_sdk.client: Api version '5.1'
azext_devops.devops_sdk.client: GET https://dev.azure.com/organizationName/_apis/distributedtask/pools/1/agents
azext_devops.devops_sdk.client: Request content: None
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: Starting new HTTPS connection (1): dev.azure.com:443
urllib3.connectionpool: https://dev.azure.com:443 "POST /organizationName/_apis/CustomerIntelligence/Events HTTP/1.1" 204 0
urllib3.connectionpool: https://dev.azure.com:443 "GET /organizationName/_apis/distributedtask/pools/1/agents HTTP/1.1" 200 5750
azext_devops.devops_sdk.client: Response content: b'{"count":11,"value":[{"_links":{"self":{"href":"https://dev.azure.com/organizationName/_apis/distributedtask/pools/1/agents/999"},"web":{"href":"https://dev.azure.com/organizationName/_settings/agentpools?view=jobs&poolId=1&agentId=999"}},"maxParallelism":1,"createdOn":"2019-01-23T15:45:57.007Z","statusChangedOn":"2026-04-02T10:04:47.57Z","authorization":{"clientId":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","publicKey":{"exponent":"AQAB","modulus":"omitted"}},"id":999,"name":"MachineName1","version":"4.255.0","osDescription":"Microsoft Windows 10.0.19045","enabled":false,"status":"online","provisioningState":"Provisioned","accessPoint":"VstsAccessMapping"}]}'
cli.knack.cli: Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x000001E334F52340>, <function _x509_from_base64_to_hex_transform at 0x000001E334F523E0>]
cli.knack.cli: Event: CommandInvoker.OnFilterResult [<function CLIQuery.handle_query_parameter..filter_output at 0x000001E335A879C0>]
Name Status Enabled Version
MachineName1 online False 4.255.0
cli.knack.cli: Event: Cli.SuccessfulExecute []
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x000001E334F11760>]
az_command_data_logger: exit code: 0
cli.main: Command ran in 2.580 seconds (init: 0.643, invoke: 1.937)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 3657 in cache file under C:\Users\user.name.azure\telemetry\20260402130922932
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\telemetry_init_.pyc C:\Users\user.name.azure C:\Users\user.name.azure\telemetry\20260402130922932"
telemetry.process: Return from creating process 36604
telemetry.main: Finish creating telemetry
Expected behavior
Warning is resolved by updating the tool to a new version that does not contain deprecated dependencies.
Environment Summary
PS C:\Code> az version
{
"azure-cli": "2.80.0",
"azure-cli-core": "2.80.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"account": "0.2.5",
"azure-devops": "0.26.0"
}
}
Additional context
No response