2017-06-08 15:22:46 -04:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
# pip installs the requested packages in editable mode and runs unit tests on
|
|
|
|
|
# them. Each package is installed and tested in the order they are provided
|
|
|
|
|
# before the script moves on to the next package. If CERTBOT_NO_PIN is set not
|
2017-12-18 15:31:36 -05:00
|
|
|
# set to 1, packages are installed using pinned versions of all of our
|
|
|
|
|
# dependencies. See pip_install.sh for more information on the versions pinned
|
|
|
|
|
# to.
|
2017-06-08 15:22:46 -04:00
|
|
|
|
|
|
|
|
if [ "$CERTBOT_NO_PIN" = 1 ]; then
|
2017-12-02 02:40:09 -05:00
|
|
|
pip_install="pip install -q -e"
|
2017-06-08 15:22:46 -04:00
|
|
|
else
|
|
|
|
|
pip_install="$(dirname $0)/pip_install_editable.sh"
|
|
|
|
|
fi
|
|
|
|
|
|
2018-05-18 09:05:26 -04:00
|
|
|
temp_cwd=$(mktemp -d)
|
|
|
|
|
trap "rm -rf $temp_cwd" EXIT
|
|
|
|
|
|
2017-12-02 02:40:09 -05:00
|
|
|
set -x
|
2017-06-08 15:22:46 -04:00
|
|
|
for requirement in "$@" ; do
|
|
|
|
|
$pip_install $requirement
|
|
|
|
|
pkg=$(echo $requirement | cut -f1 -d\[) # remove any extras such as [dev]
|
2018-05-18 09:05:26 -04:00
|
|
|
pkg=$(echo "$pkg" | tr - _ ) # convert package names to Python import names
|
2017-06-08 15:22:46 -04:00
|
|
|
if [ $pkg = "." ]; then
|
|
|
|
|
pkg="certbot"
|
|
|
|
|
fi
|
2018-05-18 09:05:26 -04:00
|
|
|
cd "$temp_cwd"
|
2018-04-18 13:02:31 -04:00
|
|
|
pytest --numprocesses auto --quiet --pyargs $pkg
|
2018-05-18 09:05:26 -04:00
|
|
|
cd -
|
2017-06-08 15:22:46 -04:00
|
|
|
done
|