-
Notifications
You must be signed in to change notification settings - Fork 177
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
check for "python" OR "py" on windows to verify python cli installation #1923
Conversation
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.
@hemarina The implementation to do it as part of pythonExe()
looks good to me. The extra cost of doing LookPath
per CLI command call is negligible. I just had a small suggestion on error handling... I've left out the advice I have but not a lot of details yet, let me know if you run into any issues.
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.
This is good for now.
But I don't really like how we need to call checkPath()
for every method (hence, check the environment every time).
I think we could improve this with sync.once
and with state inside the tool to hold the name
of the binary one time and then re-use it.
It would be also convenient to support ENV VARS to set the binary paths for the tools used by azd. For example, AZD_PYTHON_BIN
. This will allow folks to choose what to use instead of depending on azd-detection.
But this can be done in the future.
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.
LGTM - Thanks for adding this fix for windows folks who don't have py
per PEP-0397!
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash:
pwsh:
WindowsPowerShell install
MSI install
Standalone Binary
MSIContainer
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference (preview)
|
fix #1623
I installed python 3.10 with winget but not able to reproduce the same issue. I realize that the latest winget is using "py.exe" where this issue is caused if other winget is using "python.exe". Adding a check for either "python" or "py" to verify python cli installation.