arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject arrow git commit: ARROW-55: [Python] Fix unit tests in 2.7
Date Wed, 16 Mar 2016 22:12:07 GMT
Repository: arrow
Updated Branches:
  refs/heads/master 6fdcd4943 -> 883c62bdd


ARROW-55: [Python] Fix unit tests in 2.7

Fixing the #define check for Python 2 makes all unit tests pass in Python 2.7.

Author: Dan Robinson <danrobinson010@gmail.com>

Closes #25 from danrobinson/ARROW-55 and squashes the following commits:

dda4396 [Dan Robinson] ARROW-55: Add Python 2.7 tests to travis-ci
b00524b [Dan Robinson] ARROW-55: [Python] Fix unit tests in 2.7


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

Branch: refs/heads/master
Commit: 883c62bddc534df2c0a4ee1e8bef38772aa4a7cd
Parents: 6fdcd49
Author: Dan Robinson <danrobinson010@gmail.com>
Authored: Wed Mar 16 15:11:56 2016 -0700
Committer: Wes McKinney <wesm@apache.org>
Committed: Wed Mar 16 15:11:56 2016 -0700

----------------------------------------------------------------------
 ci/travis_script_python.sh  | 35 ++++++++++++++++++++---------------
 python/src/pyarrow/common.h |  2 +-
 2 files changed, 21 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/883c62bd/ci/travis_script_python.sh
----------------------------------------------------------------------
diff --git a/ci/travis_script_python.sh b/ci/travis_script_python.sh
index 14d66b4..af6b008 100755
--- a/ci/travis_script_python.sh
+++ b/ci/travis_script_python.sh
@@ -26,29 +26,34 @@ export PATH="$MINICONDA/bin:$PATH"
 conda update -y -q conda
 conda info -a
 
-PYTHON_VERSION=3.5
-CONDA_ENV_NAME=pyarrow-test
+python_version_tests() {
+  PYTHON_VERSION=$1
+  CONDA_ENV_NAME="pyarrow-test-${PYTHON_VERSION}"
+  conda create -y -q -n $CONDA_ENV_NAME python=$PYTHON_VERSION
+  source activate $CONDA_ENV_NAME
 
-conda create -y -q -n $CONDA_ENV_NAME python=$PYTHON_VERSION
-source activate $CONDA_ENV_NAME
+  python --version
+  which python
 
-python --version
-which python
+  # faster builds, please
+  conda install -y nomkl
 
-# faster builds, please
-conda install -y nomkl
+  # Expensive dependencies install from Continuum package repo
+  conda install -y pip numpy pandas cython
 
-# Expensive dependencies install from Continuum package repo
-conda install -y pip numpy pandas cython
+  # Other stuff pip install
+  pip install -r requirements.txt
 
-# Other stuff pip install
-pip install -r requirements.txt
+  export ARROW_HOME=$ARROW_CPP_INSTALL
 
-export ARROW_HOME=$ARROW_CPP_INSTALL
+  python setup.py build_ext --inplace
 
-python setup.py build_ext --inplace
+  py.test -vv -r sxX pyarrow
+}
 
-py.test -vv -r sxX pyarrow
+# run tests for python 2.7 and 3.5
+python_version_tests 2.7
+python_version_tests 3.5
 
 # if [ $TRAVIS_OS_NAME == "linux" ]; then
 #   valgrind --tool=memcheck py.test -vv -r sxX arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/883c62bd/python/src/pyarrow/common.h
----------------------------------------------------------------------
diff --git a/python/src/pyarrow/common.h b/python/src/pyarrow/common.h
index a43e4d2..db63613 100644
--- a/python/src/pyarrow/common.h
+++ b/python/src/pyarrow/common.h
@@ -24,7 +24,7 @@ namespace arrow { class MemoryPool; }
 
 namespace pyarrow {
 
-#define PYARROW_IS_PY2 PY_MAJOR_VERSION < 2
+#define PYARROW_IS_PY2 PY_MAJOR_VERSION <= 2
 
 #define RETURN_ARROW_NOT_OK(s) do {             \
     arrow::Status _s = (s);                     \


Mime
View raw message