version: 2
jobs:
  build:
    docker:
    - image: randomknowledge/docker-pyenv-tox
    steps:
    - checkout
    - run: pip install tox
    - run: tox -e py27,py34,py35,py36

version: 2
jobs:
  macos-build:
    environment:
      PYTHONDONTWRITEBYTECODE: x

    macos:
      # Travis:
      # 6.4 -> 10.10
      # 7.3 -> 10.11
      # 8.1 -> 10.12
      #xcode: "9.2"  # not available
      #xcode: "9.0"  # available
      #xcode: "8.3.3"  # available
      #xcode: "7.3.1"  # not available
      #xcode: "9.1.0"  # available
      xcode: "9.2.0"  # available

    steps:
    - run: brew install pyenv readline xz

    - run: |-
        # https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables
        echo '
          export PYENV_ROOT="$HOME/.pyenv"
          export PATH="$PYENV_ROOT/bin:$PATH"
        ' >> $BASH_ENV

    - run: |-
        for py_ver in 2.7.14 3.6.4 3.5.4 3.4.7 pypy3.5-5.10.0
        do
          pyenv install "$py_ver" &
        done
        wait
    - run: pyenv global 2.7.14 3.6.4 3.5.4 3.4.7 pypy3.5-5.10.0

    - run: pip install tox tox-pyenv
    - checkout
    - run: tox -e py27,py34,py35,py36,pypy,pypy3 -- -p no:sugar

  linux-build:
    environment:
      PYTHONDONTWRITEBYTECODE: x

    docker:
    - image: randomknowledge/docker-pyenv-tox

    steps:
    - checkout
    - run: pip install tox
    - run: tox -e py27,py34,py35,py36

Enable Circle CI to use macOS
Enable Circle CI to use macOS

Use xcode v9.2.0

Install pyenv in Circle CI
