Skip to content

Commit

Permalink
build manylinux wheel in travis (#4)
Browse files Browse the repository at this point in the history
* include requirements.txt files; add manifest.in file

* add travis build of manylinux wheels

* make matrix

* put multiple environment variables in one line

* add build-wheels.sh

* give sudo for build wheel

* make the travis build wheel script executable

* remove sudo

* the docker in pypa is centos rather than ubuntu

* add sudo

* fix install libboost

* use python3.7-dev

* fix boost

* travis build will upload manylinux wheel

* add back docker env

* add env

* change order

* move twine username and password to travis setting

* this should work

* rename package name

* add python3.5 and remove python 3.8
  • Loading branch information
xiuliren authored Aug 17, 2019
1 parent 3ceda64 commit 4d55759
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 7 deletions.
33 changes: 28 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,48 @@
language: python
language: python

python:
- '3.5'
- '3.6'
- '3.7-dev'

services:
- docker

env:
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64 PLAT=manylinux1_x86_64
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686 PRE_CMD=linux32 PLAT=manylinux1_i686
- DOCKER_IMAGE=quay.io/pypa/manylinux2010_x86_64 PLAT=manylinux2010_x86_64

before_install:
- docker pull $DOCKER_IMAGE

install:
- sudo find /usr -name '*.pyc' -delete
- sudo apt update
- sudo apt install libboost-dev
- pip install -r requirements.txt
- python setup.py install
- python setup.py install
- pip install pytest
- pip install coveralls
- pip install pytest-cov # to get .coverage report via pytest
- pip install pytest-cov

script:
- pytest --cov-append --cov=./waterz ./tests --verbose

after_success:
- coveralls
- coveralls
- chmod +x ./travis/build-wheels.sh
- docker run --rm -e PLAT=$PLAT -v `pwd`:/io $DOCKER_IMAGE $PRE_CMD /io/travis/build-wheels.sh
- ls wheelhouse/
- |
if [[ $TRAVIS_TAG ]]; then
python -m pip install twine
python -m twine upload wheelhouse/waterz*.whl
fi
matrix:
allow_failures:
- python: '3.7-dev'
- python: 3.8-dev

notifications:
email: false
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#from Cython.Build import cythonize
import os

version = '0.8.6'
version = '0.9.0'

PACKAGE_DIR = os.path.dirname(os.path.abspath(__file__))

Expand Down Expand Up @@ -45,7 +45,7 @@ def finalize_options(self):
]

setup(
name='waterzed',
name='waterz',
version=version,
description='Simple watershed and agglomeration for affinity graphs.',
long_description=long_description,
Expand Down
22 changes: 22 additions & 0 deletions travis/build-wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e -x

# Install a system package required by our library
#yum check-update
yum install -y boost-devel

# Compile wheels
for PYBIN in /opt/python/*/bin; do
"${PYBIN}/pip" install -r /io/requirements.txt
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
done

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

# Install packages and test
for PYBIN in /opt/python/*/bin/; do
"${PYBIN}/pip" install waterz --no-index -f /io/wheelhouse
done

0 comments on commit 4d55759

Please sign in to comment.