-
Notifications
You must be signed in to change notification settings - Fork 10
/
build-wheels.sh
executable file
·52 lines (44 loc) · 1.23 KB
/
build-wheels.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
#!/bin/bash -ex
if [ "$#" -ne 1 ]; then
echo "$0 requires one argument: <BSONJS_SOURCE_DIRECTORY>"
echo "For example: $0 /user/home/git/python-bsonjs"
exit 1
fi
BSONJS_SOURCE_DIRECTORY="$1"
cd "$BSONJS_SOURCE_DIRECTORY"
ls -la
if [ -z "$PYTHON_BINARY" ]; then
PYTHON_BINARY="python"
fi
$PYTHON_BINARY --version
if [ ! "$(uname)" == "Linux" ]; then
$PYTHON_BINARY -m pip install wheel
fi
# Build limited abi3 wheel.
$PYTHON_BINARY setup.py bdist_wheel
# https://github.com/pypa/manylinux/issues/49
rm -rf build
# Audit wheels and write multilinux1 tag
# Only if on linux
if [ "$(uname)" == "Linux" ]; then
for whl in dist/*.whl; do
# Skip already built manylinux wheels.
if [[ "$whl" != *"manylinux"* ]]; then
auditwheel repair $whl -w dist
rm $whl
fi
done
fi
# Install packages and test.
for PYBIN in /opt/python/*/bin; do
if [[ ! "${PYBIN}" =~ (36|37|38|39|310) || "${PYBIN}" =~ (pypy) ]]; then
continue
fi
"${PYBIN}/pip" install python-bsonjs --no-index -f dist
# The tests require PyMongo.
"${PYBIN}/pip" install 'pymongo>=3.4'
for TEST_FILE in "${BSONJS_SOURCE_DIRECTORY}"/test/test_*.py; do
"${PYBIN}/python" "$TEST_FILE" -v
done
done
ls -lah dist