Skip to content

azure-cli v2.69.0 does not work with a stable release of azure-batch #30814

@ShermanCAA

Description

@ShermanCAA

Describe the bug

The latest release of azure-cli v2.69.0 depends on a pre-release version of azure-batch

'azure-batch~=15.0.0b1',
, which breaks software that relies on the latest stable version of azure-batch v14.2.0

The class signature has changed significantly from BatchServiceClient to BatchClient

Related command

Using the python SDK:

  1. Install latest version of azure-batch from PyPI (https://pypi.org/project/azure-batch/)
  2. Install latest version of azure-cli from PyPI (https://pypi.org/project/azure-cli/)
  3. from azure.batch import BatchServiceClient

Errors

ImportError: cannot import name 'BatchServiceClient' from 'azure.batch'...

Issue script & Debug output

ImportError while importing test module '/home/vsts/work/1/s/Pipelines/RestartPools/tests/test_restart_pools.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
Pipelines/RestartPools/tests/test_restart_pools.py:11: in <module>
    import restart_pools as p
Pipelines/RestartPools/activities/python/restart_pools.py:35: in <module>
    import common.batch.pool as p
common/common/batch/pool.py:6: in <module>
    from azure.batch import BatchServiceClient
E   ImportError: cannot import name 'BatchServiceClient' from 'azure.batch' (/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/azure/batch/__init__.py)

Expected behavior

No discrepancy between latest stable versions of azure-batch and azure-cli

Environment Summary

azure-cli: 2.69.0
azure-batch: 14.2.0
Python: 3.10.16
OS: Ubuntu-22.04

Additional context

Related issue: Azure/azure-sdk-for-python#39676

Metadata

Metadata

Assignees

Labels

Customer UsageService AttentionThis issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions