Skip to content

Commit

Permalink
Use pip 8 (installed via pipstrap) instead of peep. Close certbot#2596.
Browse files Browse the repository at this point in the history
This should solve our unicode error (erikrose/peep#125) as well as many other errors caused by pip, setuptools, or wheel being really, really old. It also means I don't have to maintain peep anymore for LE's sake.

* Revert the patch that added the InstallRequirements function, since we're back to needing only 1 requirements file.
  • Loading branch information
erikrose committed Mar 4, 2016
1 parent f2390ed commit a45b7a3
Show file tree
Hide file tree
Showing 7 changed files with 656 additions and 2,382 deletions.
1,463 changes: 299 additions & 1,164 deletions letsencrypt-auto-source/letsencrypt-auto

Large diffs are not rendered by default.

40 changes: 17 additions & 23 deletions letsencrypt-auto-source/letsencrypt-auto.template
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Bootstrap() {
else
echo "Sorry, I don't know how to bootstrap Let's Encrypt on your operating system!"
echo
echo "You will need to bootstrap, configure virtualenv, and run a peep install manually."
echo "You will need to bootstrap, configure virtualenv, and run pip install manually."
echo "Please see https://letsencrypt.readthedocs.org/en/latest/contributing.html#prerequisites"
echo "for more info."
fi
Expand All @@ -169,19 +169,6 @@ TempDir() {
mktemp -d 2>/dev/null || mktemp -d -t 'le' # Linux || OS X
}

InstallRequirements() {
set +e
PEEP_OUT=`"$VENV_BIN/python" "$TEMP_DIR/peep.py" install -r "$TEMP_DIR/$1"`
PEEP_STATUS=$?
set -e
if [ "$PEEP_STATUS" != 0 ]; then
# Report error. (Otherwise, be quiet.)
echo "Had a problem while downloading and verifying Python packages:"
echo "$PEEP_OUT"
rm -rf "$VENV_PATH"
exit 1
fi
}


if [ "$1" = "--le-auto-phase2" ]; then
Expand All @@ -205,23 +192,30 @@ if [ "$1" = "--le-auto-phase2" ]; then

echo "Installing Python packages..."
TEMP_DIR=$(TempDir)
trap "rm -rf '$TEMP_DIR'" EXIT
# There is no $ interpolation due to quotes on starting heredoc delimiter.
# -------------------------------------------------------------------------
cat << "UNLIKELY_EOF" > "$TEMP_DIR/setuptools-requirements.txt"
{{ setuptools-requirements.txt }}
UNLIKELY_EOF
# -------------------------------------------------------------------------
cat << "UNLIKELY_EOF" > "$TEMP_DIR/letsencrypt-auto-requirements.txt"
{{ letsencrypt-auto-requirements.txt }}
UNLIKELY_EOF
# -------------------------------------------------------------------------
cat << "UNLIKELY_EOF" > "$TEMP_DIR/peep.py"
{{ peep.py }}
cat << "UNLIKELY_EOF" > "$TEMP_DIR/pipstrap.py"
{{ pipstrap.py }}
UNLIKELY_EOF
# -------------------------------------------------------------------------
InstallRequirements "setuptools-requirements.txt"
InstallRequirements "letsencrypt-auto-requirements.txt"
# Set PATH so pipstrap upgrades the right (v)env:
PATH="$VENV_BIN:$PATH" "$VENV_BIN/python" "$TEMP_DIR/pipstrap.py"
set +e
PIP_OUT=`"$VENV_BIN/pip" install --require-hashes -r "$TEMP_DIR/letsencrypt-auto-requirements.txt" 2>&1`
PIP_STATUS=$?
set -e
rm -rf "$TEMP_DIR"
if [ "$PIP_STATUS" != 0 ]; then
# Report error. (Otherwise, be quiet.)
echo "Had a problem while installing Python packages:"
echo "$PIP_OUT"
rm -rf "$VENV_PATH"
exit 1
fi
echo "Installation succeeded."
fi
echo "Requesting root privileges to run letsencrypt..."
Expand Down
394 changes: 182 additions & 212 deletions letsencrypt-auto-source/pieces/letsencrypt-auto-requirements.txt

Large diffs are not rendered by default.

Loading

0 comments on commit a45b7a3

Please sign in to comment.