pytest:
    image: python:${IMAGE_TAG}
    stage: test
    variables:
        PYTHON_SETUP: "pip install .[TESTS]"
        IMAGE_TAG: "latest"
    script:
        - python --version  # Debug
        - python -m venv venv --upgrade-deps || python -m venv venv  # upgrade-deps is not supported before 3.9
        - source venv/bin/activate
        - ${PYTHON_SETUP}
        - pytest
    only:
        changes:
            - ./**/*.py
            - .gitlab-ci.yml
            - pyproject.toml