From 030f7701a6192f48aab257ce265d34da7974bf7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?El=C5=91d=20Ill=C3=A9s?= Date: Thu, 11 Sep 2025 15:59:33 +0200 Subject: [PATCH] Make update_constraints.sh work with pyproject.toml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some projects started to remove python classifiers from setup.cfg and moved them to pyproject.toml. The update_constraints.sh was not updated for this and such cases the 'new-release' patches were simply not generated. This change checks if setup.cfg contain the python version classifiers and if not (PYTHON_3_VERSIONS variable is empty) then greps the list of python versions from pyproject.toml. Change-Id: I2e24eecd468c4a23f28572e7a8cfc54b1551b153 Signed-off-by: Előd Illés --- .../files/release-tools/update_constraints.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles/copy-release-tools-scripts/files/release-tools/update_constraints.sh b/roles/copy-release-tools-scripts/files/release-tools/update_constraints.sh index a3e05e3f75..d80ff24a5e 100755 --- a/roles/copy-release-tools-scripts/files/release-tools/update_constraints.sh +++ b/roles/copy-release-tools-scripts/files/release-tools/update_constraints.sh @@ -77,6 +77,9 @@ SHORTNAME=$(basename $(pwd)) # Extract python_version information from the package metadata. declare -a PYTHON_3_VERSIONS PYTHON_3_VERSIONS=`sed -n -e 's/^.*Programming.Language.*:://p' < setup.cfg | grep "3...\?$"` +if [[ -z "$PYTHON_3_VERSIONS" ]]; then + PYTHON_3_VERSIONS=`sed -n -e 's/^.*Programming.Language.*:://p' < pyproject.toml | sed 's/",//g' | grep "3...\?"` +fi # Apply the PEP 503 rules to turn the dist name into a canonical form, # in case that's the version that appears in upper-constraints.txt. We