Azure / azure-cli

Azure Command-Line Interface
MIT License
4k stars 2.98k forks source link

Support pip as installation method (over MSI and scripts) #14240

Open jeroenhabets opened 4 years ago

jeroenhabets commented 4 years ago

For Python the standard way of installing packages is pip.

The pip installation works already but is not promoted nor supported. If it were we could just add a azure-cli line to our requirements.txtand it would automatically get installed and updated.

Additional context Is there any reason (left) that requires alternative installation options like MSI on Windows and package managers on Linux?

yungezz commented 4 years ago

hi @jeroenhabets thanks for the feedback. Main concern of pip install is that cli dependencies mess up with users' python environment and existing installed packages, all those unexpected python packages dependencies version issues. That's why we recommend user install via package manager per OS

leifericf commented 4 years ago

I just want to add that being able to install azure-cli as a dependency via pip in the usual Pythonic way is required when azure-cli is used within another Python package. Here is a related issue.

Example

We have an internal Python package which uses azure-cli, which is currently broken (specifically, installation of the internal package fails due to a dependency conflict with azure-storage-blob).

My requirements.txt looks like this:

azure-cli==2.5.1
azure-identity==1.2.0
azure-keyvault-secrets==4.1.0
azureml-sdk==1.5.0
snowflake-connector-python[pandas]==2.2.8

Which results in this error:

ERROR: azure-cli 2.5.1 has requirement azure-storage-blob<2.0.0,>=1.3.1, but you'll have azure-storage-blob 12.3.2 which is incompatible.

Presumably due to incorrect dependency resolution between azureml-sdk and azure-cli.

Python version: 3.7.6

Operating system and processor architecture: Darwin-19.4.0-x86_64-i386-64bit

jeroenhabets commented 4 years ago

@IRLeif thanks for bringing another use-case. Regarding your issue, that bit me as well and actually motivated me to log this feature request. I had already logged the azure-storage-blob conflict issue, see : #13876