manylinux
manylinux copied to clipboard
Instructions to use the docker and make wheels without Travis
I saw https://github.com/pypa/python-manylinux-demo which is neat. But it would also be nice to have instructions that I can simply run on my computer to create the wheels.
Something like:
Step 1: Install docker from the instructions at https://docs.docker.com/engine/installation/
Step 2: Pull the docker image: docker pull quay.io/pypa/manylinux1_x86_64 (For 64bit)
And so on ...
The Travis build example at https://github.com/pypa/python-manylinux-demo isn't as helpful in case I want to do it locally.
From what I can see:
-
Pull docker image for your architecture
docker pull quay.io/pypa/manylinux1_x86_64 # or docker pull quay.io/pypa/manylinux1_i686
-
Run it
docker run -it -v $(pwd):/io quay.io/pypa/manylinux1_x86_64
-
Then in your
wheelhouse/directory there will be wheel
Here's my version, expanding on @techtonik's a bit:
docker run -it -v $(pwd):/io quay.io/pypa/manylinux1_x86_64
# following, roughly, https://github.com/pypa/python-manylinux-demo/blob/master/travis/build-wheels.sh
PYBIN=/opt/python/cp36-cp36m/bin
for whl in wheelhouse/*.whl; do
auditwheel repair "$whl" -w /io/wheelhouse/
done
cp wheelhouse/*.whl /io/wheelhouse/
Lots of wheels, including the desired one, will be in $(pwd)/wheelhouse.
I've followed the instructions so far:
docker pull quay.io/pypa/manylinux1_x86_64
docker run -it -v $(pwd):/io quay.io/pypa/manylinux1_x86_64
But I don't see a wheelhouse directory that you guys seem to have when I'm in the container. Is there something I need to do first to create the directory?
Creating a wheelhouse directory in your working directory might do the trick.
On 1/7/19 4:26 PM, Geoffrey Fairchild wrote:
I've followed the instructions so far:
|docker pull quay.io/pypa/manylinux1_x86_64 docker run -it -v $(pwd):/io quay.io/pypa/manylinux1_x86_64 |
But I don't see a |wheelhouse| directory that you guys seem to have when I'm in the container. Is there something I need to do first to create the directory?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pypa/manylinux/issues/73#issuecomment-452087558, or mute the thread https://github.com/notifications/unsubscribe-auth/AmFA1ssM9NJBZ1bXDStzJpcLixGHRSltks5vA7uCgaJpZM4I47L1.
But the script you posted above expects *.whl files to already exist in /wheelhouse when logging into the Docker container:
for whl in wheelhouse/*.whl; do
auditwheel repair "$whl" -w /io/wheelhouse/
done
How do those files get created?
Ok, I think I figured it out. From https://github.com/pypa/python-manylinux-demo/blob/master/travis/build-wheels.sh, this is key:
for PYBIN in /opt/python/*/bin; do
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
done
This process is still unclear to me. I have a repository of Python code I need to build, I'm doing a
docker run -it -v $(pwd):/io quay.io/pypa/manylinux1_x86_64
but I don't see anything inside /io. What am I missing?
I think you'll find that starts up the container only for it close immediately. I think you want something like this:
docker run --rm -it -v $(pwd):/io quay.io/pypa/manylinux1_x86_64 /bin/bash
This will drop you into the container, in the bash shell, and you will be able to see /io.
I've run that and other flavors, and io is still empty.
Both on x86_64 and i686 versions of the container
To be explicit, I'm running on Powershell in Windows and have tried with pwd:/io, C:\Users\me\source\repo:/io, /c/Users/me/source/repo etc and all aren't populating io for me
Looks like it's just some Windows issue on my setup with -v
Ah - sorry - I haven't tried to use Linux containers on Windows.