stages:
    - templates

include:
    -   local: 'templates/python/partial/python_install/python_install.yml'
    -   local: 'templates/python/testing/pytest/pytest.yml'
    -   local: 'templates/python/code_quality/flake8/flake8.yml'
    -   local: 'templates/python/code_quality/black/black.yml'
    -   local: 'templates/python/code_quality/isort/isort.yml'
    -   local: 'templates/python/code_quality/mypy/mypy.yml'
    -   local: 'templates/python/code_quality/ruff/ruff.yml'
    -   local: 'templates/python/dependency_management/requirements-compile/requirements-compile.yml'

python_install:
    extends:
        - .python_install
    stage: templates
    variables:
        PROJECT_PATH: "tests/python_install_project"
        PYTHON_SETUP: "pip install ${PROJECT_PATH}"
    script:
        - !reference [ .python_install, script ]

pytest:
    stage: templates
    needs: [ "python_install" ]
    variables:
        PROJECT_PATH: "tests/pytest_project"
        PYTHON_SETUP: "pip install ${PROJECT_PATH}[TESTS]"

flake8:
    stage: templates
    needs: [ "python_install" ]
    variables:
        PROJECT_PATH: "tests/flake8_project"

black:
    stage: templates
    needs: [ "python_install" ]
    variables:
        PROJECT_PATH: "tests/black_project"


isort:
    stage: templates
    needs: [ "python_install" ]
    variables:
        PROJECT_PATH: "tests/isort_project"

mypy:
    stage: templates
    needs: [ "python_install" ]
    variables:
        PROJECT_PATH: "tests/mypy_project"

ruff:
    stage: templates
    needs: [ "python_install" ]
    variables:
        PROJECT_PATH: "tests/ruff_project"

requirements-compile:
    stage: templates
    needs: [ "python_install" ]
    variables:
        PROJECT_PATH: "tests/requirements-compile_project"
        REQUIREMENTS_FILE_PATH: "${PROJECT_PATH}/requirements.in"
        OUTPUT_FILE_PATH: "${PROJECT_PATH}/requirements.txt"
