diff --git a/.travis.yml b/.travis.yml index 3ee3805..56503fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/setup.py b/setup.py index 98fa87b..ac1dfab 100644 --- a/setup.py +++ b/setup.py @@ -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__)) @@ -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, diff --git a/travis/build-wheels.sh b/travis/build-wheels.sh new file mode 100755 index 0000000..cf34ba5 --- /dev/null +++ b/travis/build-wheels.sh @@ -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