Skip to content

Conversation

henryiii
Copy link
Contributor

@henryiii henryiii commented Jun 13, 2025

This prints out a summary in the GitHub action step.

Some logging commands were missing for Pyodide.

You can see the general idea, but I plan to flesh it out soon.

@henryiii henryiii force-pushed the henryiii/chore/GHAsummary branch 2 times, most recently from afe6ae0 to 4a4812f Compare June 13, 2025 21:34
@henryiii henryiii marked this pull request as draft June 13, 2025 22:08
@henryiii henryiii force-pushed the henryiii/chore/GHAsummary branch 2 times, most recently from 8951944 to 27ce67b Compare June 14, 2025 04:44
@henryiii henryiii force-pushed the henryiii/chore/GHAsummary branch from 6ae8343 to 6316b3e Compare June 24, 2025 03:48
@joerick
Copy link
Contributor

joerick commented Jul 5, 2025

This is pretty cool.

I couldn't help myself - I had a play around with formatting for this, what do you think?

  • Display build options (can't dim, so only those that differ from the defaults)
  • Show the wheel name first, feels more primary to me
  • Make the table more scannable - stop Github from wrapping the wheel name in the table by making an HTML table using <td nowrap> and <samp> elements

🎡 cibuildwheel

Build options
platform: macos
architectures: arm64, universal2, x86_64
build_selector: 
  build_config: *
  skip_config: 
  requires_python: None
  enable: ['cpython-experimental-riscv64', 'cpython-freethreading', 'cpython-prerelease']
output_dir: /Users/runner/work/cibuildwheel/cibuildwheel/wheelhouse
package_dir: /Users/runner/work/cibuildwheel/cibuildwheel/sample_proj
build_frontend: build[uv]
17 wheels created
    in 1 minute 2 seconds
Wheel Size Build identifier Time
spam-0.1.0-cp38-cp38-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl8.2 kBcp38-manylinux_x86_642s
spam-0.1.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl7.7 kBcp39-manylinux_x86_641s
spam-0.1.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl7.8 kBcp310-manylinux_x86_641s
spam-0.1.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl7.8 kBcp311-manylinux_x86_641s
spam-0.1.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl8.0 kBcp312-manylinux_x86_641s
spam-0.1.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl8.0 kBcp313-manylinux_x86_641s
spam-0.1.0-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl8.1 kBcp313t-manylinux_x86_641s
spam-0.1.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl8.1 kBcp314-manylinux_x86_641s
spam-0.1.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl8.1 kBcp314t-manylinux_x86_641s
spam-0.1.0-cp38-cp38-musllinux_1_2_x86_64.whl7.9 kBcp38-musllinux_x86_642s
spam-0.1.0-cp39-cp39-musllinux_1_2_x86_64.whl7.8 kBcp39-musllinux_x86_641s
spam-0.1.0-cp310-cp310-musllinux_1_2_x86_64.whl8.0 kBcp310-musllinux_x86_642s
spam-0.1.0-cp311-cp311-musllinux_1_2_x86_64.whl8.0 kBcp311-musllinux_x86_641s
spam-0.1.0-cp312-cp312-musllinux_1_2_x86_64.whl8.1 kBcp312-musllinux_x86_641s
spam-0.1.0-cp313-cp313-musllinux_1_2_x86_64.whl8.2 kBcp313-musllinux_x86_642s
spam-0.1.0-cp313-cp313t-musllinux_1_2_x86_64.whl8.3 kBcp313t-musllinux_x86_641s
spam-0.1.0-cp314-cp314-musllinux_1_2_x86_64.whl8.2 kBcp314-musllinux_x86_642s
spam-0.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl8.3 kBcp314t-musllinux_x86_642s

I didn't implement it yet, just playing around with HTML/markdown.

@henryiii
Copy link
Contributor Author

henryiii commented Jul 7, 2025

Those improvements sound good!

@joerick
Copy link
Contributor

joerick commented Jul 8, 2025

Would you like me to have a crack at implementing that new format? I might get some time towards the end of this week.

@henryiii
Copy link
Contributor Author

henryiii commented Jul 8, 2025

Sure, I'm heading to SciPy then PyHEP.dev in Seattle. Likely won't have much time for a while.

@joerick
Copy link
Contributor

joerick commented Jul 8, 2025

Cool! Enjoy!

@joerick
Copy link
Contributor

joerick commented Jul 11, 2025

Here's where I landed-


🎡 cibuildwheel

Build options
output_dir: /private/var/folders/ld/k24nt7054698bctspqwrjq1r0000gn/T/tmpxz77ycv4/wheelhouse
package_dir: /private/var/folders/ld/k24nt7054698bctspqwrjq1r0000gn/T/tmpxz77ycv4
Wheel Size Build identifier Time
spam-0.1.0-cp38-cp38-macosx_11_0_arm64.whl2.8 kBcp38-macosx_arm649 seconds
spam-0.1.0-cp39-cp39-macosx_11_0_arm64.whl2.8 kBcp39-macosx_arm643 seconds
spam-0.1.0-cp310-cp310-macosx_11_0_arm64.whl2.8 kBcp310-macosx_arm643 seconds
spam-0.1.0-cp311-cp311-macosx_11_0_arm64.whl2.8 kBcp311-macosx_arm644 seconds
spam-0.1.0-cp312-cp312-macosx_11_0_arm64.whl2.8 kBcp312-macosx_arm643 seconds
spam-0.1.0-cp313-cp313-macosx_11_0_arm64.whl2.8 kBcp313-macosx_arm643 seconds
6 wheels created in 26 seconds

)

out.write(
textwrap.dedent("""\
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use inspect.cleandoc instead of textwrap.dedent then you don't have to worry about leading/trailing whitespace. Up to you which you prefer.

Suggested change
textwrap.dedent("""\
inspect.cleandoc("""

@henryiii henryiii marked this pull request as ready for review July 11, 2025 21:11
@henryiii henryiii requested a review from hoodmane as a code owner July 11, 2025 21:11
Copy link
Contributor

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No complaints from the iOS side of things - and the rest of the implementation makes sense to me as well.

Copy link
Member

@ryanking13 ryanking13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for Pyodide-side changes as well. The summary looks quite decent.

Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks nice, thanks, @henryiii and @joerick!

I had one comment about the summaries when being added to Markdown: https://github.com/pypa/cibuildwheel/actions/runs/16222307793/attempts/1#summary-45805767785

As you can see when expanding the "Build options" dropdown, there are remnants of ANSI colour codes in the output at the end of each option, like this: �[0m. I think these are coming from the fact that GitHub step summaries convert ANSI into raw UTF-8, where these codes become invisible bytes and show up in this weird manner. I suggest that we turn off ANSI colouring when writing Markdown output to the step summary, and I think there should be two ways to handle this:

  • either we add another argument such as options.summary(..., colors_enabled=True) and then do c = Colors(enabled=colors_enabled) instead of c = log.colors;
  • or we add another options.summary_markdown(...) variant which disables colours and call that one in _github_step_summary()

What do you think? I'm also happy to do so myself in a separate PR, not blocking this PR, or push a few commits here itself :D

@agriyakhetarpal
Copy link
Member

Also, would it make sense to add a SHA-256 checksum column to the table in the future? It would be really nice to grab the hashes for the wheels directly from cibuildwheel's output and sanity check (manually) if they match, say, artifacts for a GitHub release or those uploaded to PyPI.

henryiii added 2 commits July 13, 2025 22:59
Signed-off-by: Henry Schreiner <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! My concerns and questions were resolved, and it looks much better. Thank you!

@henryiii henryiii merged commit d0e4ade into pypa:main Jul 16, 2025
28 checks passed
@henryiii henryiii deleted the henryiii/chore/GHAsummary branch July 16, 2025 03:45
@henryiii henryiii changed the title chore: add summary to Action feat: add summary to Action Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants