# Change pip's cache directory to be inside the project directory since we can # only cache local items. variables: PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" # Pip's cache doesn't store the python packages # https://pip.pypa.io/en/stable/reference/pip_install/#caching # # If you want to also cache the installed packages, you have to install # them in a virtualenv and cache it as well. cache: paths: - .cache/pip - venv/ stages: - lint - test before_script: - python -V - pip install virtualenv - virtualenv venv - source venv/bin/activate lint: stage: lint script: - pip3 install black - black --check src/ python-37: stage: test image: python:3.7 script: - pip3 install tox - tox -e py37 python-38: stage: test image: python:3.8 script: - pip3 install tox - tox -e py38 python-39: stage: test image: python:3.9 script: - pip3 install tox - tox -e py39 python-310: stage: test image: python:3.10 script: - pip3 install tox - tox -e py310