version: 2
jobs:
  build:
    docker:
      - image: circleci/python:3.6.4

    working_directory: ~/repo

    steps:
      - checkout

      - restore_cache:
          keys:
            - cache-{{ checksum "requirements.txt" }}
            - cache-

      - run:
          name: install dependencies
          command: |
            sudo pip install -r requirements.txt
            sudo pip install -U .

      - save_cache:
          paths:
            - ~/.local
            - ~/.cache
          key: cache-{{ checksum "requirements.txt" }}

      - run:
          name: run tests
          command: |
            nose2 intern

      - store_artifacts:
          path: test-reports
          destination: test-reports


version: 2
jobs:
  test_py3:
    docker:
      - image: circleci/python:3.6.4

    working_directory: ~/repo

    steps:
      - checkout

      - restore_cache:
          keys:
            - cache-{{ checksum "requirements.txt" }}
            - cache-

      - run:
          name: install dependencies
          command: |
            sudo pip install -r requirements.txt
            sudo pip install -U .

      - save_cache:
          paths:
            - ~/.local
            - ~/.cache
          key: cache-{{ checksum "requirements.txt" }}

      - run:
          name: run tests
          command: |
            nose2 intern

      - store_artifacts:
          path: test-reports
          destination: test-reports

  test_py2:
    docker:
      - image: circleci/python:2.7.15

    working_directory: ~/repo

    steps:
      - checkout

      - restore_cache:
          keys:
            - cache-{{ checksum "requirements.txt" }}
            - cache-

      - run:
          name: install dependencies
          command: |
            sudo pip install -r requirements.txt
            sudo pip install -U .

      - save_cache:
          paths:
            - ~/.local
            - ~/.cache
          key: cache-{{ checksum "requirements.txt" }}

      - run:
          name: run tests
          command: |
            nose2 intern

      - store_artifacts:
          path: test-reports
          destination: test-reports

workflows:
  version: 2
  test_py_2_and_3:
    jobs:
      - test_py3
      - test_py2

Add Python2 CI support back.
Add Python2 CI support back.
