diff options
author | Marius Gedminas <marius@gedmin.as> | 2019-11-10 11:08:28 +0200 |
---|---|---|
committer | Marius Gedminas <marius@gedmin.as> | 2019-11-11 19:16:05 +0200 |
commit | a8bb661b459e4f42ac7f8c4b08a9ac48db47f72e (patch) | |
tree | d96fdf593a1395e443b8307aa345aeb5e796bfe1 | |
parent | 666e46fa374310d007213fe3b650080063e87b94 (diff) | |
download | zope-proxy-a8bb661b459e4f42ac7f8c4b08a9ac48db47f72e.tar.gz |
Build manylinux and MacOS wheels
-rwxr-xr-x | .manylinux-install.sh | 22 | ||||
-rwxr-xr-x | .manylinux.sh | 5 | ||||
-rw-r--r-- | .travis.yml | 70 |
3 files changed, 97 insertions, 0 deletions
diff --git a/.manylinux-install.sh b/.manylinux-install.sh new file mode 100755 index 0000000..6ce44bf --- /dev/null +++ b/.manylinux-install.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +set -e -x + +# Compile wheels +for PYBIN in /opt/python/*/bin; do + if [[ "${PYBIN}" == *"cp27"* ]] || \ + [[ "${PYBIN}" == *"cp35"* ]] || \ + [[ "${PYBIN}" == *"cp36"* ]] || \ + [[ "${PYBIN}" == *"cp37"* ]] || \ + [[ "${PYBIN}" == *"cp38"* ]]; then + "${PYBIN}/pip" install -U pip setuptools cffi + "${PYBIN}/pip" install -e /io/ + "${PYBIN}/pip" wheel /io/ -w wheelhouse/ + rm -rf /io/build /io/*.egg-info + fi +done + +# Bundle external shared libraries into the wheels +for whl in wheelhouse/zope.proxy*.whl; do + auditwheel repair "$whl" -w /io/wheelhouse/ +done diff --git a/.manylinux.sh b/.manylinux.sh new file mode 100755 index 0000000..2fed778 --- /dev/null +++ b/.manylinux.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e -x + +docker run --rm -v "$(pwd)":/io $DOCKER_IMAGE $PRE_CMD /io/.manylinux-install.sh diff --git a/.travis.yml b/.travis.yml index 084c8a7..2fd1d3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,11 @@ language: python + +env: + global: + TWINE_USERNAME: zope.wheelbuilder + TWINE_PASSWORD: + secure: "BWyhZtoO9jM3vatjfwdloThv7RY2p8AaN3D8T/8nEIupcgT5E6QKfLlIDibtlMNds2UU0q/HOJiSM/CwBsm5nzMke55m8OhfxfyHG+5TuBafwHtEkMyXe1VQtxnyB7Rlya2ylI9f4/3qXYqyLinBr3F+osE1g2nQmqQL2tpNmRA=" + python: - 2.7 - 3.5 @@ -14,6 +21,47 @@ jobs: python: "2.7" env: PURE_PYTHON=1 + # manylinux wheel builds + - name: 64-bit manylinux wheels (all Pythons) + services: docker + env: DOCKER_IMAGE=quay.io/pypa/manylinux2010_x86_64 + install: docker pull $DOCKER_IMAGE + script: bash .manylinux.sh + + - name: 32-bit manylinux wheels (all Pythons) + services: docker + env: DOCKER_IMAGE=quay.io/pypa/manylinux2010_i686 PRE_CMD=linux32 + install: docker pull $DOCKER_IMAGE + script: bash .manylinux.sh + + # It's important to use 'macpython' builds to get the least + # restrictive wheel tag. It's also important to avoid + # 'homebrew 3' because it floats instead of being a specific version. + - name: Python 2.7 wheels for MacOS + os: osx + language: generic + env: TERRYFY_PYTHON='macpython 2.7.17' + - name: Python 3.5 wheels for MacOS + os: osx + language: generic + env: TERRYFY_PYTHON='macpython 3.5' + - name: Python 3.6 wheels for MacOS + os: osx + language: generic + env: TERRYFY_PYTHON='macpython 3.6.0' + - name: Python 3.7 wheels for MacOS + os: osx + language: generic + env: TERRYFY_PYTHON='macpython 3.7.0' + +before_install: + - | + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + git clone https://github.com/MacPython/terryfy + source terryfy/travis_tools.sh + get_python_environment $TERRYFY_PYTHON venv + fi + install: - pip install -U pip - pip install -U setuptools @@ -21,12 +69,34 @@ install: - pip install -e .[test,docs] script: + - python --version - coverage run -m zope.testrunner --test-path=src - sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html - coverage run -a -m sphinx -b doctest -d docs/_build/doctrees docs docs/_build/doctest + - python setup.py bdist_wheel after_success: - coveralls + - | + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + # macpython 3.5 doesn't support recent TLS protocols which causes twine + # upload to fail, so we use the system Python to run twine + /usr/bin/python -m ensurepip --user + /usr/bin/python -m pip install --user -U pip + /usr/bin/python -m pip install --user -U -I twine + /usr/bin/python -m twine check dist/* + if [[ $TRAVIS_TAG ]]; then + /usr/bin/python -m twine upload --skip-existing dist/* + fi + fi + - | + if [[ -n "$DOCKER_IMAGE" ]]; then + pip install twine + twine check wheelhouse/* + if [[ $TRAVIS_TAG ]]; then + twine upload --skip-existing wheelhouse/* + fi + fi notifications: email: false |