forked from nanoporetech/medaka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-wheels.sh
executable file
·67 lines (55 loc) · 2.02 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
# Usage: ./build-wheels.sh <workdir> <pyminorversion1> <pyminorversion2> ...
set -e -x
export MANYLINUX=1
export MEDAKA_DIST=1
export WITHDEFLATE=1
workdir=$1
shift
echo "Changing cwd to ${workdir}"
cd ${workdir}
if [[ -z "${PACKAGE_NAME}" ]]; then
PACKAGE_NAME='medaka'
fi
PACKAGE_FILE_NAME=${PACKAGE_NAME//-/_}
sed -i "s/__dist_name__ = 'medaka'/__dist_name__ = '${PACKAGE_NAME}'/" setup.py
yum install -y zlib-devel bzip2 bzip2-devel xz-devel curl-devel openssl-devel ncurses-devel
rm -rf libhts.a bincache/*
make scripts/mini_align clean libhts.a
mkdir -p wheelhouse
# this only exists after building libhts
LIBDEFLATE=$(ls -d ${PWD}/submodules/libdeflate-*/)
echo "LIBDEFLATE = '${LIBDEFLATE}'"
echo "PYTHON VERSIONS AVAILABLE"
ls /opt/python/
# Compile wheels
for minor in $@; do
if [[ "${minor}" == "8" ]] || [[ "${minor}" == "9" ]]; then
PYBIN="/opt/python/cp3${minor}-cp3${minor}/bin"
else
PYBIN="/opt/python/cp3${minor}-cp3${minor}m/bin"
fi
# auditwheel/issues/102
"${PYBIN}"/pip install --upgrade setuptools pip wheel==0.31.1 cffi==1.15.0
"${PYBIN}"/pip wheel --prefer-binary --no-dependencies . -w ./wheelhouse/
done
# Bundle external shared libraries into the wheels
export LD_LIBRARY_PATH=$PWD/libdeflate
for whl in "wheelhouse/${PACKAGE_FILE_NAME}"*.whl; do
LD_LIBRARY_PATH=${LIBDEFLATE} auditwheel repair "${whl}" -w ./wheelhouse/
done
unset LD_LIBRARY_PATH
## Install packages
if [[ "${DO_COUNT_TEST}" == "1" ]]; then
for minor in $@; do
if [[ "${minor}" == "8" || "${minor}" == "9" ]]; then
PYBIN="/opt/python/cp3${minor}-cp3${minor}/bin"
else
PYBIN="/opt/python/cp3${minor}-cp3${minor}m/bin"
fi
"${PYBIN}"/pip install --prefer-binary -r requirements.txt
"${PYBIN}"/pip install "${PACKAGE_NAME}" --no-index -f ./wheelhouse
"${PYBIN}"/medaka_counts --print medaka/test/data/test_reads.bam utg000001l:10000-10010
done
fi
cd wheelhouse && ls | grep -v "${PACKAGE_FILE_NAME}.*manylinux" | xargs rm