-
Notifications
You must be signed in to change notification settings - Fork 409
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
Azure CLI: Compatibility with Debian bookworm
#578
Conversation
Linking #577 Problem tl;dr as show in the linked issue: OS provide Python distros can mix package management with os package managers with pip leading to confustion in where packages are. PEP 668 was published as guidance for how to properly isolate the OS python install, and best pratice for a variety of situations where you might be trying to install Python. |
@crazy4pi314 In this instance (installing the Azure CLI which need be installed system-wide), what changes would you recommend I make in this PR? There are lots of instances in this repo where we're using pip to install tools globally, so having one good example of how to proceed would be useful. |
Testing some things now, will make suggestions shortly! |
Ok so for the azure-cli one, is there a need to have the full install of python as well as installing the CLI? If not, I could suggest just using pipx as provided from apt by putting this in
You can probably get rid of most of the python/pip management code there if it is the case Python is not needed otherwise for the CLI somewhere. I tested this on "mcr.microsoft.com/devcontainers/base:bookworm" but would be good to try in the pipeline. Looking now more at the messier Python one! |
For the python one, I think there is a much more nuanced question there, there are a lot of ways to "install python" and that do different things such that not everyone will be happy. I think that's ok as this is an opnionated feature, and I would think that if I as the user wanted to "install python version x (or latest)" this would install python via wget-ing the appropriate build of python from Python.org, setting up symlinks, and setting up appropriate venvs and path defaults." This is not really at all what the exsisting feature does, it pretty heavily relies on using the system packaged python (the default even) in the ways the PEP is trying to prevent. The error message itself:
Would suggest that changing
I looked at how the Python docker image does it, which always wgets source tars from python.org and then builds. Idk of a short "fix" here that would have the behaviour I would expect, I would probably pick build from scratch/wget the prebuilt from python.org as default, installing create a venv and disable the "os-provided" option in version selecting (as that is what we are trying to prevent here.) |
060b057
to
4355158
Compare
One of the dependencies is a version of python: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=script |
bookworm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
closes #589
related #577
Changes needed to the Azure CLI Feature post Debian bookworm / PEP 668
When azure-cli binaries aren't available from
apt
, checks ifpipx
if available in apt and if so, attempts to use that to install the Azure CLI. From the base images I tested,pipx
is only available in thebookworm
apt repos (and that's the goal for this PR!).