Skip to content

Commit

Permalink
sync build
Browse files Browse the repository at this point in the history
  • Loading branch information
penguinolog committed Nov 17, 2020
1 parent 20ed095 commit b1bcb7f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion pytest_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
asynctest
pytest
pytest-cov
pytest-mock
pytest-asyncio
pytest-cov
# pytest-sugar
coverage[toml]>=5.0
52 changes: 29 additions & 23 deletions tools/build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ PYTHON_VERSIONS="cp37-cp37m cp38-cp38 cp39-cp39"
export PYTHONDONTWRITEBYTECODE=1

package_name="$1"
if [[ -z "$package_name" ]]
then
# shellcheck disable=SC2210
&>2 echo "Please pass package name as a first argument of this script ($0)"
exit 1
if [[ -z "$package_name" ]]; then
# shellcheck disable=SC2210
echo &>2 "Please pass package name as a first argument of this script ($0)"
exit 1
fi

arch=$(uname -m)
Expand All @@ -19,28 +18,33 @@ arch=$(uname -m)
rm -rf /io/.tox
rm -rf /io/*.egg-info
rm -rf /io/.pytest_cache
rm -fv /io/dist/*-linux_*.whl
find /io/ -noleaf -name "*.py[co]" -delete

echo
echo
echo "Compile wheels"
for PYTHON in ${PYTHON_VERSIONS}; do
/opt/python/"${PYTHON}"/bin/pip install -U pip setuptools
/opt/python/"${PYTHON}"/bin/pip install -r /io/build_requirements.txt
/opt/python/"${PYTHON}"/bin/pip wheel /io/ -w /io/dist/
cd /io
/opt/python/"${PYTHON}"/bin/python setup.py bdist_wheel clean
cd /io

done
for PYTHON in ${PYTHON_VERSIONS}; do
echo "Python ${PYTHON} ${arch}:"
python_bin="/opt/python/${PYTHON}/bin"
"$python_bin/pip" install -U pip setuptools auditwheel
"$python_bin/pip" install -r /io/build_requirements.txt
"$python_bin/pip" wheel /io/ -w /io/dist/
"$python_bin/python" setup.py bdist_wheel clean

echo
echo
echo "Bundle external shared libraries into the wheels"
for whl in /io/dist/${package_name}*${arch}.whl; do
wheels=(/io/dist/"${package_name}"*"${PYTHON}"*linux_"${arch}".whl)
for whl in "${wheels[@]}"; do
echo "Repairing $whl..."
auditwheel repair "$whl" -w /io/dist/
"$python_bin/python" -m auditwheel repair "$whl" -w /io/dist/
echo "Cleanup OS specific wheels"
rm -fv "$whl"
done
echo
done

echo
echo "Cleanup OS specific wheels"
rm -fv /io/dist/*-linux_*.whl

Expand All @@ -49,14 +53,16 @@ echo
echo "Install packages and test"
echo "dist directory:"
ls /io/dist
echo

for PYTHON in ${PYTHON_VERSIONS}; do
echo
echo -n "Test $PYTHON: $package_name "
/opt/python/"${PYTHON}"/bin/python -c "import platform;print(platform.platform())"
/opt/python/"${PYTHON}"/bin/pip install "$package_name" --no-index -f file:///io/dist
/opt/python/"${PYTHON}"/bin/pip install pytest
/opt/python/"${PYTHON}"/bin/py.test -vvv /io/test
echo -n "Test $PYTHON ${arch}: $package_name "
python_bin="/opt/python/${PYTHON}/bin"
"$python_bin/python" -c "import platform;print(platform.platform())"
"$python_bin/pip" install "$package_name" --no-index -f file:///io/dist
"$python_bin/pip" install -r /io/pytest_requirements.txt
"$python_bin/py.test" -vvv /io/test
echo
done

find /io/dist/ -noleaf -type f -not -name "*$package_name*" -delete
Expand Down

0 comments on commit b1bcb7f

Please sign in to comment.