Azure / Azure/azure-cli

Editable installation doesn't work with setuptools 80.9.0: No module named azure.cli.__main__; 'azure.cli' is a package and cannot be directly executed

Open
#32,042 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

LTS CI fails:

https://dev.azure.com/azclitools/public/_build/results?buildId=269081&view=logs&j=86666e57-faf2-5483-a4de-72294e0f6880&t=7303b7ff-a095-56e0-0151-d5464b43c6c5

```
# Verify installation and build command index
az --version
/mnt/vss/_work/1/s/env/bin/python: No module named azure.cli.__main__; 'azure.cli' is a package and cannot be directly executed
```

This can be reproduced locally on `dev` branch too:

```
> pip install setuptools -U

> azdev setup -c

> python -c "import azure.cli; print(azure.cli.__path__)"
_NamespacePath(['__editable__.azure_cli-2.77.0.finder.__path_hook__', '__editable__.azure_cli_core-2.77.0.finder.__path_hook__', '__editable__.azure_cli_telemetry-1.1.0.finder.__path_hook__', '__editable__.azure_cli_testsdk-0.3.0.finder.__path_hook__'])

> az -v
D:\cli\py313\Scripts\python.exe: No module named azure.cli.__main__; 'azure.cli' is a package and cannot be directly executed
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.