[PYTHON] manylinux1 wheelhouse creation procedure

Introduction

Here is a summary of the procedure for creating a wheelhouse to stabilize and speed up the installation of dependent libraries in deployment and CI + tox.

What I learned

-Try to make manylinux1 wheel --methane blog -Python Professional Programming 2nd Edition

Dockerfile

#Docker for manylinux 1 wheel build provided by PyPA
FROM quay.io/pypa/manylinux1_x86_64

COPY ./requirements /app/requirements
COPY ./scripts/make-wheels.sh  /app/make-wheels.sh

VOLUME /app/wheelhouse /app/wheelhouse_new
WORKDIR /app/wheelhouse_new

CMD ["bash", "/app/make-wheels.sh"]

Shell Script

make-wheels.sh


set -ex

WHEELHOUSE_OLD=/app/wheelhouse
WHEELHOUSE_NEW=/app/wheelhouse_new

# Python-2.7.11(cp27mu)Wheel dependent packages for
/opt/python/cp27-cp27mu/bin/pip wheel -r /app/requirements/online.txt -f ${WHEELHOUSE_OLD} -w ${WHEELHOUSE_NEW}

#wheel manylinux
cd ${WHEELHOUSE_NEW}
for f in ./*linux_*; do
  if [ -f $f ]; then
    auditwheel repair $f -w .
    rm $f
  fi
done

Commands

$docker build -f Dockerfile -t massa142/wheelhouse .
$docker run -it --rm -v `pwd`/wheelhouse:/app/$wheelhouse:ro -v `pwd`/wheelhouse_new:/app/wheelhouse_new massa142/wheelhouse
$rm -R wheelhouse
$mv wheelhouse_new wheelhouse

Recommended Posts

manylinux1 wheelhouse creation procedure
Easy sample data creation procedure
[Python] virtualenv creation procedure memo
Reiwa's Linux router creation procedure ~ with raspi4 ~