BUG: fix incorrect number of wheels in logs (#2517)

* BUG: fix incorrect number of wheels in logs

* add a test

---------

Co-authored-by: mayeut <mayeut@users.noreply.github.com>
This commit is contained in:
Clément Robert
2025-07-26 13:13:01 +02:00
committed by GitHub
co-authored by mayeut
parent 13b086e3c6
commit c89609aaf2
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -242,7 +242,7 @@ class Logger:
github_summary = self._github_step_summary(duration=duration, options=options) github_summary = self._github_step_summary(duration=duration, options=options)
Path(summary_path).write_text(filter_ansi_codes(github_summary), encoding="utf-8") Path(summary_path).write_text(filter_ansi_codes(github_summary), encoding="utf-8")
n_wheels = len([info for info in self.summary if not info.filename]) n_wheels = len([info for info in self.summary if info.filename])
s = "s" if n_wheels > 1 else "" s = "s" if n_wheels > 1 else ""
duration_str = humanize.naturaldelta(duration) duration_str = humanize.naturaldelta(duration)
print() print()
+4 -1
View File
@@ -15,9 +15,11 @@ def test_printout_wheels(capsys):
log.colors_enabled = False log.colors_enabled = False
with log.print_summary(options=OPTIONS_DEFAULTS): with log.print_summary(options=OPTIONS_DEFAULTS):
# the number of BuildInfo with & without filename shall be different for this test
log.summary = [ log.summary = [
BuildInfo(identifier="id1", filename=None, duration=3), BuildInfo(identifier="id1", filename=None, duration=3),
BuildInfo(identifier="id2", filename=FILE, duration=2), BuildInfo(identifier="id2", filename=FILE, duration=2),
BuildInfo(identifier="id3", filename=FILE, duration=3),
] ]
captured = capsys.readouterr() captured = capsys.readouterr()
@@ -25,7 +27,8 @@ def test_printout_wheels(capsys):
assert "id1" in captured.out assert "id1" in captured.out
assert "id2" in captured.out assert "id2" in captured.out
assert "1 wheel produced in" in captured.out assert "id3" in captured.out
assert "2 wheels produced in" in captured.out
assert "SHA256=" in captured.out assert "SHA256=" in captured.out