|
| 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 -o pipefail |
| 22 | + |
| 23 | +if [ ${VERBOSE:-0} -gt 0 ]; then |
| 24 | + set -x |
| 25 | +fi |
| 26 | + |
| 27 | +SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)" |
| 28 | +NANOARROW_DIR="$(cd "${SOURCE_DIR}/../.." && pwd)" |
| 29 | + |
| 30 | +case $# in |
| 31 | + 0) export CIBW_BUILD="" |
| 32 | + ;; |
| 33 | + 1) export CIBW_BUILD="$1" |
| 34 | + ;; |
| 35 | + *) echo "Usage:" |
| 36 | + echo " Build and test wheels locally using cibuildwheel" |
| 37 | + echo " (requires pip install cibuildwheel)" |
| 38 | + echo " $0 ...builds all wheels" |
| 39 | + echo " $0 'pp*' ...builds and tests just pypy wheels" |
| 40 | + exit 1 |
| 41 | + ;; |
| 42 | +esac |
| 43 | + |
| 44 | +# Respect existing CIBW_TEST_REQUIRES (could be used to test all wheels |
| 45 | +# with numpy and pyarrow installed, for example) |
| 46 | +export CIBW_TEST_REQUIRES="pytest $CIBW_TEST_REQUIRES" |
| 47 | +export CIBW_TEST_COMMAND="pytest {package}/tests -vv" |
| 48 | + |
| 49 | +pushd "${NANOARROW_DIR}" |
| 50 | +python -m cibuildwheel --output-dir python/dist python |
| 51 | +popd |
0 commit comments