certbot/tests/letstest/scripts/test_sdists.sh
Brad Warren f8614e7c04 Fix centos6 test_sdists (#7068)
* Use Python 3 when appropriate.

* fix venv path
2019-05-17 11:03:00 +02:00

44 lines
1.1 KiB
Bash
Executable file

#!/bin/sh -xe
cd letsencrypt
./certbot-auto --install-only -n --debug
PLUGINS="certbot-apache certbot-nginx"
PYTHON_MAJOR_VERSION=$(/opt/eff.org/certbot/venv/bin/python --version 2>&1 | cut -d" " -f 2 | cut -d. -f1)
TEMP_DIR=$(mktemp -d)
VERSION=$(letsencrypt-auto-source/version.py)
if [ "$PYTHON_MAJOR_VERSION" = "3" ]; then
VENV_PATH="venv3"
VENV_SCRIPT="tools/venv3.py"
else
VENV_SCRIPT="tools/venv.py"
VENV_PATH="venv"
fi
# setup venv
"$VENV_SCRIPT" --requirement letsencrypt-auto-source/pieces/dependency-requirements.txt
. "$VENV_PATH/bin/activate"
# pytest is needed to run tests on some of our packages so we install a pinned version here.
tools/pip_install.py pytest
# build sdists
for pkg_dir in acme . $PLUGINS; do
cd $pkg_dir
python setup.py clean
rm -rf build dist
python setup.py sdist
mv dist/* $TEMP_DIR
cd -
done
# test sdists
cd $TEMP_DIR
for pkg in acme certbot $PLUGINS; do
tar -xvf "$pkg-$VERSION.tar.gz"
cd "$pkg-$VERSION"
python setup.py build
python setup.py test
python setup.py install
cd -
done