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
Curl install improvements #1518
Conversation
Marked as do not merge whilst I test on many different Linux distributions/configurations/Python versions/etc./etc. (and the same for OS X) |
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.
Mostly questions because I don't understand all of the magic that happens during install. Also one small suggestion.
VIRTUALENV_VERSION = '15.0.0' | ||
BIN_DIR_NAME = 'Scripts' if platform.system() == 'Windows' else 'bin' |
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.
Is this relevant if the CLI is installed with 'bash for Windows' or does it see the platform as Linux (pretty sure the latter)?
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.
It sees the platform as Linux.
EXECUTABLE_NAME = 'az' | ||
|
||
DISABLE_PROMPTS = os.environ.get('AZURE_CLI_DISABLE_PROMPTS') |
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.
Why are we removing the ability to disable prompts?
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.
The curl script is interactive by design so have a few different prompts.
For users who don't want prompts, they should use the pip (or other) install so they can customize the install.
This was left over from when the curl install was the only way to install the CLI (before the public PyPI packages).
|
||
def prompt_input_with_default(msg, default): | ||
if default: | ||
return prompt_input('{} (leave blank to use {}): '.format(msg, default)) or default |
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.
Recommend adding single quotes around the default to separate it from the message:
"{} (leave blank to use '{}': "
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.
done.
create_dir(install_dir) | ||
if os.listdir(install_dir): | ||
print_status("'{}' is not empty and may contain a previous installation.".format(install_dir)) | ||
ans_yes = prompt_y_n('Remove this directory?', 'n') |
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.
Is just removing the directory sufficient? I know it is for a virtual environment install.
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.
Yes removing the directory will remove the install with everything in.
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.
cbe6783
to
f2db6d9
Compare
- Warn of other az executables on PATH - Check native dependencies - Modify the path for the user - Print instructions if user says no to script modifying rc file - Change default install location to ~/azure-cli - Delete old install before installing new. - Verify Python version > 2.7 - Remove DISABLE_PROMPTS support. (the curl script is interactive so no need to support this scenario)
b52da8f
to
877c120
Compare
Closes #1341
Closes #1070
Closes #1009
Closes #939
Closes #1400