]> git.proxmox.com Git - ceph.git/blame - ceph/src/arrow/ci/scripts/python_wheel_unix_test.sh
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / ci / scripts / python_wheel_unix_test.sh
CommitLineData
1d09f67e
TL
1#!/usr/bin/env bash
2#
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance
9# with the License. You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing,
14# software distributed under the License is distributed on an
15# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16# KIND, either express or implied. See the License for the
17# specific language governing permissions and limitations
18# under the License.
19
20set -e
21set -x
22set -o pipefail
23
24if [ "$#" -ne 1 ]; then
25 echo "Usage: $0 <arrow-src-dir>"
26 exit 1
27fi
28
29source_dir=${1}
30
31: ${ARROW_FLIGHT:=ON}
32: ${ARROW_S3:=ON}
33: ${CHECK_IMPORTS:=ON}
34: ${CHECK_UNITTESTS:=ON}
35: ${INSTALL_PYARROW:=ON}
36
37export PYARROW_TEST_CYTHON=OFF
38export PYARROW_TEST_DATASET=ON
39export PYARROW_TEST_FLIGHT=${ARROW_FLIGHT}
40export PYARROW_TEST_GANDIVA=OFF
41export PYARROW_TEST_HDFS=ON
42export PYARROW_TEST_ORC=ON
43export PYARROW_TEST_PANDAS=ON
44export PYARROW_TEST_PARQUET=ON
45export PYARROW_TEST_PLASMA=ON
46export PYARROW_TEST_S3=${ARROW_S3}
47export PYARROW_TEST_TENSORFLOW=ON
48
49export ARROW_TEST_DATA=${source_dir}/testing/data
50export PARQUET_TEST_DATA=${source_dir}/submodules/parquet-testing/data
51
52if [ "${INSTALL_PYARROW}" == "ON" ]; then
53 # Install the built wheels
54 pip install --force-reinstall ${source_dir}/python/repaired_wheels/*.whl
55fi
56
57if [ "${CHECK_IMPORTS}" == "ON" ]; then
58 # Test that the modules are importable
59 python -c "
60import pyarrow
61import pyarrow._hdfs
62import pyarrow.csv
63import pyarrow.dataset
64import pyarrow.fs
65import pyarrow.json
66import pyarrow.orc
67import pyarrow.parquet
68import pyarrow.plasma
69"
70 if [ "${PYARROW_TEST_S3}" == "ON" ]; then
71 python -c "import pyarrow._s3fs"
72 fi
73 if [ "${PYARROW_TEST_FLIGHT}" == "ON" ]; then
74 python -c "import pyarrow.flight"
75 fi
76fi
77
78if [ "${CHECK_UNITTESTS}" == "ON" ]; then
79 # Install testing dependencies
80 pip install -U -r ${source_dir}/python/requirements-wheel-test.txt
81 # Execute unittest, test dependencies must be installed
82 python -c 'import pyarrow; pyarrow.create_library_symlinks()'
83 python -m pytest -r s --pyargs pyarrow
84fi