From e97daee013c34c3fae05d34a10bba981ed5074ee Mon Sep 17 00:00:00 2001 From: Jannis Mittenzwei Date: Fri, 15 Nov 2024 11:51:13 +0100 Subject: [PATCH] resolve conversation --- exasol/toolbox/nox/_dependencies.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/exasol/toolbox/nox/_dependencies.py b/exasol/toolbox/nox/_dependencies.py index 17938408c..a300ce1e0 100644 --- a/exasol/toolbox/nox/_dependencies.py +++ b/exasol/toolbox/nox/_dependencies.py @@ -35,23 +35,24 @@ def _source_filter(version) -> bool: for specifier in ILLEGAL_SPECIFIERS ) - def find_illegal(section) -> List[str]: + def find_illegal(part) -> List[str]: return [ f"{name} = {version}" - for name, version in section.items() + for name, version in part.items() if _source_filter(version) ] illegal: Dict[str, List[str]] = {} toml = tomlkit.loads(pyproject_toml) poetry = toml.get("tool", {}).get("poetry", {}) + part = poetry.get("dependencies", {}) - illegal_group = find_illegal(part) - if illegal_group: + if illegal_group := find_illegal(part): illegal["tool.poetry.dependencies"] = illegal_group + part = poetry.get("dev", {}).get("dependencies", {}) - illegal_group = find_illegal(part) - if illegal_group: + if illegal_group := find_illegal(part): illegal["tool.poetry.dev.dependencies"] = illegal_group + part = poetry.get("group", {}) for group, content in part.items(): illegal_group = find_illegal(content.get("dependencies", {}))