diff --git a/templates/python/code_quality/flake8/flake8.yml b/templates/python/code_quality/flake8/flake8.yml
index 36244c7ce7bcb1ead511d09ac88c4d98a2452ee4..e1b6293fe3219cb07e170e8e4c6fb42200e6b353 100644
--- a/templates/python/code_quality/flake8/flake8.yml
+++ b/templates/python/code_quality/flake8/flake8.yml
@@ -5,13 +5,14 @@ include:
   - remote: 'https://api.r2devops.io/job/r/gitlab/dorianturba/r2devops_catalog/python_install@latest.yaml'
 
 flake8:
-    extends: python_install
+    image: python:${IMAGE_TAG}
     stage: code_quality
     variables:
+        IMAGE_TAG: !reference [.python_install, variables, IMAGE_TAG]
         PROJECT_PATH: "."
         PYTHON_SETUP: "pip install ${PROJECT_PATH}[CODE_QUALITY]"
     script:
-        python_install
+        - !reference [.python_install, script]
         - flake8 ${PROJECT_PATH} -v
     only:
         changes:
diff --git a/templates/python/partial/python_install.yml b/templates/python/partial/python_install.yml
index b3315a74cc9cb5a9b447808d3504705bc301a918..c815a77d616d71dc23ddf6ad9192aa78aaf88f00 100644
--- a/templates/python/partial/python_install.yml
+++ b/templates/python/partial/python_install.yml
@@ -1,5 +1,4 @@
 .python_install:
-    image: python:${IMAGE_TAG}
     variables:
         IMAGE_TAG: "latest"
         PROJECT_PATH: "."