|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. See accompanying LICENSE file. |
| 14 | + |
| 15 | +set -e |
| 16 | + |
| 17 | +source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh |
| 18 | + |
| 19 | +export ARROW_HOME=$ARROW_CPP_INSTALL |
| 20 | +export PYARROW_WITH_PLASMA=1 |
| 21 | + |
| 22 | +pushd $ARROW_PYTHON_DIR |
| 23 | + |
| 24 | +function build_arrow_libraries() { |
| 25 | + CPP_BUILD_DIR=$1 |
| 26 | + CPP_DIR=$TRAVIS_BUILD_DIR/cpp |
| 27 | + |
| 28 | + mkdir $CPP_BUILD_DIR |
| 29 | + pushd $CPP_BUILD_DIR |
| 30 | + |
| 31 | + cmake -DARROW_BUILD_TESTS=off \ |
| 32 | + -DARROW_PYTHON=on \ |
| 33 | + -DARROW_PLASMA=on \ |
| 34 | + -DCMAKE_INSTALL_PREFIX=$2 \ |
| 35 | + $CPP_DIR |
| 36 | + |
| 37 | + make -j4 |
| 38 | + make install |
| 39 | + |
| 40 | + popd |
| 41 | +} |
| 42 | + |
| 43 | +python_version_tests() { |
| 44 | + PYTHON_VERSION=$1 |
| 45 | + CONDA_ENV_DIR=$TRAVIS_BUILD_DIR/pyarrow-test-$PYTHON_VERSION |
| 46 | + |
| 47 | + export ARROW_HOME=$TRAVIS_BUILD_DIR/arrow-install-$PYTHON_VERSION |
| 48 | + export LD_LIBRARY_PATH=$ARROW_HOME/lib:$PARQUET_HOME/lib |
| 49 | + |
| 50 | + conda create -y -q -p $CONDA_ENV_DIR python=$PYTHON_VERSION cmake curl |
| 51 | + source activate $CONDA_ENV_DIR |
| 52 | + |
| 53 | + python --version |
| 54 | + which python |
| 55 | + |
| 56 | + # faster builds, please |
| 57 | + conda install -y -q nomkl |
| 58 | + |
| 59 | + # Expensive dependencies install from Continuum package repo |
| 60 | + conda install -y -q pip numpy pandas cython |
| 61 | + |
| 62 | + # Build C++ libraries |
| 63 | + build_arrow_libraries arrow-build-$PYTHON_VERSION $ARROW_HOME |
| 64 | + |
| 65 | + # Other stuff pip install |
| 66 | + pip install -r requirements.txt |
| 67 | + |
| 68 | + python setup.py build_ext --inplace |
| 69 | + |
| 70 | + python -m pytest -vv -r sxX pyarrow |
| 71 | + |
| 72 | + # Build documentation once |
| 73 | + if [[ "$PYTHON_VERSION" == "3.6" ]] |
| 74 | + then |
| 75 | + conda install -y -q --file=doc/requirements.txt |
| 76 | + python setup.py build_sphinx -s doc/source |
| 77 | + fi |
| 78 | + |
| 79 | + # Build and install pyarrow |
| 80 | + pushd $TRAVIS_BUILD_DIR/python |
| 81 | + python setup.py install |
| 82 | + popd |
| 83 | + |
| 84 | + # Run Plasma tests |
| 85 | + pushd $TRAVIS_BUILD_DIR/python |
| 86 | + python -m pytest pyarrow/tests/test_plasma.py |
| 87 | + if [ $TRAVIS_OS_NAME == "linux" ]; then |
| 88 | + PLASMA_VALGRIND=1 python -m pytest pyarrow/tests/test_plasma.py |
| 89 | + fi |
| 90 | + popd |
| 91 | +} |
| 92 | + |
| 93 | +# run tests for python 2.7 and 3.6 |
| 94 | +python_version_tests 2.7 |
| 95 | +python_version_tests 3.6 |
| 96 | + |
| 97 | +popd |
0 commit comments