Azure / Azure/azure-cli

In Azure CLI installed by Homebrew, `azure` and `azure.mgmt` still have `__init__.py` files calling `pkg_resources`

Open
#21,910 3 comments 0 reactions 2 assignees Claimed by @bebound View on GitHub
feature-request Packaging/Homebrew
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

Even though https://github.com/Azure/azure-cli/pull/14372 migrated CLI packaging system to PEP 420 Implicit Namespace Packages, In Azure CLI installed by Homebrew, `azure` and `azure.mgmt` still have `__init__.py` files:

```
cat /opt/homebrew/Cellar/azure-cli/2.34.1/libexec/lib/python3.10/site-packages/azure/__init__.py
__import__('pkg_resources').declare_namespace(__name__)

cat /opt/homebrew/Cellar/azure-cli/2.34.1/libexec/lib/python3.10/site-packages/azure/mgmt/__init__.py
__import__('pkg_resources').declare_namespace(__name__)
```

This brings problems:

1. `azure` namespace package installed by extensions won't work: https://github.com/Azure/azure-cli-extensions/issues/4562
2. This defeats the purpose of migrating to PEP 420
3. Loading time of `pkg_resources` is slow and this slows down the execution speed of Azure CLI

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.