Skip to content

Commit

Permalink
Merge bfde35f into 9e08bee
Browse files Browse the repository at this point in the history
  • Loading branch information
amol- committed Jan 22, 2019
2 parents 9e08bee + bfde35f commit 0723350
Showing 1 changed file with 111 additions and 7 deletions.
118 changes: 111 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
conditions: v1

os: linux
dist: trusty
sudo: false
group: edge
dist: xenial

language: python
python:
- 2.7
- 3.4
- 3.5
- &mainstream_python 3.6
- 3.6
- &mainstream_python 3.7
- nightly

install:
Expand All @@ -35,14 +34,119 @@ stages:
- name: deploy
if: tag IS present

before_cache:
- rm -f $HOME/.cache/pip/log/debug.log

env:
global:
GIT_INSTALLER_DIR_PATH: ${HOME}/.git-installers
GIT_VERSION: 2.20.1
PYTHON_INSTALLER_DIR_PATH: ${HOME}/.python-installers

.mixtures:
- &macos-job
os: osx
osx_image: xcode8.3
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

jobs:
fast_finish: true
allow_failures:
- python: nightly

include:
- python: 3.7
dist: xenial
sudo: required
- <<: *macos-job
name: Running tests against Python 3.7 env under macOS 10.13
env:
PYTHON_VERSION: 3.7
- <<: *macos-job
name: Running tests against Python 2.7 env under macOS 10.13
env:
PYTHON_VERSION: 2.7

- <<: *macos-job
name: Running tests against Python 3.6 env under macOS 10.13
env:
PYTHON_VERSION: 3.6
- <<: *macos-job
name: Running tests against Python 3.5 env under macOS 10.13
env:
PYTHON_VERSION: 3.5
- <<: *macos-job
name: Running tests against Python 3.4 env under macOS 10.13
env:
PYTHON_VERSION: 3.4

- stage: deploy
python: *mainstream_python
install: skip
Expand Down

0 comments on commit 0723350

Please sign in to comment.