Missing `__init__.py` leads to `ModuleNotFoundError: No module named 'xxx'`
Open
Azure CLI Team
feature-request
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
According https://docs.python.org/3/reference/import.html#regular-packages,
> A regular package is typically implemented as a directory containing an `__init__.py` file.
If a directory contains no `__init__.py`, it won't be packaged into the built wheel, leading to `ModuleNotFoundError` when executed. This frequently causes CI failures, such as
```
E ModuleNotFoundError: No module named 'azure.cli.core.sdk'
```
Previous occurrences:
1. https://github.com/Azure/azure-cli/pull/17817
2. https://github.com/Azure/azure-cli/pull/19285
3. (Similar but not exactly the same) https://github.com/Azure/azure-cli/pull/28462#issuecomment-1965911403
Contributor guide
Assessment
This issue has not been assessed yet.