This is an automated email from the ASF dual-hosted git repository.

jincheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit ea125a3d14a07935cd5766fcbe411254595c386b
Author: Dian Fu <fudian...@alibaba-inc.com>
AuthorDate: Sun Jun 23 12:26:42 2019 +0800

    [FLINK-12931][python] Fix lint-python.sh cannot find flake8
---
 flink-python/dev/lint-python.sh | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/flink-python/dev/lint-python.sh b/flink-python/dev/lint-python.sh
index c3a8339..e681589 100755
--- a/flink-python/dev/lint-python.sh
+++ b/flink-python/dev/lint-python.sh
@@ -204,7 +204,7 @@ function install_py_env() {
 # In some situations,you need to run the script with "sudo". e.g. sudo 
./lint-python.sh
 function install_tox() {
     if [ -f "$TOX_PATH" ]; then
-        ${CONDA_PATH} remove tox -y -q 2>&1 >/dev/null
+        ${CONDA_PATH} remove -p ${CONDA_HOME} tox -y -q 2>&1 >/dev/null
         if [ $? -ne 0 ]; then
             echo "conda remove tox failed \
             please try to exec the script again.\
@@ -213,7 +213,7 @@ function install_tox() {
         fi
     fi
 
-    ${CONDA_PATH} install -c conda-forge tox -y -q 2>&1 >/dev/null
+    ${CONDA_PATH} install -p ${CONDA_HOME} -c conda-forge tox -y -q 2>&1 
>/dev/null
     if [ $? -ne 0 ]; then
         echo "conda install tox failed \
         please try to exec the script again.\
@@ -226,7 +226,7 @@ function install_tox() {
 # In some situations,you need to run the script with "sudo". e.g. sudo 
./lint-python.sh
 function install_flake8() {
     if [ -f "$FLAKE8_PATH" ]; then
-        ${CONDA_PATH} remove flake8 -y -q 2>&1 >/dev/null
+        ${CONDA_PATH} remove -p ${CONDA_HOME} flake8 -y -q 2>&1 >/dev/null
         if [ $? -ne 0 ]; then
             echo "conda remove flake8 failed \
             please try to exec the script again.\
@@ -235,7 +235,7 @@ function install_flake8() {
         fi
     fi
 
-    ${CONDA_PATH} install -c anaconda flake8 -y -q 2>&1 >/dev/null
+    ${CONDA_PATH} install -p ${CONDA_HOME} -c anaconda flake8 -y -q 2>&1 
>/dev/null
     if [ $? -ne 0 ]; then
         echo "conda install flake8 failed \
         please try to exec the script again.\
@@ -248,7 +248,7 @@ function install_flake8() {
 # In some situations,you need to run the script with "sudo". e.g. sudo 
./lint-python.sh
 function install_sphinx() {
     if [ -f "$SPHINX_PATH" ]; then
-        ${CONDA_PATH} remove sphinx -y -q 2>&1 >/dev/null
+        ${CONDA_PATH} remove -p ${CONDA_HOME} sphinx -y -q 2>&1 >/dev/null
         if [ $? -ne 0 ]; then
             echo "conda remove sphinx failed \
             please try to exec the script again.\
@@ -257,7 +257,7 @@ function install_sphinx() {
         fi
     fi
 
-    ${CONDA_PATH} install -c anaconda sphinx -y -q 2>&1 >/dev/null
+    ${CONDA_PATH} install -p ${CONDA_HOME} -c anaconda sphinx -y -q 2>&1 
>/dev/null
     if [ $? -ne 0 ]; then
         echo "conda install sphinx failed \
         please try to exec the script again.\
@@ -529,6 +529,9 @@ CURRENT_DIR="$(cd "$( dirname "$0" )" && pwd)"
 FLINK_PYTHON_DIR=$(dirname "$CURRENT_DIR")
 pushd "$FLINK_PYTHON_DIR" &> /dev/null
 
+# conda home path
+CONDA_HOME=$CURRENT_DIR/.conda
+
 # conda path
 CONDA_PATH=$CURRENT_DIR/.conda/bin/conda
 

Reply via email to