Skip to content

Commit

Permalink
Build manylinux and Mac OS wheels too
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Nov 12, 2019
1 parent a918087 commit c25f99f
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 13 deletions.
21 changes: 21 additions & 0 deletions .manylinux-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/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 -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.hookable*.whl; do
auditwheel repair "$whl" -w /io/wheelhouse/
done
5 changes: 5 additions & 0 deletions .manylinux.sh
Original file line number Diff line number Diff line change
@@ -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
98 changes: 87 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,101 @@
language: python
dist: xenial
matrix:
env:
global:
TWINE_USERNAME: zope.wheelbuilder
TWINE_PASSWORD:
secure: "iHOASkMh4JGxVom8gVdIDmmj7VRa5j8vvdABphmyuO6ZH6Qyvu/dIJwzp5S5GKEn+SmwoB+MdKHdxtvVTmmryA5TqimYVd0zti+DeCdSU2N87W/dCpuvNUIL0dz+QeCzuQluipl0qjhkPPhR4GzwxLwxFZW1vJyQ7puGlbhjlkY="

python:
- 2.7
- 3.5
- 3.6
- 3.7
- 3.8
- pypy
- pypy3

jobs:
include:
- python: 2.7
- python: 3.5
- python: 3.6
- python: 3.7
- python: 3.8
- python: pypy2.7-6.0.0
- python: pypy3.5-6.0.0
- python: 2.7
- name: "Python: 2.7, pure (no C extensions)"
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 setuptools
- pip install -U coveralls coverage
- pip install -U -e .[test,docs]

script:
- coverage run setup.py test -q
- python --version
- coverage run setup.py -q test
- coverage run -a -m sphinx -b doctest -d docs/_build/doctrees docs docs/_build/doctest
- python setup.py -q 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

cache: pip
11 changes: 9 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ environment:

install:
- "SET PATH=C:\\Python%PYTHON%;c:\\Python%PYTHON%\\scripts;%PATH%"
- ps: |
$env:PYTHON = "C:\\Python${env:PYTHON}"
if (-not (Test-Path $env:PYTHON)) {
curl -o install_python.ps1 https://raw.githubusercontent.com/matthew-brett/multibuild/11a389d78892cf90addac8f69433d5e22bfa422a/install_python.ps1
.\install_python.ps1
}
- ps: if (-not (Test-Path $env:PYTHON)) { throw "No $env:PYTHON" }
- echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat"
- pip install -e .

Expand All @@ -26,13 +33,13 @@ build_script:
- python -W ignore setup.py -q bdist_wheel

test_script:
- python setup.py test -q
- python setup.py -q test

artifacts:
- path: 'dist\*.whl'
name: wheel

deploy_script:
- ps: if ($env:APPVEYOR_REPO_TAG -eq $TRUE) { pip install twine; twine upload dist/* }
- ps: if ($env:APPVEYOR_REPO_TAG -eq $TRUE) { pip install twine; twine upload --skip-existing dist/* }

deploy: on

0 comments on commit c25f99f

Please sign in to comment.