Files
pipenv/run-tests.sh
T
Matt Davis 5d845dc6b9 Added pytest-cov and addressed outdated references to pip-tools (#5038)
* Add pytest-cov; Remove code references to pip-tools and refactor method _build_package_list

* Regenerate lock file.

* Add back required typing-extensions, not sure how it got dropped from locking previously.

* Adopt the setup.cfg for coverage config.

* Actually pin to the version of click we have vendored in.

* Do not adopt coverage for CI since it slows everything down.  Fix py36 dependency pinning.

* Drop support for 3.6 in this PR.

* No need to exclude the vendor and patched directory from the coverage reprot.
2022-04-14 08:59:27 +02:00

57 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Tested on debian and alpine
# You will need to install some dependencies yourself.
set -eo pipefail
export PYTHONIOENCODING="utf-8"
export LANG=C.UTF-8
# Let's use a temporary cache directory
export PIPENV_CACHE_DIR=`mktemp -d 2>/dev/null || mktemp -d -t 'pipenv_cache'`
# on some Linux OS python is python3
PYTHON=${PYTHON:-"python"}
PIPENV_PYTHON="${PIPENV_PYTHON:-3.7}"
PIP_CALL="${PIP_CALL:-${PYTHON} -m pip install --user}"
HOME=$(readlink -f ~/)
if [[ -z "$HOME" ]]; then
if [[ "$USER" == "root" ]]; then
HOME="/root"
fi
fi
if [[ ! -z "$HOME" ]]; then
export PATH="${HOME}/.local/bin:${PATH}"
fi
# This installs the dependencies for pipenv
${PIP_CALL} --upgrade pip setuptools wheel virtualenv --upgrade-strategy=eager
VENV_CMD="${PYTHON} -m pipenv --venv"
RM_CMD="pipenv --rm"
echo "$ PIPENV_PYTHON=${PIPENV_PYTHON} $VENV_CMD && PIPENV_PYTHON=${PIPENV_PYTHON} $RM_CMD"
{ PIPENV_PYTHON="${PIPENV_PYTHON}" $VENV_CMD && PIPENV_PYTHON=${PIPENV_PYTHON} $RM_CMD ; }
echo "Installing dependencies..."
INSTALL_CMD="${PYTHON} -m pipenv install --deploy --dev"
echo "$ PIPENV_PYTHON=${PIPENV_PYTHON} $INSTALL_CMD"
PIPENV_PYTHON=${PIPENV_PYTHON} $INSTALL_CMD
echo "$ git submodule sync && git submodule update --init --recursive"
git submodule sync && git submodule update --init --recursive
echo "$pipenv run pytest -v -ra -n auto --cov-config setup.cfg --fulltrace tests"
PIPENV_PYTHON=${PIPENV_PYTHON} ${PYTHON} -m pipenv run pytest -v -ra -n auto --cov-config setup.cfg --fulltrace tests