Open jiasli opened 2 years ago
packaging
Homebrew install azure-cli
requirements from src. In some packages, the setup.py
is not standard and installing these packages will create __init__.py
in above folders.
For example, azure-keyvault 1.1.0 uses pkg_resources
to accomplish namespace package. But its setup.py
does not contain namespace_packages=['azure']
, so pip install
just copies the __init__.py
to azure
folder rather than skip it.
One possible fix is updating Homebrew formula to replace src with Wheels, as __init__.py
is removed explicitly in Wheels by wheel build script, .
package | latest version | auzre/init.py | azure/mgmt/init.py |
---|---|---|---|
azure-keyvault-1.1.0 | 4.2.0 | x | |
azure-loganalytics-0.1.0 | 0.1.1 | x | |
azure-mgmt-consumption-2.0.0 | 9.0.0 | x | x |
azure-mgmt-datalake-analytics-0.2.1 | 0.6.0 | x | x |
azure-mgmt-datalake-store-0.5.0 | 0.5.0 | x | x |
azure-mgmt-relay-0.1.0 | 1.1.0 | x | x |
According to https://github.com/tdsmith/homebrew-pypi-poet/pull/42 , homebrew-pypi-poet
only support build from source and homebrew
also has --no-binary
param when install Python dependencies. It seems that we have to update the dependencies to fix this.
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
andazure.mgmt
still have__init__.py
files:This brings problems:
azure
namespace package installed by extensions won't work: https://github.com/Azure/azure-cli-extensions/issues/4562pkg_resources
is slow and this slows down the execution speed of Azure CLI