forked from etingof/pyasn1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-binary-wheels.sh
45 lines (36 loc) · 1.17 KB
/
build-binary-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
#!/bin/bash
set -e -x
# Remove python versions we won't build against
ls -al /opt/python/
rm -rf /opt/python/cp26-*
#rm -rf /opt/python/cp27-*
rm -rf /opt/python/cp30-*
rm -rf /opt/python/cp31-*
rm -rf /opt/python/cp32-*
ls -al /opt/python/
cd /io
# Compile wheels
for PYBIN in /opt/python/*/bin; do
"${PYBIN}/pip" install cython
"${PYBIN}/pip" install -r requirements.txt
#"${PYBIN}/pip" wheel /io/ -w wheelhouse/
"${PYBIN}/python" setup-binary.py bdist_wheel --dist-dir=wheelhouse/$1
# Remove the .c generated files
"${PYBIN}/python" setup-binary.py clean -a
done
# Remove downloaded Cython wheel packages
rm -f wheelhouse/Cython*
# Bundle external shared libraries into the wheels
for whl in wheelhouse/$1/*.whl; do
auditwheel repair "$whl" -w /io/wheelhouse
done
# Install packages and test
for PYBIN in /opt/python/*/bin/; do
"${PYBIN}/pip" install pyasn1-binary --no-index -f /io/wheelhouse || exit 1
"${PYBIN}/pip" install -r devel-requirements.txt
"${PYBIN}/python" setup.py test || exit 1
done
# Remove the pre wheel destination and the build directories
rm -rf wheelhouse/$1 build/
# Set the right ownership
chown -R $2:$3 wheelhouse/