Azure / Azure/azure-cli-dev-tools

ModuleNotFoundError on `azdev extension publish`

Aperta
#529 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
91
Fork
134
Merge medio
2h 51m
PR unite (30g)
1

Descrizione

## Description

I'm attempting to use `azdev extension publish`, but I'm getting the following error:

```
No module named 'azure.multiapi.storage'
Traceback (most recent call last):
File "/home/gerobayopaz/aaz-env/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/home/gerobayopaz/aaz-env/lib/python3.10/site-packages/knack/invocation.py", line 224, in execute
cmd_result = parsed_args.func(params)
File "/home/gerobayopaz/aaz-env/lib/python3.10/site-packages/knack/commands.py", line 149, in __call__
return self.handler(*args, **kwargs)
File "/home/gerobayopaz/aaz-env/lib/python3.10/site-packages/knack/commands.py", line 256, in _command_handler
result = op(client, **command_args) if client else op(**command_args)
File "/home/gerobayopaz/aaz-env/lib/python3.10/site-packages/azdev/operations/extensions/__init__.py", line 311, in publish_extensions
from azure.multiapi.storage.v2018_11_09.blob import BlockBlobService
ModuleNotFoundError: No module named 'azure.multiapi.storage'
```

I inspected the source code, and here we are importing the BlockBlocService from the `azure-multiapi-storage` package

https://github.com/Azure/azure-cli-dev-tools/blob/ce90f1cf9aad0ee0f6017aef49bac8917f1aeded/azdev/operations/extensions/__init__.py#L309-L311

and setup.py declares it as a dependency, but without a version boundary.

https://github.com/Azure/azure-cli-dev-tools/blob/ce90f1cf9aad0ee0f6017aef49bac8917f1aeded/setup.py#L69-L70

But I think the most important thing is that this need to be migrated to use storagev2 api.

## Version info

#### azdev

```bash
azdev --version
```

Output
```0.2.5

Python (Linux) 3.10.12 (main, Aug 15 2025, 14:32:43) [GCC 11.4.0]

Python location '/home/gerobayopaz/aaz-env/bin/python'
```

#### azure-multiapi-storage

```bash
pip show azure-multiapi-storage
```

Output:
```
Name: azure-multiapi-storage
Version: 1.5.0
Summary: Microsoft Azure Storage Client Library for Python with multi API version support.
Home-page: https://github.com/Azure/azure-multiapi-storage-python
Author: Microsoft Corporation
Author-email: azpycli@microsoft.com
License: MIT
Location: /home/gerobayopaz/aaz-env/lib/python3.10/site-packages
Requires: azure-common, azure-core, cryptography, msrest, python-dateutil, requests
Required-by: azdev, azure-cli
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia in azdev/operations/extensions/__init__.py, intorno all’importazione di BlockBlobService, e ispeziona setup.py, dove è dichiarato azure-multiapi-storage. Riproduci il problema con azdev extension publish usando l’ambiente segnalato, quindi verifica che la migrazione dell’API di storage e le modifiche alle dipendenze permettano di eseguire il comando senza ModuleNotFoundError.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
cli, devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.