From 4ddd456dd3e71bcdf9a02a12dd5914b82ec48e91 Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Fri, 9 Feb 2024 14:11:44 +0100 Subject: [PATCH] Add support for the pyproject.toml file in setup with constraints In the _setup_package_with_constraints_edit name of the package was always discovered from the setup.cfg file. But as some projects implements PEP-621 (see [1] for the SQLAlchemy for example) it is not enough now. This patch adds parsing pyproject.toml file also if name is not found in the setup.cfg file. [1] https://github.com/sqlalchemy/sqlalchemy/commit/a8dbf8763a8fa2ca53cc01033f06681a421bf60b Closes-Bug: #2052509 Change-Id: Iee9262079d09a8bd22cd05a8f17950a41a0d1f9d --- inc/python | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inc/python b/inc/python index cc6e01fede..43b06eb520 100644 --- a/inc/python +++ b/inc/python @@ -405,6 +405,9 @@ function _setup_package_with_constraints_edit { # source we are about to do. local name name=$(awk '/^name.*=/ {print $3}' $project_dir/setup.cfg) + if [ -z $name ]; then + name=$(awk '/^name =/ {gsub(/"/, "", $3); print $3}' $project_dir/pyproject.toml) + fi $REQUIREMENTS_DIR/.venv/bin/edit-constraints \ $REQUIREMENTS_DIR/upper-constraints.txt -- $name fi