Skip to content

Commit 4ca5282

Browse files
author
Hal Carleton
committed
remove python installation scripts
1 parent 7f7f9c9 commit 4ca5282

File tree

9 files changed

+92
-572
lines changed

9 files changed

+92
-572
lines changed

DEMO.png

-450 KB
Binary file not shown.

README.md

Lines changed: 87 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,108 @@
1-
## EB CLI Installer
1+
# EB CLI Installer
22

3-
------
4-
5-
### 1. Overview
6-
7-
------
3+
## 1. Overview
84

95
This repository hosts scripts to generate self-contained installations of the [EB CLI](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3.html).
106

11-
------
7+
### 1.1. Prerequisites
128

9+
You will need to have the following prerequisites installed before running the install script.
1310

14-
### 1.1. Prerequisites
11+
* **Git**
12+
* If not already installed you can download git from the [Git downloads page](https://git-scm.com/downloads).
13+
* **Python**
14+
* We recommend that you install Python using the [pyenv](https://github.com/pyenv/pyenv) Python version manager. Alternately, you can download Python from the [Python downloads page](https://www.python.org/downloads/).
15+
* **virtualenv**
16+
* Follow the [virtualenv documentation](https://virtualenv.pypa.io/en/latest/installation.html) to install virtualenv.
1517

16-
If you don't have Git, install it from [Git Downloads](https://git-scm.com/downloads).
18+
## 2. Quick start
1719

18-
Python, which the EBCLI Installer depends on, requires the following prerequisites for each operating system.
20+
### 2.1. Clone this repository
1921

20-
- **Linux**
21-
- **Ubuntu and Debian**
22+
Use the following:
2223

23-
```shell
24-
build-essential zlib1g-dev libssl-dev libncurses-dev libffi-dev libsqlite3-dev libreadline-dev libbz2-dev
25-
```
24+
```
25+
git clone https://github.com/aws/aws-elastic-beanstalk-cli-setup.git
26+
```
2627

27-
- **Amazon Linux and Fedora**
28+
### 2.2. Install/Upgrade the EB CLI
2829

29-
```shell
30-
"Development Tools" zlib-devel openssl-devel ncurses-devel libffi-devel sqlite-devel.x86_64 readline-devel.x86_64 bzip2-devel.x86_64
31-
```
30+
#### MacOS/Linux
31+
On **Bash** or **Zsh**:
3232

33-
- **macOS**
33+
```
34+
python ./aws-elastic-beanstalk-cli-setup/scripts/ebcli_installer.py
35+
```
36+
37+
#### Windows
38+
In **PowerShell** or in a **Command Prompt** window:
3439

35-
```shell
36-
Xcode openssl zlib readline
37-
```
40+
```
41+
python .\aws-elastic-beanstalk-cli-setup\scripts\ebcli_installer.py
42+
```
3843

39-
------
44+
### 2.3. After installation
4045

41-
### 2. Use
46+
On Linux and macOS, the output contains instructions to add the EB CLI (and Python) executable file to the shell's `$PATH` variable, if it isn't already in it.
4247

43-
------
48+
## 3. Usage
4449

45-
#### 2.1. Clone this repository
50+
The `ebcli_installer.py` Python script will install the [awsebcli](https://pypi.org/project/awsebcli/) package in a virtual environment to prevent potential conflicts with other Python packages.
4651

47-
Use the following:
52+
For most use cases you can execute the `ebcli_installer.py` script with no arguments.
4853

49-
```shell
50-
git clone https://github.com/aws/aws-elastic-beanstalk-cli-setup.git
54+
```
55+
python ./aws-elastic-beanstalk-cli-setup/scripts/ebcli_installer.py
5156
```
5257

53-
#### 2.2. Install/Upgrade the EB CLI
58+
### 3.1 Advanced usage
5459

55-
On **Bash** and **Zsh** on macOS and Linux:
60+
- To install a **specific version** of the EB CLI:
5661

57-
```shell
58-
./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer
59-
```
62+
```shell
63+
python scripts/ebcli_installer.py --version 3.14.13
64+
```
6065

61-
In **PowerShell** or in a **Command Prompt** window:
66+
- To install the EB CLI with a specific **version of Python** (the Python version doesn't need to be in `$PATH`):
67+
68+
```shell
69+
python scripts/ebcli_installer.py --python-installation /path/to/some/python/on/your/computer
70+
```
71+
72+
- To install the EB CLI **from source** (Git repository, .tar file, .zip file):
73+
```shell
74+
python scripts/ebcli_installer.py --ebcli-source /path/to/awsebcli.zip
75+
76+
python scripts/ebcli_installer.py --ebcli-source /path/to/EBCLI/codebase/on/your/computer
77+
```
78+
- To install the EB CLI at a **specific location**, instead of in the standard `.ebcli-virtual-env` directory in the user's home directory:
6279

63-
```ps1
64-
.\aws-elastic-beanstalk-cli-setup\scripts\bundled_installer
80+
```shell
81+
python scripts/ebcli_installer.py --location /path/to/ebcli/installation/location
82+
```
83+
### 3.2 Options
84+
85+
```
86+
options:
87+
-h, --help show this help message and exit
88+
-e VIRTUALENV_EXECUTABLE, --virtualenv-executable VIRTUALENV_EXECUTABLE
89+
path to the virtualenv installation to use to create the EBCLI's virtualenv
90+
-i, --hide-export-recommendation
91+
boolean to hide recommendation to modify PATH
92+
-l LOCATION, --location LOCATION
93+
location to store the awsebcli packages and its dependencies in
94+
-p PYTHON_INSTALLATION, --python-installation PYTHON_INSTALLATION
95+
path to the python installation under which to install the awsebcli and its
96+
dependencies
97+
-q, --quiet enable quiet mode to display only minimal, necessary output
98+
-s EBCLI_SOURCE, --ebcli-source EBCLI_SOURCE
99+
filesystem path to a Git repository of the EBCLI, or a .zip or .tar file of
100+
the EBCLI source code; useful when testing a development version of the EBCLI.
101+
-v VERSION, --version VERSION
102+
version of EBCLI to install
65103
```
66104
67-
#### 2.3. Troubleshooting
105+
## 4. Troubleshooting
68106
69107
- **Linux**
70108
@@ -110,123 +148,34 @@ In **PowerShell** or in a **Command Prompt** window:
110148
pip install virtualenv
111149
python .\aws-elastic-beanstalk-cli-setup\scripts\ebcli_installer.py
112150
```
151+
## 5. Frequently asked questions
113152
114-
#### 2.4. After installation
115-
116-
On Linux and macOS, the output contains instructions to add the EB CLI (and Python) executable file to the shell's `$PATH` variable, if it isn't already in it.
117-
118-
#### 2.5. Demo execution of `bundled_installer`
119-
120-
![Demo](./DEMO.png)
121-
122-
### 3. Advanced use
123-
124-
To install the EB CLI, `bundled_installer` runs `ebcli_installer.py`. `ebcli_installer.py` has the following capabilities:
125-
126-
- To install a **specific version** of the EB CLI:
127-
128-
```shell
129-
python scripts/ebcli_installer.py --version 3.14.13
130-
```
131-
132-
- To install the EB CLI with a specific **version of Python** (the Python version doesn't need to be in `$PATH`):
133-
134-
```shell
135-
python scripts/ebcli_installer.py --python-installation /path/to/some/python/on/your/computer
136-
```
137-
138-
- To install the EB CLI **from source** (Git repository, .tar file, .zip file):
139-
```shell
140-
python scripts/ebcli_installer.py --ebcli-source /path/to/awsebcli.zip
141-
142-
python scripts/ebcli_installer.py --ebcli-source /path/to/EBCLI/codebase/on/your/computer
143-
```
144-
- To install the EB CLI at a **specific location**, instead of in the standard `.ebcli-virtual-env` directory in the user's home directory:
145-
146-
```shell
147-
python scripts/ebcli_installer.py --location /path/to/ebcli/installation/location
148-
```
149-
150-
Run the following command to view the help text for `ebcli_installer.py`:
151-
152-
```shell
153-
python scripts/ebcli_installer.py --help
154-
```
153+
### 5.1. For the **experienced Python developer**, what's the advantage of this mode of installation instead of regular `pip` inside a `virtualenv`?
155154
156-
### 4. Frequently asked questions
155+
Even within a `virtualenv`, a developer might need to install multiple packages whose dependencies are in conflict. For example, at times the AWS CLI and the EB CLI have used conflicting versions of `botocore`. [One such instance](https://github.com/aws/aws-cli/issues/3550) was particularly egregious. When there are conflicts, users have to manage separate `virtualenvs` for each of the conflicting packages, or find a combination of the packages without conflicts.
157156
158-
------
157+
Both of these workarounds become unmanageable over time, and as the number of packages that are in conflict increases.
159158
160-
#### 4.1. Can I skip the Python installation?
161-
162-
**Yes.** If you already have Python installed on your system, after step `2.1.`, run the following.
163-
164-
On **Bash** and **Zsh**:
165-
166-
```shell
167-
python aws-elastic-beanstalk-cli-setup/scripts/ebcli_installer.py
168-
```
169-
170-
In **PowerShell** and from the **Command Prompt** window:
171-
172-
```shell
173-
python .\aws-elastic-beanstalk-cli-setup\scripts\ebcli_installer.py
174-
```
175-
176-
#### 4.2. For the **experienced Python developer**, what's the advantage of this mode of installation instead of regular `pip` inside a `virtualenv`?
177-
178-
Even within a `virtualenv`, a developer might need to install multiple packages whose dependencies are in conflict. For example, at times the AWS CLI and the EB
179-
CLI have used conflicting versions of `botocore`. [One such instance](https://github.com/aws/aws-cli/issues/3550) was particularly egregious. When there are
180-
conflicts, users have to manage separate `virtualenvs` for each of the conflicting packages, or find a combination of the packages without conflicts.
181-
Both these workarounds become unmanageable over time, and as the number of packages that are in conflict increases.
182-
183-
#### 4.3. On macOS (or Linux systems with `brew`), is this better than `brew install awsebcli`?
159+
### 5.2. On macOS (or Linux systems with `brew`), is this better than `brew install awsebcli`?
184160
185161
**Yes**, for these reasons:
186162
187163
- The AWS Elastic Beanstalk team has no control over how `brew` operates.
188164
- The `brew install ...` mechanism doesn't solve the problem of dependency conflicts, which is a primary goal of this project.
189165
190-
#### 4.3. For developers who are **new to Python**, does this mode of installation pose challenges?
191-
192-
The opinion of the AWS Elastic Beanstalk team is "**No**".
193-
194-
Aside from the problem described in `4.2.`, developers new to Python are often confused by the presence of multiple versions of Python and `pip` executable files on
195-
their system. A common problem that such developers encounter is that when they install `eb` with one `pip` executable file (presumably using the `sudo`
196-
prefix),
197-
no `eb`-related commands work because the correct set of directories isn't referenced correctly.
198-
199-
Typically, for such developers, use of `virtualenv` is the correct path forward. However, this becomes yet another hurdle before using `eb`.
200-
201-
Another common problem is where users install Python and `pip` in ways that Elastic Beanstalk Documentation doesn't recommend, such as using arbitrary Personal Package Archives
202-
(PPAs) on Ubuntu, or similar unmaintained sources that lack scrutiny.
203-
204-
#### 4.4. Can I execute the Bash scripts in a Cygwin, git-bash, or other Bash-like shell on Windows?
205-
206-
**No**. At this time, we don't directly support execution on Bash-like environments on Windows. Use PowerShell or the Command Prompt window to install. You can
207-
add the location of the `eb` and `Python` executable files to `$PATH` .
208-
209-
#### 4.5. Can I execute the Bash scripts in a `fish` shell?
210-
**Yes**, but only if you have Bash on your computer. At this time we don't provide specific guidance on how to set `$PATH` in Fish, however, Fish has [detailed documentation](https://fishshell.com/docs/current/tutorial.html#tut_path) for this purpose.
211-
212-
#### 4.6. I already have Python installed. Can I still execute `bundled_installer`?
213-
214-
**Yes**. It's safe to execute `bundled_installer` even if you already have Python installed. The installer will skip reinstallation.
215-
216-
#### 4.7. I already have the EB CLI installed. Can I still execute `ebcli_installer.py`?
166+
### 5.3. I already have the EB CLI installed. Can I still execute `ebcli_installer.py`?
217167
218168
**Yes**.
219169
220170
Consider the following two cases:
221171
222-
- `ebcli_installer.py` was previously run, creating `.ebcli-virtual-env` in the user's home directory (or the user's choice of a directory indicated through the
223-
`--location` argument). In this case, the EB CLI will overwrite `.ebcli-virtual-env` and attempt to install the latest version of the EB CLI in the `virtualenv` within it.
172+
- `ebcli_installer.py` was previously run, creating `.ebcli-virtual-env` in the user's home directory (or the user's choice of a directory indicated through the `--location` argument). In this case, the EB CLI will overwrite `.ebcli-virtual-env` and attempt to install the latest version of the EB CLI in the `virtualenv` within it.
224173
225174
- `eb` is in `$PATH`, however, it wasn't installed by `ebcli_installer.py`. In this case, the installer will install `eb` within `.ebcli-virtual-env` in the
226175
user's home directory (or the user's choice of a directory indicated through the `--location` argument), and prompt the user to prefix
227176
`/path-to/.ebcli-virtual-env/executables` to `$PATH`. Until you perform this action, the older `eb` executable file will continue to be referenced when you type `eb`.
228177
229-
#### 4.8. How does `ebcli_installer.py` work?
178+
### 5.4. How does `ebcli_installer.py` work?
230179
231180
When executing the Python script, `ebcli_installer.py` does the following:
232181
@@ -237,24 +186,12 @@ When executing the Python script, `ebcli_installer.py` does the following:
237186
- `.bat` and `.ps1` wrappers for `eb` on Windows.
238187
- When complete, you will be prompted to add `<installation-location>/executables` to `$PATH`, only if the directory is not already in it.
239188
240-
#### 4.8. How does `bundled_installer` work?
241-
242-
- On macOS or Linux, `bundled_installer` uses the extremely popular [`pyenv` project](https://github.com/pyenv/pyenv) to install the latest version of Python 3.7.
243-
- On Windows, it downloads the MSI installer of the latest Python version from Python's website and silently installs it.
244-
245-
#### 4.9. Are there dependency problems that this mode of installation doesn't solve?
189+
### 5.5. Are there dependency problems that this mode of installation doesn't solve?
246190
247191
Unfortunately, **yes**.
248192
249193
Suppose the dependencies of `eb`, say `Dep A` and `Dep B`, are in conflict. Because `pip` lacks dependency management capabilities, the resulting `eb` installation might not work.
250194
251-
#### 4.10. Is it okay to use Python 2.7 to install the EB CLI?
252-
253-
**Yes**, however, be aware that Python 2.7 will be deprecated on January 1, 2020. There won't be security updates after that date.
254-
255-
Also, the latest minor version series, Python 3.7, offers significant improvements over the Python 2.7 series. We highly recommend that you use Python 3.7
256-
for testing purposes, even though the Elastic Beanstalk team tests the EB CLI against Python 2.7.
257-
258-
### 5. License
195+
## 6. License
259196
260197
This library is licensed under the Mozilla Public License Version 2.0.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.2
1+
0.2.0

scripts/bundled_installer

Lines changed: 0 additions & 71 deletions
This file was deleted.

scripts/bundled_installer.bat

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)