fix: support wider range of verbosity settings on other build backends (#2339)

* fix: support wider range of verbosity settings on other build backends

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Apply suggestions from code review

Co-authored-by: Matthieu Darbois <mayeut@users.noreply.github.com>

* refactor: address review comments

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Matthieu Darbois <mayeut@users.noreply.github.com>
This commit is contained in:
Henry Schreiner
2025-04-06 18:50:24 +02:00
committed by GitHub
co-authored by Matthieu Darbois
parent 6c426a3a17
commit 2aaa489371
3 changed files with 80 additions and 9 deletions
+10 -5
View File
@@ -37,14 +37,19 @@ class BuildFrontendConfig:
def _get_verbosity_flags(level: int, frontend: BuildFrontendName) -> list[str]:
if frontend == "pip":
if level > 0:
return ["-" + level * "v"]
if level < 0:
if level < 0:
if frontend == "pip":
return ["-" + -level * "q"]
elif not 0 <= level < 2:
msg = f"build_verbosity {level} is not supported for {frontend} frontend. Ignoring."
log.warning(msg)
if level > 0:
if frontend == "pip":
return ["-" + level * "v"]
if level > 1:
return ["-" + (level - 1) * "v"]
return []