Skip to content

Commit 59eb613

Browse files
committed
Don't raise if there are no dependencies
When getting the minimum dependencies from the pyproject.toml file we shouldn't raise if there are no dependencies, just return an empty list. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 334f21d commit 59eb613

File tree

1 file changed

+3
-2
lines changed
  • src/frequenz/repo/config/nox

1 file changed

+3
-2
lines changed

src/frequenz/repo/config/nox/util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,12 @@ def min_dependencies() -> list[str]:
176176
with open("pyproject.toml", "rb") as toml_file:
177177
data = _tomllib.load(toml_file)
178178

179+
min_deps: list[str] = []
180+
179181
dependencies = data.get("project", {}).get("dependencies", {})
180182
if not dependencies:
181-
raise RuntimeError(f"No dependencies found in file: {toml_file.name}")
183+
return min_deps
182184

183-
min_deps: list[str] = []
184185
for dep in dependencies:
185186
min_dep = dep.split(",")[0]
186187
if any(op in min_dep for op in (">=", "==")):

0 commit comments

Comments
 (0)