Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor travis ci config and make it run tests under macOS as well #172

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
653d74a
Refactor building libyaml
webknjaz Jul 2, 2018
71112b3
Refactor Travis test matrix
webknjaz Jun 16, 2018
873582c
Make CI figure out overall status early
webknjaz Jun 27, 2018
2ae28be
Allow not yet succeeding jobs to fail
webknjaz Jun 27, 2018
8b62b39
Add an after-test PYPI deployment stage
webknjaz Jun 27, 2018
e3f888c
Run ldconfig only under GNU/Linux
webknjaz Jul 2, 2018
9ec9fa6
Run OSX when tagged, triggered manually or by cron
webknjaz Jul 3, 2018
7ab5741
Add fast failure to install subcommands
webknjaz Jul 6, 2018
231d60e
Drop sudo: required from Travis CI config
webknjaz Dec 12, 2018
b2dfb60
Keep complete env matrix in tox.ini
webknjaz Feb 20, 2019
7bfc1f0
Drop deprecated "sudo"-less mode
webknjaz Feb 20, 2019
f2e4b64
Switch Travis CI to xenial having better versions
webknjaz Feb 20, 2019
059e4cc
Reorder test jobs to run latest first
webknjaz Feb 20, 2019
831ced3
Bump python versions for macOS
webknjaz Feb 20, 2019
3bc355f
Put libyaml version into env var in Travis CI
webknjaz Feb 20, 2019
15a5170
Update pyenv formula
webknjaz Feb 20, 2019
9b3180b
Run Python 2.6 env under Ubuntu Trusty
webknjaz Feb 20, 2019
5117aa2
Upgrade pypy3 to 3.6-7.0.0 under macOS
webknjaz Feb 20, 2019
3e948c9
Reduce Python build output under macOS
webknjaz Feb 20, 2019
3a89df2
Make `set -e` mode more narrow
webknjaz Feb 20, 2019
a2eeb5b
Use single quotes in string literals in YAML
webknjaz Feb 21, 2019
7d18896
Skip `set -e` under macOS
webknjaz Feb 21, 2019
e18ea02
Improve Darwin check
webknjaz Feb 21, 2019
6072158
Bump xcode under macOS 10.13 to v10.1
webknjaz Feb 21, 2019
795bbeb
Add job labels for humans to Travis CI
webknjaz Feb 21, 2019
168f4d9
Use if-block for set in travis
webknjaz Feb 21, 2019
eb28242
Install venv in install step, before testing
webknjaz Feb 21, 2019
f1da259
🔥 Drop Python 2.6 from Travis CI
webknjaz Mar 14, 2019
ca783e6
🎨⚡️👷Install Python from python.org under macOS
webknjaz Mar 14, 2019
ecb5126
✅🎨 Use macOS 10.13 in OS X jobs
webknjaz Mar 14, 2019
f66fdae
🔥🎨 Drop pyenv shim from Travis CI config
webknjaz Mar 14, 2019
b29c435
🔥✅ Drop macOS jobs from allowe_failures
webknjaz Mar 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
215 changes: 180 additions & 35 deletions .travis.yml
@@ -1,42 +1,187 @@
# dist: xenial
conditions: v1

dist: xenial
language: python
python:
webknjaz marked this conversation as resolved.
Show resolved Hide resolved
- '3.7'
- '2.7'
- pypy3.5-6.0.0
- '3.6'
- '3.5'
- '3.4'
- pypy2.7-6.0.0
# This is broken on travis as of 2019/03/12
# - pypy

sudo: false
cache:
pip: true
directories:
- $HOME/.cache/pre-commit
- $HOME/.pre-commit
- $HOME/Library/Caches/Homebrew

cache: pip

matrix:
include:
- python: 2.7
env: TOXENV=py27
- python: 3.4
env: TOXENV=py34
- python: 3.5
env: TOXENV=py35
- python: 3.6
env: TOXENV=py36
- python: 3.7-dev
env: TOXENV=py37
# This is broken on travis as of 2019/03/12
# - python: pypy
# env: TOXENV=pypy
install:
- python -m pip.__main__ install cython tox

# build libyaml
- pushd /tmp
webknjaz marked this conversation as resolved.
Show resolved Hide resolved
- |
if [[ "$(uname -s)" != "Darwin" ]]
then
set -e
fi
- git clone https://github.com/yaml/libyaml.git -b "${LIBYAML_VERSION}" libyaml
- cd libyaml
- ./bootstrap
- ./configure
- make
- make test-all
- sudo make install
- |
if [[ "$(uname -s)" != "Darwin" ]]
then
set +e
fi
- popd
# pre-populate virtualenv separately from the actual testing (script step):
- python -m tox.__main__ --notest

before_script:
- >-
cd /tmp
&& git clone https://github.com/yaml/libyaml.git libyaml
&& cd libyaml
&& git reset --hard 0.2.2
&& ./bootstrap
&& ./configure
&& make
&& make test-all
&& sudo make install
&& sudo ldconfig
&& cd "$TRAVIS_BUILD_DIR"

install: pip install cython tox

script: tox
- sudo ldconfig

script:
- python -m tox.__main__

.mixtures:
- &macos-job
os: osx
osx_image: xcode10.1
language: generic
cache:
directories:
- $HOME/Library/Caches/Homebrew
- $PYTHON_INSTALLER_DIR_PATH
- $GIT_INSTALLER_DIR_PATH
before_install: &install-from-python_org
- |
function probe_url() {
local py_ver="$1"
[ $(curl -I --write-out '%{http_code}' --silent --output /dev/null "https://www.python.org/ftp/python/${py_ver}/python-${py_ver}-macosx10.6.pkg") == '200' ] && return 0
return 1
}
- |
function find_last_macos_py() {
for py_ver in $*
do
>&2 echo Probing $py_ver
probe_url $py_ver && >&2 echo "Found pkg: ${py_ver}" && echo $py_ver && return 0
done
>&2 echo Failed looking up macOS pkg for $*
return 1
}
- export GIT_DMG_NAME="git-${GIT_VERSION}-intel-universal-mavericks.dmg"
- export GIT_PKG_NAME="git-${GIT_VERSION}-intel-universal-mavericks.pkg"
- export GIT_DMG_PATH="${GIT_INSTALLER_DIR_PATH}/${GIT_DMG_NAME}"
- >
stat "${GIT_DMG_PATH}" &>/dev/null || wget -O "${GIT_DMG_PATH}" "https://sourceforge.net/projects/git-osx-installer/files/${GIT_DMG_NAME}/download?use_mirror=autoselect"
- stat "${GIT_DMG_PATH}" >/dev/null
- sudo hdiutil attach ${GIT_DMG_PATH}
- hdiutil info
- >
export GIT_INSTALLER_VOLUME=$(hdiutil info | tail -n1 | sed 's#^.*\(/Volumes.*\)#\1#')
- >
export GIT_INSTALLER_PATH="${GIT_INSTALLER_VOLUME}/${GIT_PKG_NAME}"
- ls -alh "${GIT_INSTALLER_VOLUME}"
- sudo installer -verboseR -dumplog -pkg "${GIT_INSTALLER_PATH}" -target /
- sudo hdiutil detach "${GIT_INSTALLER_VOLUME}"
- export PYTHON_VERSION_LONG_SUGGESTIONS=$(git ls-remote --sort -v:refname --tags git://github.com/python/cpython.git "${PYTHON_VERSION}*" "v${PYTHON_VERSION}*" | grep -v '\^{}$' | awk '{print$2}' | sed 's#^refs/tags/##;s#^v##' | grep -v '[abcepr]')
- export PYTHON_VERSION_LONG=$(find_last_macos_py $PYTHON_VERSION_LONG_SUGGESTIONS)
- export PYTHON_VERSION_SHORT=$(echo ${PYTHON_VERSION_LONG} | awk -F. '{print$1"."$2}')
- echo "Selected version vars are:"
- echo "PYTHON_VERSION=${PYTHON_VERSION}"
- echo "PYTHON_VERSION_SHORT=${PYTHON_VERSION_SHORT}"
- echo "PYTHON_VERSION_LONG=${PYTHON_VERSION_LONG}"
- export PYTHON_INSTALL_PATH="/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION_SHORT}"
- export PYTHON_INSTALL_EXE="${PYTHON_INSTALL_PATH}/bin/python${PYTHON_VERSION_SHORT}"
- export PATH="${PYTHON_INSTALL_PATH}/bin:${PATH}"
- export PYTHON_VENV_PATH="${HOME}/virtualenv/python${PYTHON_VERSION_SHORT}"
- export PYTHON_INSTALLER_PATH="${PYTHON_INSTALLER_DIR_PATH}/python-${PYTHON_VERSION_LONG}.pkg"
- echo "PYTHON_INSTALLER_PATH=${PYTHON_INSTALLER_PATH}"
- env
- >
stat "${PYTHON_INSTALLER_PATH}" &>/dev/null || wget -O "${PYTHON_INSTALLER_PATH}" "https://www.python.org/ftp/python/${PYTHON_VERSION_LONG}/python-${PYTHON_VERSION_LONG}-macosx10.6.pkg"
- stat "${PYTHON_INSTALLER_PATH}" >/dev/null
- sudo installer -verboseR -dumplog -pkg "${PYTHON_INSTALLER_PATH}" -target /
- ls "${PYTHON_INSTALL_PATH}/bin"
- ls -lh "${PYTHON_INSTALL_EXE}"
- stat "${PYTHON_INSTALL_EXE}"
- /Applications/Python\ ${PYTHON_VERSION_SHORT}/Install\ Certificates.command || echo "No need to fix certificates"
- curl https://bootstrap.pypa.io/get-pip.py | ${PYTHON_INSTALL_EXE}
- >
"${PYTHON_INSTALL_EXE}" -m pip install -U pip
- >
"${PYTHON_INSTALL_EXE}" -m pip install -U virtualenv
- >
"${PYTHON_INSTALL_EXE}" -m virtualenv "${PYTHON_VENV_PATH}"
- . "${PYTHON_VENV_PATH}/bin/activate"
- curl https://bootstrap.pypa.io/get-pip.py | python
- python --version
- pip --version
before_script: []
before_cache:
- brew --cache

env:
global:
GIT_INSTALLER_DIR_PATH: ${HOME}/.git-installers
GIT_VERSION: 2.20.1
LIBYAML_VERSION: 0.2.2
PYTHON_INSTALLER_DIR_PATH: ${HOME}/.python-installers
TOXENV: python
jobs:
fast_finish: true
include:
- <<: *macos-job
name: Python 3.7 under macOS 10.13 with xcode 10.1
env:
TRAVIS_PYTHON_VERSION: '3.7'
python: '3.7'
- <<: *macos-job
name: Python 2.7 under macOS 10.13 with xcode 10.1
env:
TRAVIS_PYTHON_VERSION: '2.7'
python: '2.7'
- <<: *macos-job
name: PyPy3.6 v7.0.0 under macOS 10.13 with xcode 10.1
env:
TRAVIS_PYTHON_VERSION: pypy3.6-7.0.0
python: pypy3.6-7.0.0
- <<: *macos-job
name: Python 3.6 under macOS 10.13 with xcode 10.1
env:
TRAVIS_PYTHON_VERSION: '3.6'
python: '3.6'
- <<: *macos-job
name: Python 3.5 under macOS 10.13 with xcode 10.1
env:
TRAVIS_PYTHON_VERSION: '3.5'
python: '3.5'
- <<: *macos-job
name: Python 3.4 under macOS 10.13 with xcode 10.1
env:
TRAVIS_PYTHON_VERSION: '3.4'
python: '3.4'


# This placeholder can be extended to do actual upload of a dist to
# PYPI, it will only appear if the current commit is tagged:
- stage: Deploy to PYPI (placeholder)
if: tag IS present
install: []
script: []
deploy:
provider: pypi
skip-cleanup: true
user: PLACEHOLDER
password:
secure: PLACEHOLDER
2 changes: 1 addition & 1 deletion tox.ini
@@ -1,5 +1,5 @@
[tox]
envlist = py27,pypy,py34,py35,py36,py37
envlist = py27,pypy,py34,py35,py36,py37,pypy3

[testenv]
deps =
Expand Down