提交 4bc4a44e 编写于 作者: Y Yu Yang 提交者: emailweixu

Check if paddle is installed when unittest. (#134)

上级 98d9b34b
...@@ -22,15 +22,21 @@ ...@@ -22,15 +22,21 @@
# It same as PYTHONPATH=${YOUR_PYTHON_PATH}:$PYTHONPATH {exec...} # It same as PYTHONPATH=${YOUR_PYTHON_PATH}:$PYTHONPATH {exec...}
# #
PYPATH="" if ! python -c "import paddle" >/dev/null 2>/dev/null; then
set -x PYPATH=""
while getopts "d:" opt; do set -x
case $opt in while getopts "d:" opt; do
d) case $opt in
PYPATH=$OPTARG d)
;; PYPATH=$OPTARG
esac ;;
done esac
shift $(($OPTIND - 1)) done
export PYTHONPATH=$PYPATH shift $(($OPTIND - 1))
$@ export PYTHONPATH=$PYPATH
$@
else
echo "paddle package is already in your PYTHONPATH. But unittest need a clean environment."
echo "Please uninstall paddle package before start unittest. Try to 'pip uninstall paddle'"
exit 1
fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册