From 7cf8e0c9e6a619cc27c678cd2624c74717ad51ce Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Tue, 6 Sep 2016 20:09:52 +0800 Subject: [PATCH] Lazy install Paddle wheels * install wheels when invoke paddle script if current python don't have paddle packages, or installed a previous version. * Also add `make install` to travis --- .travis.yml | 1 + paddle/scripts/submit_local.sh.in | 34 +++++++++++++++++++++++++++ paddle/scripts/travis/build.sh | 6 +---- paddle/scripts/travis/common.sh | 5 ++++ paddle/scripts/travis/make_install.sh | 5 ++++ paddle/scripts/travis/unittest.sh | 3 +-- python/CMakeLists.txt | 4 ---- 7 files changed, 47 insertions(+), 11 deletions(-) create mode 100755 paddle/scripts/travis/common.sh create mode 100755 paddle/scripts/travis/make_install.sh diff --git a/.travis.yml b/.travis.yml index 644b8dfb236..a78853e15b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,7 @@ before_install: script: - paddle/scripts/travis/build.sh - paddle/scripts/travis/unittest.sh + - paddle/scripts/travis/make_install.sh notifications: email: on_success: change diff --git a/paddle/scripts/submit_local.sh.in b/paddle/scripts/submit_local.sh.in index eed2d315932..6d2cab6b16b 100644 --- a/paddle/scripts/submit_local.sh.in +++ b/paddle/scripts/submit_local.sh.in @@ -43,6 +43,40 @@ fi export PYTHONPATH=${PWD}:${PYTHONPATH} + +# Check python lib installed or not. +pip --help > /dev/null +if [ $? -ne 0 ]; then + echo "pip should be installed to run paddle." + exit 1 +fi + +INSTALLED_VERSION=`pip freeze 2>/dev/null | grep '^paddle' | sed 's/.*==//g'` + +if [ -z ${INSTALLED_VERSION} ]; then + INSTALLED_VERSION="0.0.0" # not installed +fi +cat <