diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..093d75d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,64 @@ +language: python +env: + global: + DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64 +matrix: + include: + - os: linux + python: 3.5 + services: docker + env: TOX_ENV=py35 + PYENV=cp35 + - os: linux + python: 2.7 + services: docker + env: TOX_ENV=py27 + PYENV=cp27 + - os: linux + python: pypy + services: docker + env: TOX_ENV=pypy + PYENV=pypy + - os: osx + language: generic + env: TOX_ENV=py35 + - os: osx + language: generic + env: TOX_ENV=py27 + - os: osx + language: generic + env: TOX_ENV=pypy +sudo: required +cache: + directories: "$HOME/.cache/pip" +install: | + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + brew update; + brew install python3 PyPy; + pip install twine + virtualenv venv -p python3; + source venv/bin/activate; + pip install -U pip setuptools + pip install tox Cython + else + docker pull $DOCKER_IMAGE + pip install -U pip setuptools + pip install tox Cython + fi +script: | + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + tox -e $TOX_ENV + .tox/$TOX_ENV/bin/pip wheel . -w dist + else + tox -e $TOX_ENV + docker run --rm -v `pwd`:/io $DOCKER_IMAGE /io/.travis/build-wheels.sh pyquicklz $PYENV + fi +deploy: + provider: pypi + user: windreamer + password: + secure: EeANnstZ+FWmaqmyBQK47tRRy9/U3ZX9i6eTq+oBvg1714x5bR9H2bygs6c/O8LN/VxVismRMROIZQAGnInBEjzu5mM/lCJiObtLKEUkKrttgZQbs2wrW2K4PQHKeShuHXRW2Qf2DkQcEEpkY77Jx7O3m3YNIXox7xmSKh4shhR5W5hKpHY+7eWsTj9cr+/m3+A3CM49ljYhEFcfsLeDyZizMHjcEMb+rRma77tm2PTpKskcsA0PFBSem7Z8/h6DcxOUS/xsaMVYYyRusK2ceT/If3EfejVhyehOiQHDJTs6EvHgRRmFgFO9x7Fn4Zkm4y68DYlMvN4gSioBofHo4Ik9SrMiCx0JOAmH6Az/k31HwX0SSJ6CkJqhpkHk+lSEaLTTVosFjBzRKBW+s+WVbhtHnpwV26QeIyK7LpwDZlIYtFz3SrDGVGwJedoMLFurfX5ESj5k5+OxbS/pQUa7YDudQQC80NDtFac502Zyy9RhJY4vmLG7zQyJ3wxjyrzRKGvZkODFV3Tr5NAgCfqUwYBRPZtrG4MQD172HvUI42XaCriQgAz50CMLKyT0OT35YS1FQ6vtIp3bb+5VKS8a5J6f6nLXqftt1dLGdtf2bHDsCDYBga22lBTH82oYvkmxWBoxMvBPIHsy0YApR64yULx9YFdohXFSyXlgPtA3ulw= + distributions: sdist bdist_wheel + on: + tags: true + repo: windreamer/pyquicklz diff --git a/.travis/build-wheels.sh b/.travis/build-wheels.sh new file mode 100755 index 0000000..c53dda0 --- /dev/null +++ b/.travis/build-wheels.sh @@ -0,0 +1,26 @@ +#!/bin/bash +set -e -x + +PACKAGE=$1 +PYENV=$2 + + +# Install a system package required by our library +yum install -y atlas-devel + +if [[ ${PYENV} = "pypy" ]]; then + mkdir -p /pypy + wget "https://bitbucket.org/squeaky/portable-pypy/downloads/pypy-5.6-linux_$(uname -m)-portable.tar.bz2" -qO - | tar xj -C /pypy + /pypy/pypy*/bin/virtualenv-pypy /opt/python/pypy +fi + +# Compile wheels +for PYBIN in /opt/python/${PYENV}*/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 -w /io/dist/ +done diff --git a/MANIFEST.in b/MANIFEST.in index 3a04f5a..f0001d9 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,2 @@ include src/*.h +include *.pyx diff --git a/requirements.txt b/requirements.txt index 212cad8..52fdb39 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ Cython==0.24 -setuptools-cython==0.2.1 diff --git a/setup.py b/setup.py index f0a3130..158cdb6 100644 --- a/setup.py +++ b/setup.py @@ -2,10 +2,10 @@ import sys from setuptools import setup, Extension setup( - name='quicklz', + name='pyquicklz', version='1.4.1', description='python binding of quicklz', - setup_requires=['setuptools_cython', 'Cython >= 0.18'], + setup_requires=['Cython >= 0.18'], ext_modules=[ Extension('quicklz', ['quicklz.pyx', 'src/quicklz.c']), ],