Script to create a self-contained installation of the EBCLI#4
Merged
rahulrajaram merged 4 commits intomasterfrom Apr 16, 2019
Merged
Script to create a self-contained installation of the EBCLI#4rahulrajaram merged 4 commits intomasterfrom
rahulrajaram merged 4 commits intomasterfrom
Conversation
e548ccc to
5ff6123
Compare
This script will: - create a unique virtualenv for the EBCLI - create .py, .bat, .ps1 wrappers around it such that when any of these wrappers is invoked to execute an 'eb' command, the unique virtualenv is activated. After the 'eb' process is returned, the virtualenv is deactivated.
This will be useful during testing specific commits/development versions of the package
5ff6123 to
34de91a
Compare
jsheld
approved these changes
Apr 10, 2019
|
|
||
| Prerequisites: | ||
|
|
||
| 1. Python + pip (preferably Python 3.7, although Python 2.7, 3.4, 3.5, |
Contributor
There was a problem hiding this comment.
Wonder if this may be digging us a hole that leads to problems down the line. Why not just make it 3.7?
Contributor
Author
There was a problem hiding this comment.
Good point.
There was a brief period where I felt it might be more work to restrict Python 2.7 usage, however, I don't think that is a problem anymore given that we are providing a way for them to install Python as well.
I'll make the change in future PR.
| ebcli_ps1_script_path = os.path.join(executables_dir, 'eb.ps1') | ||
| ebcli_bat_script_path = os.path.join(executables_dir, 'eb.bat') | ||
|
|
||
| if sys.platform.startswith('win32'): |
Contributor
There was a problem hiding this comment.
Is this true for both x86 and amd64 platforms?
jsheld
approved these changes
Apr 10, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Overview
This script will:
.py,.bat,.ps1wrappers around it such that when any of these wrappers is invoked to execute an 'eb' command, the uniquevirtualenvis activated. After theebprocess is returned, thevirtualenvis deactivated.2. Installation Prerequisites
virtualenvTypically, modern Python installations include
pip, so the user shouldn't have to installpipseparately.It has been recognized that installing Python, and
virtualenv(throughpip) can challenge some users, so a future effort will solve this problem throughpyenv.3. Testing:
Without a Python in
PATH:python bundled_installer.py, the script fails/path/to/python bundled_installer.py, the script fails to create a virtualenv, and hence fails/path/to/python bundled_installer.py --python-installation /path/to/python:virtualenvcannot be found, the script failsvirtualenvexists, the script succeeds in installingeband its wrappersupon a successful installation on Linux/MacOS:
ebwas successfully installedupon a successful installation on Windows:
ebwill be unavailable; the shell needs to be restarted.by default, the latest version of the EBCLI on PyPi is installed. If the isolated virtualenv already exists, an attempt to upgrade the installation will be made (the script will always perform
pip install --upgrade awsebcli.older versions of the EBCLI can be installed as
python bundled_installer.py --version VERSION.by default, the virtualenv is installed in the user's home directory. If home cannot be determined, the script is exited after informing the user that they need to pass
--location LOCATIONexplicitly.with the
--location LOCATIONargument, the virtualenv is installed atLOCATION. Consequently, the instructions to amend path will referenceLOCATION.each of the
ebwrappers should exit with the exit code the realebcommand returned. (useecho $?,$LASTEXITCODE,echo %ERRORLEVEL%, on Bash/Zsh, PowerShell and CMD Promp respectively).if the virtualenv already exists but was not created by the script, an error message is printed asking the user to either delete the directory or to specify an alternate location using
--location LOCATION.4. Shortcomings
installation is not supported on Windows using Cygwin, git-bash, and other Unix-like shells.
Python, and
virtualenvare prerequisitesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.