Skip to content

Add verbosity handling and pass through to pypa/build - #363

Merged
agriyakhetarpal merged 23 commits into
mainfrom
verbosity-handling
Jun 7, 2026
Merged

Add verbosity handling and pass through to pypa/build#363
agriyakhetarpal merged 23 commits into
mainfrom
verbosity-handling

Conversation

@agriyakhetarpal

@agriyakhetarpal agriyakhetarpal commented Jun 6, 2026

Copy link
Copy Markdown
Member

I finally decided to take up #222. This PR exposes verbosity via -v and -vv CLI flags (stackable). They are passed along to pypa/build's _ctx.VERBOSITY. It controls pypa/build's own subprocess calls for uv/pip installs. Build backend commands (meson, cmake, gcc wrappers, etc.) are always visible regardless of verbosity.

Closes #222

TODO:

  • Update docs
  • Add some basic tests

@agriyakhetarpal
agriyakhetarpal marked this pull request as draft June 6, 2026 05:51
@agriyakhetarpal agriyakhetarpal added the integration This PR will run the integration tests. This label can be used as a persistent marker to do so. label Jun 6, 2026
@agriyakhetarpal

Copy link
Copy Markdown
Member Author

I have set up the plumbing here but pyodide build -v and pyodide build -vv both return the same output to me, as the default no-verbose-flag build, so this needs an investigation. Maybe the logger is not set up correctly.

@agriyakhetarpal

Copy link
Copy Markdown
Member Author

The logger is indeed not set up correctly, as pypa/build uses print calls and it prints to sys.stderr, but we print to sys.stdout, so something about our Rich logger swallows it and prevents it from reaching the fd, and I don't know what.

Comment thread pyodide_build/pypabuild.py Outdated
@agriyakhetarpal
agriyakhetarpal marked this pull request as ready for review June 6, 2026 07:43
Comment thread CHANGELOG.md

@ryanking13 ryanking13 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for handling this. I left some comments but overall it looks good to me

Comment thread CHANGELOG.md
Comment thread pyodide_build/tests/test_oot_build.py Outdated
Comment thread pyodide_build/pypabuild.py Outdated
Comment thread pyodide_build/pypabuild.py Outdated
yield env


def _make_pypa_build_logger() -> Callable[[str], None]:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe this can be moved to vendor/_pypabuild as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hmm, I'd like to keep this one here itself, as it's something that we are implementing (even though we keep it private). It is not vendored from pypa/build.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sure, that's fine.

Comment thread pyodide_build/pypabuild.py Outdated
Comment thread pyodide_build/pypabuild.py Outdated
Comment thread pyodide_build/pypabuild.py
Comment thread pyodide_build/pypabuild.py

@ryanking13 ryanking13 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@agriyakhetarpal

Copy link
Copy Markdown
Member Author

Thanks for reviewing!

@agriyakhetarpal
agriyakhetarpal merged commit 2946127 into main Jun 7, 2026
21 checks passed
@agriyakhetarpal
agriyakhetarpal deleted the verbosity-handling branch June 7, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration This PR will run the integration tests. This label can be used as a persistent marker to do so.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support pyodide build -v/vv

2 participants