Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,22 @@ matrix:
services:
- docker
env: DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
PLAT=manylinux1_x86_64
- sudo: required
services:
- docker
env: DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
PRE_CMD=linux32
PLAT=manylinux1_i686
- sudo: required
services:
- docker
env: DOCKER_IMAGE=quay.io/pypa/manylinux2010_x86_64
PLAT=manylinux2010_x86_64

install:
- docker pull $DOCKER_IMAGE

script:
- docker run --rm -v `pwd`:/io $DOCKER_IMAGE $PRE_CMD /io/travis/build-wheels.sh
- docker run --rm -e PLAT=$PLAT -v `pwd`:/io $DOCKER_IMAGE $PRE_CMD /io/travis/build-wheels.sh
- ls wheelhouse/
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ Demo project for building Python wheels for Linux with Travis-CI


This is an example of how to use Travis-CI to build
[PEP 513](https://www.python.org/dev/peps/pep-0513/)-compatible manylinux1
wheels for Python. It supports both Python 2 and 3 on 32 and 64 bit linux
architectures.
[PEP 513](https://www.python.org/dev/peps/pep-0513/)-compatible
wheels for Python. It supports

Because these wheels need to be compiled on CentOS 5, this example uses Docker
running on Travis-CI to compile (you don't need to use docker at all to _use_
these wheels, it's just to compile them). The docker-based build environment
images are:
- manylinux1 for both Python 2 and 3 on 32 and 64 bit linux architectures.
- manylinux2010 for Python 2 and 3 on 64 bit linux architectures.

- 64-bit image (x86-64): ``quay.io/pypa/manylinux1_x86_64`` [![Docker Repository on Quay](https://quay.io/repository/pypa/manylinux1_x86_64/status "Docker Repository on Quay")](https://quay.io/repository/pypa/manylinux1_x86_64)
- 32-bit image (i686): ``quay.io/pypa/manylinux1_i686`` [![Docker Repository on Quay](https://quay.io/repository/pypa/manylinux1_i686/status "Docker Repository on Quay")](https://quay.io/repository/pypa/manylinux1_i686)
Because these wheels need to be compiled with a specific toolchain and support
libraries , this example uses Docker running on Travis-CI to compile (you don't
need to use docker at all to _use_ these wheels, it's just to compile them).
The docker-based build environment images are:

- 64-bit image for manylinux1 (x86-64): ``quay.io/pypa/manylinux1_x86_64`` [![Docker Repository on Quay](https://quay.io/repository/pypa/manylinux1_x86_64/status "Docker Repository on Quay")](https://quay.io/repository/pypa/manylinux1_x86_64)
- 32-bit image for manylinux1 (i686): ``quay.io/pypa/manylinux1_i686`` [![Docker Repository on Quay](https://quay.io/repository/pypa/manylinux1_i686/status "Docker Repository on Quay")](https://quay.io/repository/pypa/manylinux1_i686)
- 64-bit image for manylinux2010 (x86-64): ``quay.io/pypa/manylinux2010_x86_64`` [![Docker Repository on Quay](https://quay.io/repository/pypa/manylinux2010_x86_64/status "Docker Repository on Quay")](https://quay.io/repository/pypa/manylinux2010_x86_64)

This sample project contains a very simple C compile extension module that links
to an external library (ATLAS, a linear algebra library). The build is
Expand All @@ -31,13 +34,12 @@ resulting build logs can be found at
https://travis-ci.org/pypa/python-manylinux-demo

The `.travis.yml` file instructs Travis to run the script
`travis/build-wheels.sh` inside of the 32-bit and 64-bit manylinux1 docker
build environments. This script builds the package using `pip`. But these
wheels link against an external library. So to create self-contained wheels,
the build script runs the wheels through
[`auditwheel`](https://pypi.python.org/pypi/auditwheel), which copies the external
library into the wheel itself, so that users won't need to install any extra non-PyPI
dependencies.
`travis/build-wheels.sh` inside of the various docker build environments. This
script builds the package using `pip`. But these wheels link against an
external library. So to create self-contained wheels, the build script runs the
wheels through [`auditwheel`](https://pypi.python.org/pypi/auditwheel), which
copies the external library into the wheel itself, so that users won't need to
install any extra non-PyPI dependencies.

Code of Conduct
---------------
Expand Down
2 changes: 1 addition & 1 deletion travis/build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ done

# Bundle external shared libraries into the wheels
for whl in wheelhouse/*.whl; do
auditwheel repair "$whl" -w /io/wheelhouse/
auditwheel repair "$whl" --plat $PLAT -w /io/wheelhouse/
done

# Install packages and test
Expand Down