]> git.proxmox.com Git - ceph.git/blob - 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
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
20 set -e
21 set -x
22 set -o pipefail
23
24 if [ "$#" -ne 1 ]; then
25 echo "Usage: $0 <arrow-src-dir>"
26 exit 1
27 fi
28
29 source_dir=${1}
30
31 : ${ARROW_FLIGHT:=ON}
32 : ${ARROW_S3:=ON}
33 : ${CHECK_IMPORTS:=ON}
34 : ${CHECK_UNITTESTS:=ON}
35 : ${INSTALL_PYARROW:=ON}
36
37 export PYARROW_TEST_CYTHON=OFF
38 export PYARROW_TEST_DATASET=ON
39 export PYARROW_TEST_FLIGHT=${ARROW_FLIGHT}
40 export PYARROW_TEST_GANDIVA=OFF
41 export PYARROW_TEST_HDFS=ON
42 export PYARROW_TEST_ORC=ON
43 export PYARROW_TEST_PANDAS=ON
44 export PYARROW_TEST_PARQUET=ON
45 export PYARROW_TEST_PLASMA=ON
46 export PYARROW_TEST_S3=${ARROW_S3}
47 export PYARROW_TEST_TENSORFLOW=ON
48
49 export ARROW_TEST_DATA=${source_dir}/testing/data
50 export PARQUET_TEST_DATA=${source_dir}/submodules/parquet-testing/data
51
52 if [ "${INSTALL_PYARROW}" == "ON" ]; then
53 # Install the built wheels
54 pip install --force-reinstall ${source_dir}/python/repaired_wheels/*.whl
55 fi
56
57 if [ "${CHECK_IMPORTS}" == "ON" ]; then
58 # Test that the modules are importable
59 python -c "
60 import pyarrow
61 import pyarrow._hdfs
62 import pyarrow.csv
63 import pyarrow.dataset
64 import pyarrow.fs
65 import pyarrow.json
66 import pyarrow.orc
67 import pyarrow.parquet
68 import 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
76 fi
77
78 if [ "${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
84 fi