@@ -3,13 +3,6 @@ if [ -n "$DEBUG" ]
33then
44 set -x
55fi
6- set -euo pipefail
7- # ref: https://coderwall.com/p/fkfaqq/safer-bash-scripts-with-set-euxo-pipefail
8-
9- PYTHON_VERSIONS=" cp35-cp35m cp36-cp36m cp37-cp37m"
10-
11- # Avoid creation of __pycache__/*.py[c|o]
12- export PYTHONDONTWRITEBYTECODE=1
136
147package_name=" $1 "
158if [ -z " $package_name " ]
1811 exit 1
1912fi
2013
14+ export WORKDIR_PATH=" ${GITHUB_WORKSPACE:-/ io} "
15+
16+ set -euo pipefail
17+ # ref: https://coderwall.com/p/fkfaqq/safer-bash-scripts-with-set-euxo-pipefail
18+
19+ PYTHON_VERSIONS=" cp35-cp35m cp36-cp36m cp37-cp37m"
20+
21+ # Avoid creation of __pycache__/*.py[c|o]
22+ export PYTHONDONTWRITEBYTECODE=1
23+
2124arch=` uname -m`
2225
2326echo
2831echo
2932echo " Compile wheels"
3033for PYTHON in ${PYTHON_VERSIONS} ; do
31- /opt/python/${PYTHON} /bin/pip install -r /io/ requirements/cython.txt
32- /opt/python/${PYTHON} /bin/pip install -r /io/ requirements/wheel.txt
33- /opt/python/${PYTHON} /bin/pip wheel /io/ -w /io/dist/
34+ /opt/python/${PYTHON} /bin/pip install -r " ${WORKDIR_PATH} / requirements/cython.txt"
35+ /opt/python/${PYTHON} /bin/pip install -r " ${WORKDIR_PATH} / requirements/wheel.txt"
36+ /opt/python/${PYTHON} /bin/pip wheel " ${WORKDIR_PATH} / " -w " ${WORKDIR_PATH} /io/dist/"
3437done
3538
3639echo
3740echo
3841echo " Bundle external shared libraries into the wheels"
39- for whl in /io /dist/${package_name} -* -linux_${arch} .whl; do
42+ for whl in ${WORKDIR_PATH} /dist/${package_name} -* -linux_${arch} .whl; do
4043 echo " Repairing $whl ..."
41- auditwheel repair " $whl " -w /io/ dist/
44+ auditwheel repair " $whl " -w " ${WORKDIR_PATH} / dist/"
4245done
4346
4447echo
4548echo
4649echo " Cleanup OS specific wheels"
47- rm -fv /io /dist/* -linux_* .whl
50+ rm -fv ${WORKDIR_PATH} /dist/* -linux_* .whl
4851
4952echo
5053echo
5154echo " Cleanup non-$package_name wheels"
52- find /io/ dist -maxdepth 1 -type f ! -name " $package_name " ' -*-manylinux1_*.whl' -print0 | xargs -0 rm -rf
55+ find " ${WORKDIR_PATH} / dist" -maxdepth 1 -type f ! -name " $package_name " ' -*-manylinux1_*.whl' -print0 | xargs -0 rm -rf
5356
5457echo
5558echo
5659echo " Install packages and test"
5760echo " dist directory:"
58- ls /io /dist
61+ ls ${WORKDIR_PATH} /dist
5962
6063for PYTHON in ${PYTHON_VERSIONS} ; do
6164 # clear python cache
62- find /io -type d -name __pycache__ -print0 | xargs -0 rm -rf
65+ find " ${WORKDIR_PATH} " -type d -name __pycache__ -print0 | xargs -0 rm -rf
6366
6467 echo
6568 echo -n " Test $PYTHON : "
6669 /opt/python/${PYTHON} /bin/python -c " import platform; print('Building wheel for {platform} platform.'.format(platform=platform.platform()))"
67- /opt/python/${PYTHON} /bin/pip install -r /io /requirements/cython.txt
68- /opt/python/${PYTHON} /bin/pip install -r /io /requirements/ci-wheel.txt
69- /opt/python/${PYTHON} /bin/pip install " $package_name " --no-index -f file:///io/ dist
70- /opt/python/${PYTHON} /bin/py.test /io /tests
70+ /opt/python/${PYTHON} /bin/pip install -r ${WORKDIR_PATH} /requirements/cython.txt
71+ /opt/python/${PYTHON} /bin/pip install -r ${WORKDIR_PATH} /requirements/ci-wheel.txt
72+ /opt/python/${PYTHON} /bin/pip install " $package_name " --no-index -f " file://${WORKDIR_PATH} / dist"
73+ /opt/python/${PYTHON} /bin/py.test ${WORKDIR_PATH} /tests
7174done
0 commit comments