48 lines
1.5 KiB
Bash
Executable File
48 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e -x
|
|
|
|
# Running inside docker
|
|
# Set a cache directory for pip. This was
|
|
# mounted to be the same as it is outside docker so it
|
|
# can be persisted.
|
|
export XDG_CACHE_HOME="/cache"
|
|
# XXX: This works for macOS, where everything bind-mounted
|
|
# is seen as owned by root in the container. But when the host is Linux
|
|
# the actual UIDs come through to the container, triggering
|
|
# pip to disable the cache when it detects that the owner doesn't match.
|
|
# The below is an attempt to fix that, taken from bcrypt. It seems to work on
|
|
# Github Actions.
|
|
if [ -n "$GITHUB_ACTIONS" ]; then
|
|
echo Adjusting pip cache permissions
|
|
mkdir -p $XDG_CACHE_HOME/pip
|
|
chown -R $(whoami) $XDG_CACHE_HOME
|
|
fi
|
|
ls -ld /cache
|
|
ls -ld /cache/pip
|
|
|
|
# Compile wheels
|
|
for PYBIN in /opt/python/*/bin; do
|
|
if [[ "${PYBIN}" == *"cp27"* ]] || \
|
|
[[ "${PYBIN}" == *"cp35"* ]] || \
|
|
[[ "${PYBIN}" == *"cp36"* ]] || \
|
|
[[ "${PYBIN}" == *"cp37"* ]] || \
|
|
[[ "${PYBIN}" == *"cp38"* ]] || \
|
|
[[ "${PYBIN}" == *"cp39"* ]]; then
|
|
"${PYBIN}/pip" install -e /io/
|
|
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
|
|
if [ `uname -m` == 'aarch64' ]; then
|
|
cd /io/
|
|
"${PYBIN}/pip" install tox
|
|
"${PYBIN}/tox" -e py
|
|
cd ..
|
|
fi
|
|
rm -rf /io/build /io/*.egg-info
|
|
fi
|
|
done
|
|
|
|
# Bundle external shared libraries into the wheels
|
|
for whl in wheelhouse/zope.interface*.whl; do
|
|
auditwheel repair "$whl" -w /io/wheelhouse/
|
|
done
|