version: 2

workflows:
  version: 2
  build:
    jobs:
      - "python-2.7"
      - "python-3.5"
      - "python-3.6"

jobs:
  "python-2.7":
    docker:
      - image: python:2.7
    steps:
      - checkout
      - restore_cache:
          key: deps1-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
      - run: make
      - save_cache:
          key: deps1-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
          paths:
            - "~/.cache/pip"
      - run: make test

  "python-3.5":
    docker:
      - image: python:3.5
    steps:
      - checkout
      - restore_cache:
          key: deps1-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
      - run: make
      - save_cache:
          key: deps1-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
          paths:
            - "~/.cache/pip"
      - run: make test

  "python-3.6":
    docker:
      - image: python:3.6
    steps:
      - checkout
      - restore_cache:
          key: deps1-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
      - run: make
      - save_cache:
          key: deps1-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
          paths:
            - "~/.cache/pip"
      - run: make test

version: 2

workflows:
  version: 2
  build:
    jobs:
      - "python-2.7"
      - "python-3.5"
      - "python-3.6"

jobs:
  "python-2.7":
    docker:
      - image: python:2.7
    steps:
      - checkout
      - restore_cache:
          key: deps1-py27-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
      - run: make
      - save_cache:
          key: deps1-py27-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
          paths:
            - "~/.cache/pip"
      - run: make test

  "python-3.5":
    docker:
      - image: python:3.5
    steps:
      - checkout
      - restore_cache:
          key: deps1-py35-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
      - run: make
      - save_cache:
          key: deps1-py35-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
          paths:
            - "~/.cache/pip"
      - run: make test

  "python-3.6":
    docker:
      - image: python:3.6
    steps:
      - checkout
      - restore_cache:
          key: deps1-py36-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
      - run: make
      - save_cache:
          key: deps1-py36-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
          paths:
            - "~/.cache/pip"
      - run: make test

Use one circleci cache per Python version.
Use one circleci cache per Python version.
