11#! /bin/bash
2+ set -e
23PYTHON_VERSIONS=" cp36-cp36m cp37-cp37m"
34
45# Avoid creation of __pycache__/*.py[c|o]
56export PYTHONDONTWRITEBYTECODE=1
67
78package_name=" $1 "
8- if [ -z " $package_name " ]
9+ if [[ -z " $package_name " ] ]
910then
1011 & > 2 echo " Please pass package name as a first argument of this script ($0 )"
1112 exit 1
1213fi
1314
14- arch=` uname -m`
15+ arch=$( uname -m)
1516
1617# Clean-up
1718rm -rf /io/.tox
1819rm -rf /io/* .egg-info
1920rm -rf /io/.pytest_cache
20- find -name * .py[co] -delete
21+ find /io/ -noleaf -name * .py[co] -delete
2122
2223echo
2324echo
2425echo " Compile wheels"
2526for PYTHON in ${PYTHON_VERSIONS} ; do
26- /opt/python/${PYTHON} /bin/pip install -U pip setuptools wheel
27- /opt/python/${PYTHON} /bin/pip install -r /io/build_requirements.txt
28- /opt/python/${PYTHON} /bin/pip wheel /io/ -w /io/dist/
27+ /opt/python/" ${PYTHON} " /bin/pip install -U pip setuptools wheel
28+ /opt/python/" ${PYTHON} " /bin/pip install -r /io/build_requirements.txt
29+ /opt/python/" ${PYTHON} " /bin/pip wheel /io/ -w /io/dist/
2930 cd /io
30- /opt/python/${PYTHON} /bin/python setup.py bdist_wheel
31- /opt/python/${PYTHON} /bin/python setup.py clean
32- rm -rf /io/build
31+ /opt/python/" ${PYTHON} " /bin/python setup.py bdist_wheel
32+ /opt/python/" ${PYTHON} " /bin/python setup.py clean
3333done
3434
3535echo
@@ -52,17 +52,23 @@ ls /io/dist
5252for PYTHON in ${PYTHON_VERSIONS} ; do
5353 echo
5454 echo -n " Test $PYTHON : $package_name "
55- /opt/python/${PYTHON} /bin/python -c " import platform;print(platform.platform())"
56- /opt/python/${PYTHON} /bin/pip install " $package_name " --no-index -f file:///io/dist
57- /opt/python/${PYTHON} /bin/pip install pytest
58- /opt/python/${PYTHON} /bin/py.test -vv /io/test
59- rm -rf /io/.pytest_cache
55+ /opt/python/" ${PYTHON} " /bin/python -c " import platform;print(platform.platform())"
56+ /opt/python/" ${PYTHON} " /bin/pip install " $package_name " --no-index -f file:///io/dist
57+ /opt/python/" ${PYTHON} " /bin/pip install pytest
58+ /opt/python/" ${PYTHON} " /bin/py.test -vvv /io/test
6059done
6160
62- find /io/dist/ -type f -not -name " *$package_name *" -delete
61+ find /io/dist/ -noleaf - type f -not -name " *$package_name *" -delete
6362rm -rf /io/.eggs
6463rm -rf /io/build
6564rm -rf /io/* .egg-info
6665rm -rf /io/.pytest_cache
66+ rm -rf /io/.tox
67+ rm -f /io/.coverage
68+ # Clean caches and cythonized
69+ find /io/ -noleaf -name * .py[co] -delete
70+ find /io/ -noleaf -name * .c -delete
71+ # Reset permissions
6772chmod -v a+rwx /io/dist
6873chmod -v a+rw /io/dist/*
74+ chmod -vR a+rw /io/" $package_name "
0 commit comments