-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.sh
executable file
·92 lines (80 loc) · 2.66 KB
/
script.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# This script takes care of testing your crate
#!/bin/bash
set -ex
# load shared functions
source `dirname $0`/utils.sh
# This builds "manylinux" python packages in the manylinux docker container
# More on manylinuyx at https://github.com/pypa/manylinux
# and the pep https://www.python.org/dev/peps/pep-0513
manylinux_build_test_bundle() {
# cache pip packages used in docker
mkdir -p "$HOME/.manylinux_pip_cache"
mkdir -p "$HOME/.manylinux_cargo_cache"
mkdir -p "$HOME/.manylinux_rustup_cache"
# WHEELPLATFORM is either "manylinux1_i686" or "manylinux1_x86_64"
docker run --rm -e "WHEELPLATFORM=${WHEELPLATFORM}" \
-e TARGET="${TARGET}" \
-e RUSTRELEASE="${RUSTRELEASE}" \
-v ${HOME}/.manylinux_pip_cache:/root/.cache/pip \
-v ${HOME}/.manylinux_cargo_cache:/root/.cargo \
-v ${HOME}/.manylinux_rustup_cache:/root/.rustup \
-v `pwd`:/io \
"quay.io/pypa/${WHEELPLATFORM}" \
/io/ci/manylinux_build_wheel.sh
}
# does not run in docker
pyenv_build_test_bundle() {
rm -rf wheelhouse
mkdir -p wheelhouse
source $HOME/.cargo/env
IFS="," # allows iterating over csv string
for CURRENT_PYENV in $PYENV; do
echo "CURRENT_PYENV is $CURRENT_PYENV"
set +x
source /tmp/.venv/${CURRENT_PYENV}/bin/activate
set -x
make clean
pip install -q -r requirements_dev.txt
python setup.py clean
python setup.py build_ext
if [ -z ${WHEELPLATFORM+x} ]; then
python setup.py bdist_wheel
else
python setup.py bdist_wheel --plat-name="$WHEELPLATFORM"
fi
cp dist/*.whl wheelhouse
python setup.py develop
python setup.py test
python setup.py check
set +x
deactivate
set -x
done
}
if [ -z ${TARGET+x} ]; then
if [ ! -z ${TRAVIS_BUILD_NUMBER+x} ]; then
echo "Target not set but it looks like this is running on Travis."
exit 2
fi
echo "TARGET is not set. Defaulting to x86_64-unknown-linux-gnu"
export TARGET='x86_64-unknown-linux-gnu'
# This is for local testing. You can change the default to match your system.
else
echo "TARGET is $TARGET"
fi
if [ -z ${RUSTRELEASE+x} ]; then
if [ ! -z ${TRAVIS_BUILD_NUMBER+x} ]; then
echo "RUSTRELEASE not set but it looks like this is running on Travis."
exit 2
fi
echo "RUSTRELEASE is not set. Defaulting to stable"
export RUSTRELEASE=stable
# This is for local testing. You can change the default to match your system.
else
echo "RUSTRELEASE is $RUSTRELEASE"
fi
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
pyenv_build_test_bundle
else
manylinux_build_test_bundle
fi