From 71c77cbed58cd1d95d494dcdc7e6a036546aafdc Mon Sep 17 00:00:00 2001 From: xuwei06 Date: Fri, 5 May 2017 09:10:35 -0700 Subject: [PATCH] Use IPython 5.3 for unittest --- cmake/util.cmake | 1 + paddle/scripts/run_python_tests.sh | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/cmake/util.cmake b/cmake/util.cmake index b828eef322b..966e0a7bf60 100644 --- a/cmake/util.cmake +++ b/cmake/util.cmake @@ -149,6 +149,7 @@ endfunction() # Create a python unittest using run_python_tests.sh, # which takes care of making correct running environment function(add_python_test TEST_NAME) + message("PYTHON: ${PYTHON_EXECUTABLE}") add_test(NAME ${TEST_NAME} COMMAND bash ${PROJ_ROOT}/paddle/scripts/run_python_tests.sh ${USE_VIRTUALENV_FOR_TEST} ${PYTHON_EXECUTABLE} ${ARGN} diff --git a/paddle/scripts/run_python_tests.sh b/paddle/scripts/run_python_tests.sh index 9a23c10d14e..f49b233dfdd 100755 --- a/paddle/scripts/run_python_tests.sh +++ b/paddle/scripts/run_python_tests.sh @@ -20,6 +20,8 @@ popd > /dev/null USE_VIRTUALENV_FOR_TEST=$1; shift PYTHON=$1; shift +echo python: $PYTHON +pip list if [ $USE_VIRTUALENV_FOR_TEST -ne 0 ]; then rm -rf .test_env @@ -27,9 +29,22 @@ if [ $USE_VIRTUALENV_FOR_TEST -ne 0 ]; then source .test_env/bin/activate PYTHON=python fi -$PYTHON -m pip install $SCRIPTPATH/../dist/*.whl requests matplotlib IPython -export PYTHONPATH=$SCRIPTPATH/../../python/ +$PYTHON -m pip install $SCRIPTPATH/../dist/*.whl +# The next line is for debug, will be deleted +$PYTHON -m pip list +$PYTHON -m pip install requests matplotlib numpy ipython==5.3 +$PYTHON -m pip list +echo $PYTHON +echo PYTHONPATH: $PYTHONPATH +python -c 'import pkgutil; print(str(list(pkgutil.iter_modules("/opt/python/2.7.12/lib/python2.7/site-packages"))))' +echo "=========================" +python -c 'import numpy; import google; print(dir(google)); import google.protobuf; import pkgutil; print(str(list(pkgutil.iter_modules(google.protobuf.__path__)))); import google.protobuf.descriptor; ' +echo $PYTHON +echo PYTHONPATH: $PYTHONPATH +$PYTHON -c 'import numpy; import google.protobuf.descriptor; print("debug---------------")' +export PYTHONPATH=$PYTHONPATH:$SCRIPTPATH/../../python/ +$PYTHON -c 'import numpy; import google.protobuf.descriptor; print("debug---------------")' for fn in "$@" do -- GitLab