You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ad...@apache.org on 2019/12/11 22:45:54 UTC

[kudu] 01/02: build-and-test.sh: add PIP_FLAGS

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

adar pushed a commit to branch branch-1.9.x
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 4c0ad2e01fd84c70e8c9450964a3e750edc25580
Author: Adar Dembo <ad...@cloudera.com>
AuthorDate: Wed Apr 24 17:09:27 2019 -0700

    build-and-test.sh: add PIP_FLAGS
    
    We want to control pip's caching behavior using --cache-dir and
    --no-cache-dir. Importantly, these are _pip_ flags and not _pip install_
    flags, so we must introduce a new environment variable to pass them in.
    
    Change-Id: I98c0418debbf706df32479bb47e68aece903e106
    Reviewed-on: http://gerrit.cloudera.org:8080/13110
    Tested-by: Adar Dembo <ad...@cloudera.com>
    Reviewed-by: Andrew Wong <aw...@cloudera.com>
    (cherry picked from commit b820b2469e6f45b936d765e729cf1f9ac86799b3)
    Reviewed-on: http://gerrit.cloudera.org:8080/14886
    Reviewed-by: Grant Henke <gr...@apache.org>
---
 build-support/jenkins/build-and-test.sh | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/build-support/jenkins/build-and-test.sh b/build-support/jenkins/build-and-test.sh
index 5051ce6..b6e6b01 100755
--- a/build-support/jenkins/build-and-test.sh
+++ b/build-support/jenkins/build-and-test.sh
@@ -65,9 +65,14 @@
 #     option is not mutually exclusive from BUILD_PYTHON. If both options
 #     are set (default), then both will be run.
 #
+#   PIP_FLAGS  Default: ""
+#     Extra flags which are passed to 'pip' when setting up the build
+#     environment for the Python wrapper.
+#
 #   PIP_INSTALL_FLAGS  Default: ""
 #     Extra flags which are passed to 'pip install' when setting up the build
-#     environment for the Python wrapper.
+#     environment for the Python wrapper. Python arguments are
+#     context-dependent so sadly we can't reuse PIP_FLAGS here.
 #
 #   GRADLE_FLAGS       Default: ""
 #     Extra flags which are passed to 'gradle' when running Gradle commands.
@@ -436,13 +441,16 @@ if [ "$BUILD_PYTHON" == "1" ]; then
   # Beginning with pip 10, Python 2.6 is no longer supported. Attempting to
   # upgrade to pip 10 on Python 2.6 yields syntax errors. We don't need any new
   # pip features, so let's pin to the last pip version to support Python 2.6.
+  #
+  # The absence of $PIP_FLAGS is intentional: older versions of pip may not
+  # support the flags that we want to use.
   pip install -i https://pypi.python.org/simple $PIP_INSTALL_FLAGS --upgrade 'pip < 10.0.0b1'
 
   # New versions of pip raise an exception when upgrading old versions of
   # setuptools (such as the one found in el6). The workaround is to upgrade
   # setuptools on its own, outside of requirements.txt, and with the pip version
   # check disabled.
-  pip install --disable-pip-version-check $PIP_INSTALL_FLAGS --upgrade 'setuptools >= 0.8'
+  pip $PIP_FLAGS install --disable-pip-version-check $PIP_INSTALL_FLAGS --upgrade 'setuptools >= 0.8'
 
   # One of our dependencies is pandas, installed below. It depends on numpy, and
   # if we don't install numpy directly, the pandas installation will install the
@@ -453,14 +461,14 @@ if [ "$BUILD_PYTHON" == "1" ]; then
   # so we must pass in the current values of CC and CXX.
   #
   # See https://github.com/numpy/numpy/releases/tag/v1.12.0 for more details.
-  CC=$CLANG CXX=$CLANG++ pip install $PIP_INSTALL_FLAGS 'numpy < 1.12.0'
+  CC=$CLANG CXX=$CLANG++ pip $PIP_FLAGS install $PIP_INSTALL_FLAGS 'numpy < 1.12.0'
 
   # We've got a new pip and new setuptools. We can now install the rest of the
   # Python client's requirements.
   #
   # Installing the Cython dependency may involve some compiler work, so we must
   # pass in the current values of CC and CXX.
-  CC=$CLANG CXX=$CLANG++ pip install $PIP_INSTALL_FLAGS -r requirements.txt
+  CC=$CLANG CXX=$CLANG++ pip $PIP_FLAGS install $PIP_INSTALL_FLAGS -r requirements.txt
 
   # We need to install Pandas manually because although it's not a required
   # package, it is needed to run all of the tests.
@@ -470,7 +478,7 @@ if [ "$BUILD_PYTHON" == "1" ]; then
   #
   # pandas 0.18 dropped support for python 2.6. See https://pandas.pydata.org/pandas-docs/version/0.23.0/whatsnew.html#v0-18-0-march-13-2016
   # for more details.
-  CC=$CLANG CXX=$CLANG++ pip install $PIP_INSTALL_FLAGS 'pandas < 0.18'
+  CC=$CLANG CXX=$CLANG++ pip $PIP_FLAGS install $PIP_INSTALL_FLAGS 'pandas < 0.18'
 
   # Delete old Cython extensions to force them to be rebuilt.
   rm -Rf build kudu_python.egg-info kudu/*.so
@@ -521,6 +529,9 @@ if [ "$BUILD_PYTHON3" == "1" ]; then
   # preventing it from working properly with Python 3.4 as well. Therefore we
   # must pin to a pip version from before 19.0.
   #
+  # The absence of $PIP_FLAGS is intentional: older versions of pip may not
+  # support the flags that we want to use.
+  #
   # 1. https://github.com/pypa/pip/issues/6175
   pip install -i https://pypi.python.org/simple $PIP_INSTALL_FLAGS --upgrade 'pip < 19.0'
 
@@ -528,7 +539,7 @@ if [ "$BUILD_PYTHON3" == "1" ]; then
   # setuptools (such as the one found in el6). The workaround is to upgrade
   # setuptools on its own, outside of requirements.txt, and with the pip version
   # check disabled.
-  pip install --disable-pip-version-check $PIP_INSTALL_FLAGS --upgrade 'setuptools >= 0.8'
+  pip $PIP_FLAGS install --disable-pip-version-check $PIP_INSTALL_FLAGS --upgrade 'setuptools >= 0.8'
 
   # One of our dependencies is pandas, installed below. It depends on numpy, and
   # if we don't install numpy directly, the pandas installation will install the
@@ -540,21 +551,21 @@ if [ "$BUILD_PYTHON3" == "1" ]; then
   # so we must pass in the current values of CC and CXX.
   #
   # See https://github.com/numpy/numpy/releases/tag/v1.16.0rc1 for more details.
-  CC=$CLANG CXX=$CLANG++ pip install $PIP_INSTALL_FLAGS 'numpy < 1.16.0'
+  CC=$CLANG CXX=$CLANG++ pip $PIP_FLAGS install $PIP_INSTALL_FLAGS 'numpy < 1.16.0'
 
   # We've got a new pip and new setuptools. We can now install the rest of the
   # Python client's requirements.
   #
   # Installing the Cython dependency may involve some compiler work, so we must
   # pass in the current values of CC and CXX.
-  CC=$CLANG CXX=$CLANG++ pip install $PIP_INSTALL_FLAGS -r requirements.txt
+  CC=$CLANG CXX=$CLANG++ pip $PIP_FLAGS install $PIP_INSTALL_FLAGS -r requirements.txt
 
   # We need to install Pandas manually because although it's not a required
   # package, it is needed to run all of the tests.
   #
   # Installing pandas may involve some compiler work, so we must pass in the
   # current values of CC and CXX.
-  CC=$CLANG CXX=$CLANG++ pip install $PIP_INSTALL_FLAGS pandas
+  CC=$CLANG CXX=$CLANG++ pip $PIP_FLAGS install $PIP_INSTALL_FLAGS pandas
 
   # Delete old Cython extensions to force them to be rebuilt.
   rm -Rf build kudu_python.egg-info kudu/*.so