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

Curl install improvements #1518

Merged
merged 2 commits into from Dec 13, 2016
Merged

Conversation

derekbekoe
Copy link
Member

Closes #1341
Closes #1070
Closes #1009
Closes #939
Closes #1400

  • 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)

@derekbekoe
Copy link
Member Author

derekbekoe commented Dec 8, 2016

Marked as do not merge whilst I test on many different Linux distributions/configurations/Python versions/etc./etc. (and the same for OS X)

Copy link
Member

@tjprescott tjprescott left a 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'
Copy link
Member

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)?

Copy link
Member Author

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')
Copy link
Member

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?

Copy link
Member Author

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
Copy link
Member

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 '{}': "

Copy link
Member Author

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')
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

@tjprescott tjprescott left a comment

Choose a reason for hiding this comment

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

LGTM.

@derekbekoe derekbekoe changed the title [Do Not Merge] Curl install improvements Curl install improvements Dec 13, 2016
- 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants