Skip to content

Apache DataFusion SQL Query Engine

ARROW-3150: [Python] Enable Flight in Python wheels for Linux and Windows

Antoine Pitrouc5b529e6b68c
diff --git a/ci/conda_env_cpp.yml b/ci/conda_env_cpp.yml
index cf5ba482fa..e34d2bf299 100644
--- a/ci/conda_env_cpp.yml
+++ b/ci/conda_env_cpp.yml
@@ -26,7 +26,7 @@ flatbuffers
gflags
glog
gmock>=1.8.1
-grpc-cpp
+grpc-cpp>=1.21.4
gtest>=1.8.1
libprotobuf
lz4-c
diff --git a/ci/travis_script_manylinux.sh b/ci/travis_script_manylinux.sh
index 6fbaa0f8f5..12b89738e5 100755
--- a/ci/travis_script_manylinux.sh
+++ b/ci/travis_script_manylinux.sh
@@ -17,7 +17,6 @@
# specific language governing permissions and limitations
# under the License.
-
set -ex
# Testing for https://issues.apache.org/jira/browse/ARROW-2657
@@ -37,6 +36,7 @@ import pyarrow.parquet
import pyarrow.plasma
if sys.version_info.major > 2:
+ import pyarrow.flight
import pyarrow.gandiva
EOF
diff --git a/dev/tasks/python-wheels/appveyor.yml b/dev/tasks/python-wheels/appveyor.yml
index 9f3be9a5d7..9576e64804 100644
--- a/dev/tasks/python-wheels/appveyor.yml
+++ b/dev/tasks/python-wheels/appveyor.yml
@@ -20,15 +20,14 @@ os: Visual Studio 2015
environment:
ARCH: "64"
GENERATOR: Visual Studio 14 2015 Win64
- NUMPY_VERSION: "1.14.5"
+ NUMPY_VERSION: "1.14"
PYTHON_VERSION: "{{ python_version }}"
- MSVC_DEFAULT_OPTIONS: ON
ARROW_SRC: C:\apache-arrow
PYARROW_VERSION: {{ arrow.no_rc_version }}
PYARROW_REF: {{ arrow.head }}
init:
- - set MINICONDA=C:\Miniconda35-x64
+ - set MINICONDA=C:\Miniconda3-x64
- set PATH=%MINICONDA%;%MINICONDA%/Scripts;%MINICONDA%/Library/bin;%PATH%
build_script:
@@ -38,6 +37,16 @@ build_script:
- git clone --no-checkout {{ arrow.remote }} %ARROW_SRC% || exit /B
- git -C %ARROW_SRC% fetch -t {{ arrow.remote }} {{ arrow.branch }} || exit /B
- git -C %ARROW_SRC% checkout {{ arrow.head }} || exit /B
+ - git -C %ARROW_SRC% submodule update --init || exit /B
+
+ # Avoid picking up AppVeyor-installed OpenSSL (linker errors with gRPC)
+ # XXX Perhaps there is a smarter way of solving this issue?
+ - rd /s /q C:\OpenSSL-Win32
+ - rd /s /q C:\OpenSSL-Win64
+ - rd /s /q C:\OpenSSL-v11-Win32
+ - rd /s /q C:\OpenSSL-v11-Win64
+ - rd /s /q C:\OpenSSL-v111-Win32
+ - rd /s /q C:\OpenSSL-v111-Win64
- call %ARROW_SRC%\dev\tasks\python-wheels\win-build.bat
@@ -45,6 +54,9 @@ after_build:
# the artifacts must be uploaded from a directory relative to the build root
- xcopy %ARROW_SRC%\python\dist\* wheels\
+#on_finish:
+ #- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
+
artifacts:
- path: 'wheels\*.whl'
diff --git a/dev/tasks/python-wheels/win-build.bat b/dev/tasks/python-wheels/win-build.bat
index 29ebf64661..11b419b2f9 100644
--- a/dev/tasks/python-wheels/win-build.bat
+++ b/dev/tasks/python-wheels/win-build.bat
@@ -20,17 +20,15 @@
@rem create conda environment for compiling
conda update --yes --quiet conda
-conda create -n arrow -q -y python=%PYTHON_VERSION% ^
- six pytest setuptools numpy=%NUMPY_VERSION% pandas
+call conda create -n wheel-build -q -y -c conda-forge ^
+ --file=%ARROW_SRC%\ci\conda_env_cpp.yml ^
+ --file=%ARROW_SRC%\ci\conda_env_gandiva.yml ^
+ --file=%ARROW_SRC%\ci\conda_env_python.yml ^
+ python=%PYTHON_VERSION% ^
+ numpy=%NUMPY_VERSION% ^
+ || exit /B
-conda install -n arrow -q -y -c conda-forge ^
- git flatbuffers rapidjson ^
- cmake ^
- boost-cpp thrift-cpp ^
- gflags snappy zlib zstd lz4-c double-conversion ^
- llvmdev=7 libprotobuf
-
-call activate arrow
+call activate wheel-build
set ARROW_HOME=%CONDA_PREFIX%\Library
set PARQUET_HOME=%CONDA_PREFIX%\Library
@@ -45,44 +43,47 @@ cmake -G "%GENERATOR%" ^
-DARROW_BOOST_USE_SHARED=OFF ^
-DARROW_BUILD_TESTS=OFF ^
-DCMAKE_BUILD_TYPE=Release ^
- -DBrotli_SOURCE=BUNDLED ^
- -DRE2_SOURCE=BUNDLED ^
+ -DARROW_DEPENDENCY_SOURCE=CONDA ^
+ -DOPENSSL_ROOT_DIR=%CONDA_PREFIX%/Library ^
-DARROW_CXXFLAGS="/MP" ^
+ -DARROW_FLIGHT=ON ^
-DARROW_PYTHON=ON ^
-DARROW_PARQUET=ON ^
-DARROW_GANDIVA=ON ^
- .. || exit /B
-cmake --build . --target INSTALL --config Release || exit /B
+ .. || exit /B
+cmake --build . --target install --config Release || exit /B
popd
-pushd %ARROW_SRC%\python
set PYARROW_BUILD_TYPE=Release
-@rem Gandiva is not supported on Python 2.7, but We don't build 2.7 wheel for windows
+set PYARROW_PARALLEL=8
+@rem Flight and Gandiva are not supported on Python 2.7,
+@rem but we don't build 2.7 wheels for Windows.
+set PYARROW_WITH_FLIGHT=1
set PYARROW_WITH_GANDIVA=1
set PYARROW_WITH_PARQUET=1
set PYARROW_WITH_STATIC_BOOST=1
set PYARROW_BUNDLE_ARROW_CPP=1
set SETUPTOOLS_SCM_PRETEND_VERSION=%PYARROW_VERSION%
-@rem Newer Cython versions are not available on conda-forge
-pip install -U pip
-pip install "Cython>=0.29"
-
-python setup.py build_ext bdist_wheel || exit /B
+pushd %ARROW_SRC%\python
+python setup.py bdist_wheel || exit /B
popd
call deactivate
+set ARROW_TEST_DATA=%ARROW_SRC%\testing\data
+
@rem test the wheel
-conda create -n wheel-test -q -y python=%PYTHON_VERSION% ^
- numpy=%NUMPY_VERSION% pandas pytest hypothesis
+@rem TODO For maximum reliability, we should test in a plain virtualenv instead.
+call conda create -n wheel-test -q -y python=%PYTHON_VERSION% ^
+ numpy=%NUMPY_VERSION% pandas pytest hypothesis || exit /B
call activate wheel-test
@rem install the built wheel
-pip install -vv --no-index --find-links=%ARROW_SRC%\python\dist\ pyarrow
+pip install -vv --no-index --find-links=%ARROW_SRC%\python\dist\ pyarrow || exit /B
@rem test the imports
-python -c "import pyarrow; import pyarrow.parquet; import pyarrow.gandiva;" || exit /B
+python -c "import pyarrow; import pyarrow.parquet; import pyarrow.flight; import pyarrow.gandiva;" || exit /B
@rem run the python tests
pytest --pyargs pyarrow || exit /B
diff --git a/docker-compose.yml b/docker-compose.yml
index 6bb22cc7c5..40b1c5929c 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -421,7 +421,7 @@ services:
# $ docker-compose pull python-manylinux1
# an then run:
# $ docker-compose run -e PYTHON_VERSION=3.7 python-manylinux1
- image: quay.io/xhochy/arrow_manylinux1_x86_64_base:latest
+ image: quay.io/ursa-labs/arrow_manylinux1_x86_64_base:latest
build:
context: python/manylinux1
dockerfile: Dockerfile-x86_64_base