---
version: 2.1
jobs:
  build:
    parameters:
      version:
        description: Version of Python to build against
        type: string

    docker:
      - image: circleci/python:<< parameters.version >>

    working_directory: ~/repo

    steps:
      - checkout

      - restore_cache:
          keys:
            - pip-{{ .Branch }}-{{ checksum "pyproject.toml" }}-{{ checksum "adjunct/__init__.py" }}
            - pip-{{ .Branch }}-{{ checksum "pyproject.toml" }}
            - pip-{{ .Branch }}-
            - pip-

      - run:
          name: install dependencies
          command: |
            python3 -m venv venv
            . venv/bin/activate
            pip install flit
            flit install --symlink

      - save_cache:
          paths:
            - venv
          key: pip-{{ .Branch }}-{{ checksum "pyproject.toml" }}-{{ checksum "adjunct/__init__.py" }}

      - run:
          name: run tests
          command: |
            . venv/bin/activate
            python3 -m unittest

workflows:
  build:
    jobs:
      - build:
          matrix:
            parameters:
              version: ["3.6", "3.7", "3.8"]

---
version: 2.1
jobs:
  build:
    parameters:
      version:
        description: Version of Python to build against
        type: string

    docker:
      - image: circleci/python:<< parameters.version >>

    working_directory: ~/repo

    steps:
      - checkout

      - restore_cache:
          keys:
            - pip-{{ .Branch }}-{{ checksum "pyproject.toml" }}-{{ checksum "adjunct/__init__.py" }}
            - pip-{{ .Branch }}-{{ checksum "pyproject.toml" }}
            - pip-{{ .Branch }}-
            - pip-

      - run:
          name: install dependencies
          command: |
            python3 -m venv venv
            . venv/bin/activate
            pip install flit
            flit install --symlink

      - save_cache:
          paths:
            - venv
          key: pip-{{ .Branch }}-{{ checksum "pyproject.toml" }}-{{ checksum "adjunct/__init__.py" }}

      - run:
          name: run tests
          command: |
            . venv/bin/activate
            python3 -m unittest

workflows:
  build:
    jobs:
      - build:
          matrix:
            parameters:
              version: ["3.6", "3.7", "3.8", "3.9"]

Add Python 3.9 to build
Add Python 3.9 to build
