-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARROW-42: Add Python tests to Travis CI build
Author: Wes McKinney <wesm@apache.org> Closes #22 from wesm/ARROW-42 and squashes the following commits: 3b056a1 [Wes McKinney] Modularize Travis CI build and add Python build script. Remove parquet.pyx from Cython build for now, suppress -Wunused-variable in Cython compilation. Add missing formatting.py file
- Loading branch information
Showing
19 changed files
with
228 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
: ${CPP_BUILD_DIR=$TRAVIS_BUILD_DIR/cpp-build} | ||
|
||
mkdir $CPP_BUILD_DIR | ||
pushd $CPP_BUILD_DIR | ||
|
||
CPP_DIR=$TRAVIS_BUILD_DIR/cpp | ||
|
||
# Build an isolated thirdparty | ||
cp -r $CPP_DIR/thirdparty . | ||
cp $CPP_DIR/setup_build_env.sh . | ||
|
||
source setup_build_env.sh | ||
|
||
echo $GTEST_HOME | ||
|
||
: ${ARROW_CPP_INSTALL=$TRAVIS_BUILD_DIR/cpp-install} | ||
|
||
cmake -DCMAKE_INSTALL_PREFIX=$ARROW_CPP_INSTALL -DCMAKE_CXX_FLAGS="-Werror" $CPP_DIR | ||
make -j4 | ||
make install | ||
|
||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
PYTHON_DIR=$TRAVIS_BUILD_DIR/python | ||
|
||
# Share environment with C++ | ||
pushd $CPP_BUILD_DIR | ||
source setup_build_env.sh | ||
popd | ||
|
||
pushd $PYTHON_DIR | ||
|
||
# Bootstrap a Conda Python environment | ||
|
||
if [ $TRAVIS_OS_NAME == "linux" ]; then | ||
MINICONDA_URL="https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh" | ||
else | ||
MINICONDA_URL="https://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh" | ||
fi | ||
|
||
curl $MINICONDA_URL > miniconda.sh | ||
MINICONDA=$TRAVIS_BUILD_DIR/miniconda | ||
bash miniconda.sh -b -p $MINICONDA | ||
export PATH="$MINICONDA/bin:$PATH" | ||
conda update -y -q conda | ||
conda info -a | ||
|
||
PYTHON_VERSION=3.5 | ||
CONDA_ENV_NAME=pyarrow-test | ||
|
||
conda create -y -q -n $CONDA_ENV_NAME python=$PYTHON_VERSION | ||
source activate $CONDA_ENV_NAME | ||
|
||
python --version | ||
which python | ||
|
||
# faster builds, please | ||
conda install -y nomkl | ||
|
||
# Expensive dependencies install from Continuum package repo | ||
conda install -y pip numpy pandas cython | ||
|
||
# Other stuff pip install | ||
pip install -r requirements.txt | ||
|
||
export ARROW_HOME=$ARROW_CPP_INSTALL | ||
|
||
python setup.py build_ext --inplace | ||
|
||
py.test -vv -r sxX arrow | ||
|
||
# if [ $TRAVIS_OS_NAME == "linux" ]; then | ||
# valgrind --tool=memcheck py.test -vv -r sxX arrow | ||
# else | ||
# py.test -vv -r sxX arrow | ||
# fi | ||
|
||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# 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. | ||
|
||
# Pretty-printing and other formatting utilities for Arrow data structures | ||
|
||
import arrow.scalar as scalar | ||
|
||
|
||
def array_format(arr, window=None): | ||
values = [] | ||
|
||
if window is None or window * 2 >= len(arr): | ||
for x in arr: | ||
values.append(value_format(x, 0)) | ||
contents = _indent(',\n'.join(values), 2) | ||
else: | ||
for i in range(window): | ||
values.append(value_format(arr[i], 0) + ',') | ||
values.append('...') | ||
for i in range(len(arr) - window, len(arr)): | ||
formatted = value_format(arr[i], 0) | ||
if i < len(arr) - 1: | ||
formatted += ',' | ||
values.append(formatted) | ||
contents = _indent('\n'.join(values), 2) | ||
|
||
return '[\n{0}\n]'.format(contents) | ||
|
||
|
||
def value_format(x, indent_level=0): | ||
if isinstance(x, scalar.ListValue): | ||
contents = ',\n'.join(value_format(item) for item in x) | ||
return '[{0}]'.format(_indent(contents, 1).strip()) | ||
else: | ||
return repr(x) | ||
|
||
|
||
def _indent(text, spaces): | ||
if spaces == 0: | ||
return text | ||
block = ' ' * spaces | ||
return '\n'.join(block + x for x in text.split('\n')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pytest | ||
numpy>=1.7.0 | ||
pandas>=0.12.0 | ||
six |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.