From 319f85c42ee959b13a0396524be682ea54c0f2b8 Mon Sep 17 00:00:00 2001
From: Pierre Smeyers <pierre.smeyers@gmail.com>
Date: Fri, 18 Feb 2022 09:24:27 +0100
Subject: [PATCH] chore: give requirements file top priority

---
 templates/gitlab-ci-python.yml | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/templates/gitlab-ci-python.yml b/templates/gitlab-ci-python.yml
index 1a91abc..75c9a90 100644
--- a/templates/gitlab-ci-python.yml
+++ b/templates/gitlab-ci-python.yml
@@ -239,6 +239,13 @@ variables:
       ;;
     esac
 
+    if [[ -f "${PYTHON_REQS_FILE}" ]]
+    then
+      log_info "--- Build system auto-detected: requirements file"
+      export PYTHON_BUILD_SYSTEM="reqfile"
+      return
+    fi
+
     if [[ -f "pyproject.toml" ]]
     then
       # that might be PEP 517 if a build-backend is specified
@@ -273,10 +280,6 @@ variables:
     then
       log_info "--- Build system auto-detected: Pipenv"
       export PYTHON_BUILD_SYSTEM="pipenv"
-    elif [[ -f "${PYTHON_REQS_FILE}" ]]
-    then
-      log_info "--- Build system auto-detected: requirements file"
-      export PYTHON_BUILD_SYSTEM="reqfile"
     else
       log_error "--- Build system auto-detect failed: please read template doc"
       exit 1
-- 
GitLab