You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2017/09/21 02:59:31 UTC

arrow git commit: ARROW-1578: [C++] Run lint checks in Travis CI much earlier at before_script stage to fail faster

Repository: arrow
Updated Branches:
  refs/heads/master 203fb6355 -> d154c1036


ARROW-1578: [C++] Run lint checks in Travis CI much earlier at before_script stage to fail faster

Author: Wes McKinney <we...@twosigma.com>

Closes #1118 from wesm/ARROW-1578 and squashes the following commits:

0bb5202 [Wes McKinney] System python not available on xcode 6.4 machines
d1cf679 [Wes McKinney] Set language: python when linting on macOS
910f684 [Wes McKinney] Fixes for linting. Do not cache .conda_packages
ed9e23a [Wes McKinney] Move linting to separate shell script
b7db083 [Wes McKinney] Only run lint checks when not running in --only-library mode
7e50fad [Wes McKinney] Revert cpplint failure
28fc3fb [Wes McKinney] Typo
329f017 [Wes McKinney] Run lint checks before compiling anything. Make cpplint warning


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/d154c103
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/d154c103
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/d154c103

Branch: refs/heads/master
Commit: d154c10368d86abc03241982ea43a1a872cbea73
Parents: 203fb63
Author: Wes McKinney <we...@twosigma.com>
Authored: Wed Sep 20 22:59:26 2017 -0400
Committer: Wes McKinney <we...@twosigma.com>
Committed: Wed Sep 20 22:59:26 2017 -0400

----------------------------------------------------------------------
 .travis.yml                    |  6 ++++--
 ci/travis_before_script_cpp.sh |  1 +
 ci/travis_lint.sh              | 40 +++++++++++++++++++++++++++++++++++++
 ci/travis_script_cpp.sh        |  2 --
 ci/travis_script_python.sh     |  8 +-------
 5 files changed, 46 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/d154c103/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index f6f6400..4691eeb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -40,8 +40,6 @@ services:
 
 cache:
   ccache: true
-  directories:
-    - $HOME/.conda_packages
 
 matrix:
   fast_finish: true
@@ -58,6 +56,7 @@ matrix:
     - export ARROW_TRAVIS_USE_TOOLCHAIN=1
     - export ARROW_TRAVIS_VALGRIND=1
     - export ARROW_TRAVIS_PLASMA=1
+    - $TRAVIS_BUILD_DIR/ci/travis_lint.sh
     - $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh
     script:
     - $TRAVIS_BUILD_DIR/ci/travis_script_cpp.sh
@@ -65,6 +64,7 @@ matrix:
     - $TRAVIS_BUILD_DIR/ci/travis_script_python.sh 2.7
     - $TRAVIS_BUILD_DIR/ci/travis_script_python.sh 3.6
   - compiler: clang
+    language: cpp
     osx_image: xcode6.4
     os: osx
     cache:
@@ -106,6 +106,7 @@ matrix:
     - source $TRAVIS_BUILD_DIR/ci/travis_install_clang_tools.sh
     - export CC="clang-4.0"
     - export CXX="clang++-4.0"
+    - $TRAVIS_BUILD_DIR/ci/travis_lint.sh
     - $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh
     script:
     - $TRAVIS_BUILD_DIR/ci/travis_script_integration.sh
@@ -123,6 +124,7 @@ matrix:
     before_script:
     - export CC="gcc-4.9"
     - export CXX="g++-4.9"
+    - $TRAVIS_BUILD_DIR/ci/travis_lint.sh
     - $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh --only-library
     - $TRAVIS_BUILD_DIR/ci/travis_before_script_c_glib.sh
     script:

http://git-wip-us.apache.org/repos/asf/arrow/blob/d154c103/ci/travis_before_script_cpp.sh
----------------------------------------------------------------------
diff --git a/ci/travis_before_script_cpp.sh b/ci/travis_before_script_cpp.sh
index d46fa2f..a7f1d27 100755
--- a/ci/travis_before_script_cpp.sh
+++ b/ci/travis_before_script_cpp.sh
@@ -99,6 +99,7 @@ else
           $ARROW_CPP_DIR
 fi
 
+# Build and install libraries
 $TRAVIS_MAKE -j4
 $TRAVIS_MAKE install
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/d154c103/ci/travis_lint.sh
----------------------------------------------------------------------
diff --git a/ci/travis_lint.sh b/ci/travis_lint.sh
new file mode 100755
index 0000000..9b7b474
--- /dev/null
+++ b/ci/travis_lint.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -ex
+
+# Fail fast for code linting issues
+mkdir $TRAVIS_BUILD_DIR/cpp/lint
+pushd $TRAVIS_BUILD_DIR/cpp/lint
+
+cmake ..
+make lint
+
+popd
+
+# Fail fast on style checks
+sudo pip install flake8
+
+PYARROW_DIR=$TRAVIS_BUILD_DIR/python
+
+flake8 --count $PYTHON_DIR/pyarrow
+
+# Check Cython files with some checks turned off
+flake8 --count --config=$PYTHON_DIR/.flake8.cython \
+       $PYTHON_DIR/pyarrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/d154c103/ci/travis_script_cpp.sh
----------------------------------------------------------------------
diff --git a/ci/travis_script_cpp.sh b/ci/travis_script_cpp.sh
index 4e3e7bb..a207903 100755
--- a/ci/travis_script_cpp.sh
+++ b/ci/travis_script_cpp.sh
@@ -27,8 +27,6 @@ git archive HEAD --prefix=apache-arrow/ --output=arrow-src.tar.gz
 
 pushd $CPP_BUILD_DIR
 
-$TRAVIS_MAKE lint
-
 # ARROW-209: checks depending on the LLVM toolchain are disabled temporarily
 # until we are able to install the full LLVM toolchain in Travis CI again
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/d154c103/ci/travis_script_python.sh
----------------------------------------------------------------------
diff --git a/ci/travis_script_python.sh b/ci/travis_script_python.sh
index e2cf254..f6ce18a 100755
--- a/ci/travis_script_python.sh
+++ b/ci/travis_script_python.sh
@@ -38,7 +38,7 @@ which python
 conda install -y -q nomkl
 
 # Expensive dependencies install from Continuum package repo
-conda install -y -q pip numpy pandas cython flake8
+conda install -y -q pip numpy pandas cython
 
 # Build C++ libraries
 pushd $ARROW_CPP_BUILD_DIR
@@ -62,12 +62,6 @@ popd
 # Other stuff pip install
 pushd $ARROW_PYTHON_DIR
 
-# Fail fast on style checks
-flake8 --count pyarrow
-
-# Check Cython files with some checks turned off
-flake8 --count --config=.flake8.cython pyarrow
-
 pip install -r requirements.txt
 python setup.py build_ext --with-parquet --with-plasma \
        install --single-version-externally-managed --record=record.text