From a5bf2c0bddca00d22c63ff2992539262997ff247 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 10 Aug 2016 18:05:38 +0100 Subject: [PATCH 1/7] .travis.sh: activate virtualenv before calling python or pip commands --- .travis.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.sh b/.travis.sh index 33cfe75b..8b8a343d 100755 --- a/.travis.sh +++ b/.travis.sh @@ -36,13 +36,15 @@ case "$1" in ctest -V ;; "python") - python setup.py build_ext test + source venv/bin/activate + python setup.py build_ext test ;; esac ;; "after_success") case "${BUILD_SYSTEM}" in "python") + source venv/bin/activate pip wheel -w dist . ;; esac From e944f1c92bcf9273b9708db28397bdf31a44a35c Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 10 Aug 2016 18:12:36 +0100 Subject: [PATCH 2/7] .travis.yml: update Python versions Removed unnecessary builds for homebrew and system python. We only use the official Mac Python distributions from Python.org. The wheels compiled with those will work on both homebrew Python and the OSX built-in Python. --- .travis.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 48bca719..8697469a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -159,19 +159,11 @@ matrix: ## Python OS X builds ### - os: osx - env: BUILD_SYSTEM=python INSTALL_TYPE=system PYTHON_VERSION=2.7 + env: BUILD_SYSTEM=python INSTALL_TYPE=macpython PYTHON_VERSION=2.7.12 - os: osx - env: BUILD_SYSTEM=python INSTALL_TYPE=macpython PYTHON_VERSION=2.7.10 + env: BUILD_SYSTEM=python INSTALL_TYPE=macpython PYTHON_VERSION=3.4.4 - os: osx - env: BUILD_SYSTEM=python INSTALL_TYPE=homebrew PYTHON_VERSION=2.7.10 - - os: osx - env: BUILD_SYSTEM=python INSTALL_TYPE=macpython PYTHON_VERSION=3.4.3 - - os: osx - env: BUILD_SYSTEM=python INSTALL_TYPE=homebrew PYTHON_VERSION=3.4.3 - - os: osx - env: BUILD_SYSTEM=python INSTALL_TYPE=macpython PYTHON_VERSION=3.5.0 - - os: osx - env: BUILD_SYSTEM=python INSTALL_TYPE=homebrew PYTHON_VERSION=3.5.0 + env: BUILD_SYSTEM=python INSTALL_TYPE=macpython PYTHON_VERSION=3.5.2 ### ## Sanitizers From 2dc2ac77016e845a6c6f143c6e975604e55301c9 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 10 Aug 2016 18:33:43 +0100 Subject: [PATCH 3/7] .travis.sh: explicitly use 'bash' shell instead of generic 'sh' I need to use 'source' command to activate the python virtual environment, but apparently that is not available on Ubuntu's default /bin/sh --- .travis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.sh b/.travis.sh index 8b8a343d..06aab89a 100755 --- a/.travis.sh +++ b/.travis.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash case "$1" in "install") From 18dfca9bc137c1aa24a85c65757b703198bef716 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 10 Aug 2016 18:40:24 +0100 Subject: [PATCH 4/7] .travis.sh: only build wheels on OSX --- .travis.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.sh b/.travis.sh index 06aab89a..1fa7361d 100755 --- a/.travis.sh +++ b/.travis.sh @@ -44,8 +44,12 @@ case "$1" in "after_success") case "${BUILD_SYSTEM}" in "python") - source venv/bin/activate - pip wheel -w dist . + case "${TRAVIS_OS_NAME}" in + "osx") + source venv/bin/activate + pip wheel -w dist . + ;; + esac ;; esac ;; From 13b8e7ff605319428c603bb5e32b4f88318a1b73 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 10 Aug 2016 18:50:40 +0100 Subject: [PATCH 5/7] .travis.yml: only deploy OSX wheels --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8697469a..03193078 100644 --- a/.travis.yml +++ b/.travis.yml @@ -232,7 +232,7 @@ after_success: - ./.travis.sh after_success before_deploy: -- if [ "${BUILD_SYSTEM}" = "python" ]; then export WHEELS=$(ls ./dist/*.whl); fi +- if [ "${BUILD_SYSTEM}" = "python" ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then export WHEELS=$(ls ./dist/*.whl); fi deploy: provider: releases @@ -243,4 +243,4 @@ deploy: on: repo: "google/brotli" tags: true - condition: "${BUILD_SYSTEM} = python" + condition: "${BUILD_SYSTEM} = python || ${TRAVIS_OS_NAME} = osx" From 52cb947469e68905db28ca24949f8b309c62486d Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 10 Aug 2016 19:27:17 +0100 Subject: [PATCH 6/7] .travis.sh: skip source venv on linux --- .travis.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.sh b/.travis.sh index 1fa7361d..1030dadf 100755 --- a/.travis.sh +++ b/.travis.sh @@ -36,7 +36,9 @@ case "$1" in ctest -V ;; "python") - source venv/bin/activate + if [ "${TRAVIS_OS_NAME}" = "osx" ]; then + source venv/bin/activate + fi python setup.py build_ext test ;; esac From 11dc16bf918729778f4f38713315f4cd21e9e0ea Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 10 Aug 2016 19:29:48 +0100 Subject: [PATCH 7/7] .travis.yml: fix wheel deploy 'condition' (use '&&', not '||') --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 03193078..5bccc6d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -243,4 +243,4 @@ deploy: on: repo: "google/brotli" tags: true - condition: "${BUILD_SYSTEM} = python || ${TRAVIS_OS_NAME} = osx" + condition: "${BUILD_SYSTEM} = python && ${TRAVIS_OS_NAME} = osx"