Merge pull request #1361 from letsencrypt/both

Require --debug for many things, including python2.6 platforms
This commit is contained in:
bmw
2015-11-05 20:21:09 -08:00
11 changed files with 75 additions and 32 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ COPY letsencrypt-apache /opt/letsencrypt/src/letsencrypt-apache/
COPY letsencrypt-nginx /opt/letsencrypt/src/letsencrypt-nginx/ COPY letsencrypt-nginx /opt/letsencrypt/src/letsencrypt-nginx/
# requirements.txt not installed! # py26reqs.txt not installed!
RUN virtualenv --no-site-packages -p python2 /opt/letsencrypt/venv && \ RUN virtualenv --no-site-packages -p python2 /opt/letsencrypt/venv && \
/opt/letsencrypt/venv/bin/pip install \ /opt/letsencrypt/venv/bin/pip install \
-e /opt/letsencrypt/src/acme \ -e /opt/letsencrypt/src/acme \
+2 -2
View File
@@ -32,7 +32,8 @@ RUN /opt/letsencrypt/src/ubuntu.sh && \
# the above is not likely to change, so by putting it further up the # the above is not likely to change, so by putting it further up the
# Dockerfile we make sure we cache as much as possible # Dockerfile we make sure we cache as much as possible
COPY setup.py README.rst CHANGES.rst MANIFEST.in requirements.txt DISCLAIMER linter_plugin.py tox.cover.sh tox.ini pep8.travis.sh .pep8 .pylintrc /opt/letsencrypt/src/ # py26reqs.txt not installed!
COPY setup.py README.rst CHANGES.rst MANIFEST.in DISCLAIMER linter_plugin.py tox.cover.sh tox.ini pep8.travis.sh .pep8 .pylintrc /opt/letsencrypt/src/
# all above files are necessary for setup.py, however, package source # all above files are necessary for setup.py, however, package source
# code directory has to be copied separately to a subdirectory... # code directory has to be copied separately to a subdirectory...
@@ -52,7 +53,6 @@ COPY tests /opt/letsencrypt/src/tests/
RUN virtualenv --no-site-packages -p python2 /opt/letsencrypt/venv && \ RUN virtualenv --no-site-packages -p python2 /opt/letsencrypt/venv && \
/opt/letsencrypt/venv/bin/pip install \ /opt/letsencrypt/venv/bin/pip install \
-r /opt/letsencrypt/src/requirements.txt \
-e /opt/letsencrypt/src/acme \ -e /opt/letsencrypt/src/acme \
-e /opt/letsencrypt/src \ -e /opt/letsencrypt/src \
-e /opt/letsencrypt/src/letsencrypt-apache \ -e /opt/letsencrypt/src/letsencrypt-apache \
+1 -1
View File
@@ -1,4 +1,4 @@
include requirements.txt include py26reqs.txt
include README.rst include README.rst
include CHANGES.rst include CHANGES.rst
include CONTRIBUTING.md include CONTRIBUTING.md
+2 -2
View File
@@ -2,6 +2,6 @@ This directory contains scripts that install necessary OS-specific
prerequisite dependencies (see docs/using.rst). prerequisite dependencies (see docs/using.rst).
General dependencies: General dependencies:
- git-core: requirements.txt git+https://* - git-core: py26reqs.txt git+https://*
- ca-certificates: communication with demo ACMO server at - ca-certificates: communication with demo ACMO server at
https://www.letsencrypt-demo.org, requirements.txt git+https://* https://www.letsencrypt-demo.org, py26reqs.txt git+https://*
+1 -1
View File
@@ -4,7 +4,7 @@
export VENV_ARGS="--python python2" export VENV_ARGS="--python python2"
./bootstrap/dev/_venv_common.sh \ ./bootstrap/dev/_venv_common.sh \
-r requirements.txt \ -r py26reqs.txt \
-e acme[testing] \ -e acme[testing] \
-e .[dev,docs,testing] \ -e .[dev,docs,testing] \
-e letsencrypt-apache \ -e letsencrypt-apache \
+2 -2
View File
@@ -13,14 +13,14 @@ VENV_PATH=${VENV_PATH:-"$XDG_DATA_HOME/$VENV_NAME"}
# later steps, causing "ImportError: cannot import name unpack_url" # later steps, causing "ImportError: cannot import name unpack_url"
if [ ! -d $VENV_PATH ] if [ ! -d $VENV_PATH ]
then then
virtualenv --no-site-packages --python python2 $VENV_PATH virtualenv --no-site-packages --python ${LE_PYTHON:-python2} $VENV_PATH
fi fi
. $VENV_PATH/bin/activate . $VENV_PATH/bin/activate
pip install -U setuptools pip install -U setuptools
pip install -U pip pip install -U pip
pip install -U letsencrypt letsencrypt-apache # letsencrypt-nginx pip install -U -r py26reqs.txt letsencrypt letsencrypt-apache # letsencrypt-nginx
echo echo
echo "Congratulations, Let's Encrypt has been successfully installed/updated!" echo "Congratulations, Let's Encrypt has been successfully installed/updated!"
+59 -17
View File
@@ -19,13 +19,53 @@ else
SUDO= SUDO=
fi fi
for arg in "$@" ; do for arg in "$@" ; do
# This first clause is redundant with the third, but hedging on portability # This first clause is redundant with the third, but hedging on portability
if [ "$arg" = "-v" ] || [ "$arg" = "--verbose" ] || echo "$arg" | grep -E -- "-v+$" ; then if [ "$arg" = "-v" ] || [ "$arg" = "--verbose" ] || echo "$arg" | grep -E -- "-v+$" ; then
VERBOSE=1 VERBOSE=1
elif [ "$arg" = "--debug" ] ; then
DEBUG=1
fi fi
done done
ExperimentalBootstrap() {
# Arguments: Platform name, boostrap script name, SUDO command (iff needed)
if [ "$DEBUG" = 1 ] ; then
if [ "$2" != "" ] ; then
echo "Bootstrapping dependencies for $1..."
"$3" "$BOOTSTRAP/$2"
fi
else
echo "WARNING: $1 support is very experimental at present..."
echo "if you would like to work on improving it, please ensure you have backups"
echo "and then run this script again with the --debug flag!"
exit 1
fi
}
DeterminePythonVersion() {
if which python2 > /dev/null ; then
export LE_PYTHON=${LE_PYTHON:-python2}
elif which python2.7 > /dev/null ; then
export LE_PYTHON=${LE_PYTHON:-python2.7}
elif which python > /dev/null ; then
export LE_PYTHON=${LE_PYTHON:-python}
else
echo "Cannot find any Pythons... please install one!"
fi
PYVER=`$LE_PYTHON --version 2>&1 | cut -d" " -f 2 | cut -d. -f1,2 | sed 's/\.//'`
if [ $PYVER -eq 26 ] ; then
ExperimentalBootstrap "Python 2.6"
elif [ $PYVER -lt 26 ] ; then
echo "You have an ancient version of Python entombed in your operating system..."
echo "This isn't going to work."
exit 1
fi
}
# virtualenv call is not idempotent: it overwrites pip upgraded in # virtualenv call is not idempotent: it overwrites pip upgraded in
# later steps, causing "ImportError: cannot import name unpack_url" # later steps, causing "ImportError: cannot import name unpack_url"
if [ ! -d $VENV_PATH ] if [ ! -d $VENV_PATH ]
@@ -35,28 +75,24 @@ then
echo "Cannot find the letsencrypt bootstrap scripts in $BOOTSTRAP" echo "Cannot find the letsencrypt bootstrap scripts in $BOOTSTRAP"
exit 1 exit 1
fi fi
if [ -f /etc/debian_version ] ; then if [ -f /etc/debian_version ] ; then
echo "Bootstrapping dependencies for Debian-based OSes..." echo "Bootstrapping dependencies for Debian-based OSes..."
$SUDO $BOOTSTRAP/_deb_common.sh $SUDO $BOOTSTRAP/_deb_common.sh
elif [ -f /etc/redhat-release ] ; then
echo "Bootstrapping dependencies for RedHat-based OSes..."
$SUDO $BOOTSTRAP/_rpm_common.sh
elif [ -f /etc/arch-release ] ; then elif [ -f /etc/arch-release ] ; then
echo "Bootstrapping dependencies for Archlinux..." echo "Bootstrapping dependencies for Archlinux..."
$SUDO $BOOTSTRAP/archlinux.sh $SUDO $BOOTSTRAP/archlinux.sh
elif [ -f /etc/manjaro-release ] ; then elif [ -f /etc/manjaro-release ] ; then
echo "Bootstrapping dependencies for Manjaro Linux..." ExperimentalBootstrap "Manjaro Linux" majaro.sh "$SUDO"
$SUDO $BOOTSTRAP/manjaro.sh
elif [ -f /etc/redhat-release ] ; then
echo "Bootstrapping dependencies for RedHat-based OSes..."
$SUDO $BOOTSTRAP/_rpm_common.sh
elif [ -f /etc/gentoo-release ] ; then elif [ -f /etc/gentoo-release ] ; then
echo "Bootstrapping dependencies for Gentoo-based OSes..." ExperimentalBootstrap "Gentoo" _gentoo_common.sh "$SUDO"
$SUDO $BOOTSTRAP/_gentoo_common.sh
elif uname | grep -iq FreeBSD ; then elif uname | grep -iq FreeBSD ; then
echo "Bootstrapping dependencies for FreeBSD..." ExperimentalBootstrap "FreeBSD" freebsd.sh "$SUDO"
$SUDO $BOOTSTRAP/freebsd.sh
elif uname | grep -iq Darwin ; then elif uname | grep -iq Darwin ; then
echo "Bootstrapping dependencies for Mac OS X..." ExperimentalBootstrap "Mac OS X" mac.sh
echo "WARNING: Mac support is very experimental at present..."
$BOOTSTRAP/mac.sh
else else
echo "Sorry, I don't know how to bootstrap Let's Encrypt on your operating system!" echo "Sorry, I don't know how to bootstrap Let's Encrypt on your operating system!"
echo echo
@@ -65,24 +101,28 @@ then
echo "for more info" echo "for more info"
fi fi
DeterminePythonVersion
echo "Creating virtual environment..." echo "Creating virtual environment..."
if [ "$VERBOSE" = 1 ] ; then if [ "$VERBOSE" = 1 ] ; then
virtualenv --no-site-packages --python python2 $VENV_PATH virtualenv --no-site-packages --python $LE_PYTHON $VENV_PATH
else else
virtualenv --no-site-packages --python python2 $VENV_PATH > /dev/null virtualenv --no-site-packages --python $LE_PYTHON $VENV_PATH > /dev/null
fi fi
else
DeterminePythonVersion
fi fi
printf "Updating letsencrypt and virtual environment dependencies..." printf "Updating letsencrypt and virtual environment dependencies..."
if [ "$VERBOSE" = 1 ] ; then if [ "$VERBOSE" = 1 ] ; then
echo echo
$VENV_BIN/pip install -U setuptools $VENV_BIN/pip install -U setuptools
$VENV_BIN/pip install -U pip $VENV_BIN/pip install -U pip
$VENV_BIN/pip install -U letsencrypt letsencrypt-apache $VENV_BIN/pip install -r py26reqs.txt -U letsencrypt letsencrypt-apache
# nginx is buggy / disabled for now, but upgrade it if the user has # nginx is buggy / disabled for now, but upgrade it if the user has
# installed it manually # installed it manually
if $VENV_BIN/pip freeze | grep -q letsencrypt-nginx ; then if $VENV_BIN/pip freeze | grep -q letsencrypt-nginx ; then
$VENV_BIN/pip install -U letsencrypt letsencrypt-nginx $VENV_BIN/pip install -U letsencrypt letsencrypt-nginx
fi fi
else else
$VENV_BIN/pip install -U setuptools > /dev/null $VENV_BIN/pip install -U setuptools > /dev/null
@@ -90,6 +130,8 @@ else
$VENV_BIN/pip install -U pip > /dev/null $VENV_BIN/pip install -U pip > /dev/null
printf . printf .
# nginx is buggy / disabled for now... # nginx is buggy / disabled for now...
$VENV_BIN/pip install -r py26reqs.txt
printf .
$VENV_BIN/pip install -U letsencrypt > /dev/null $VENV_BIN/pip install -U letsencrypt > /dev/null
printf . printf .
$VENV_BIN/pip install -U letsencrypt-apache > /dev/null $VENV_BIN/pip install -U letsencrypt-apache > /dev/null
+2 -1
View File
@@ -843,7 +843,8 @@ def prepare_and_parse_args(plugins, args):
"really know what you're doing!") "really know what you're doing!")
helpful.add( helpful.add(
"testing", "--debug", action="store_true", "testing", "--debug", action="store_true",
help="Show tracebacks if the program exits abnormally") help="Show tracebacks in case of errors, and allow letsencrypt-auto "
"execution on experimental platforms")
helpful.add( helpful.add(
"testing", "--no-verify-ssl", action="store_true", "testing", "--no-verify-ssl", action="store_true",
help=config_help("no_verify_ssl"), help=config_help("no_verify_ssl"),
+2
View File
@@ -0,0 +1,2 @@
# https://github.com/bw2/ConfigArgParse/issues/17
git+https://github.com/kuba/ConfigArgParse.git@python2.6-0.9.3#egg=ConfigArgParse
-2
View File
@@ -1,2 +0,0 @@
# https://github.com/bw2/ConfigArgParse/issues/17
git+https://github.com/kuba/ConfigArgParse.git@python2.6#egg=ConfigArgParse
+3 -3
View File
@@ -17,7 +17,7 @@ envlist = py26,py27,py33,py34,cover,lint
commands = commands =
pip install -e acme[testing] pip install -e acme[testing]
nosetests -v acme nosetests -v acme
pip install -r requirements.txt -e .[testing] pip install -r py26reqs.txt -e .[testing]
nosetests -v letsencrypt nosetests -v letsencrypt
pip install -e letsencrypt-apache pip install -e letsencrypt-apache
nosetests -v letsencrypt_apache nosetests -v letsencrypt_apache
@@ -44,7 +44,7 @@ commands =
[testenv:cover] [testenv:cover]
basepython = python2.7 basepython = python2.7
commands = commands =
pip install -r requirements.txt -e acme -e .[testing] -e letsencrypt-apache -e letsencrypt-nginx -e letshelp-letsencrypt pip install -e acme -e .[testing] -e letsencrypt-apache -e letsencrypt-nginx -e letshelp-letsencrypt
./tox.cover.sh ./tox.cover.sh
[testenv:lint] [testenv:lint]
@@ -54,7 +54,7 @@ basepython = python2.7
# duplicate code checking; if one of the commands fails, others will # duplicate code checking; if one of the commands fails, others will
# continue, but tox return code will reflect previous error # continue, but tox return code will reflect previous error
commands = commands =
pip install -r requirements.txt -e acme -e .[dev] -e letsencrypt-apache -e letsencrypt-nginx -e letsencrypt-compatibility-test -e letshelp-letsencrypt pip install -e acme -e .[dev] -e letsencrypt-apache -e letsencrypt-nginx -e letsencrypt-compatibility-test -e letshelp-letsencrypt
./pep8.travis.sh ./pep8.travis.sh
pylint --rcfile=.pylintrc letsencrypt pylint --rcfile=.pylintrc letsencrypt
pylint --rcfile=.pylintrc acme/acme pylint --rcfile=.pylintrc acme/acme