From 6a2f742a5569a34ee2abc73e55d3e50a1e3e08a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80lex=20Fiestas?= Date: Thu, 11 Jul 2024 15:41:23 +0200 Subject: [PATCH] Also check for DJango in pyproject.toml Poetry, supported by Oryx, declares its dependencies in the standard pyproject.toml file. Some other tools also use this file for dependency declaration. This change enables the detection of Django when dependencies are installed via Poetry (and other tools) by also checking for Django in the pyproject.toml file. --- .../Python/PythonBashBuildSnippet.sh.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BuildScriptGenerator/Python/PythonBashBuildSnippet.sh.tpl b/src/BuildScriptGenerator/Python/PythonBashBuildSnippet.sh.tpl index 47bd9babbb..65868760a2 100644 --- a/src/BuildScriptGenerator/Python/PythonBashBuildSnippet.sh.tpl +++ b/src/BuildScriptGenerator/Python/PythonBashBuildSnippet.sh.tpl @@ -236,7 +236,7 @@ fi set +e if [ -e "$SOURCE_DIR/manage.py" ] then - if grep -iq "Django" "$SOURCE_DIR/$REQUIREMENTS_TXT_FILE" + if grep -iq "Django" "$SOURCE_DIR/$REQUIREMENTS_TXT_FILE" || grep -iq "django" "$SOURCE_DIR/pyproject.toml" then echo echo Content in source directory is a Django app @@ -255,8 +255,8 @@ fi ELAPSED_TIME=$(($SECONDS - $START_TIME)) echo "Done in $ELAPSED_TIME sec(s)." else - output="Missing Django module in $SOURCE_DIR/$REQUIREMENTS_TXT_FILE" - recommendation="Add Django to your requirements.txt file." + output="Missing Django module in $SOURCE_DIR/$REQUIREMENTS_TXT_FILE or $SOURCE_DIR/pyproject.toml" + recommendation="Add Django to your requirements.txt or pyproject.toml file." LogWarning "${output} | Exit code: 0 | ${recommendation} | ${moreInformation}" fi fi