Skip to content

Commit

Permalink
resolve conversation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannis-Mittenzwei committed Nov 15, 2024
1 parent c739b45 commit e97daee
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions exasol/toolbox/nox/_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", {}))
Expand Down

0 comments on commit e97daee

Please sign in to comment.