Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install azure-cli with pip #536

Closed
wants to merge 2 commits into from

Conversation

beandrad
Copy link
Collaborator

Installing it with apt-get was causing issues when running some commands
that need uamqp library.

Note that since the python docker image already has setuptools== 58.1.0,
we needed to downgrade to a version < 58.0.0 to make it compatible with
azure-cli==2.25.0 (compatible with azure-cli-core==2.25.0 pinned
in this project). See related issue.

iotedgedev Pull Request Checklist

  • Versions updated (both init.py files, CHANGELOG, setup.py, setup.cfg)
  • Unit tests pass locally
  • Quickstart steps locally validated
  • Passes unit tests in CICD pipeline (green on Github pipeline)
  • Pypi RC version passes Edge CICD pipeline validation for cross-tool validation

Additional comments

Installing it with apt-get was causing issues when running some commands
that need uamqp library.

Note that since the python docker image already has `setuptools== 58.1.0`,
we needed to downgrade to a version < 58.0.0 to make it compatible with
azure-cli==2.25.0 (compatible with azure-cli-core==2.25.0 pinned
in this project). See related [issue](Azure/azure-cli#19468).
@@ -58,6 +51,10 @@ RUN \
rm -rf /tmp/* && \
rm -rf /var/lib/apt/lists/*

# Install azure-cli
RUN pip install setuptools==57.0.0 \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setuptools==57.0.0

i believe that this dependency is managed internally by the az cli?

Copy link
Collaborator Author

@beandrad beandrad May 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is true that az cli installs setuptools==52.0.0 (requirements.txt). However, we still need to make sure that the version of setuptools is <58.0.0 before installing az cli because of the following:

  • The installation of python3.9 includes a newer version of setuptools (incompatible with az cli 2.25.0);
  • az cli has a dependency on pygithub==1.38, which may get installed before setuptools is downgraded to 52.0.0 (please note that there's no way to specify the order of installation with pip);
  • this version of pygithub==1.38 needs setuptools <58.0.0 because of a deprecated feature (see code).

Ideally, we should be using newer versions of az cli, but azure-cli-core is pinned to 2.25.0 (see code).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend to use a newer version of az cli instead of trying to account for deprecated lib versions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that would be ideal, but as mentioned, iotedgedev pins azure-cli-core to 2.25.0 (see code), which means that the version of az-cli installed via pip needs to be the same.

@marianan marianan requested a review from mhshami01 April 25, 2022 05:34
@beandrad beandrad closed this May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants