Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward warnings during backend calls to the subprocess logger #12090

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pradyunsg
Copy link
Member

@pradyunsg pradyunsg commented Jun 19, 2023

This is the supporting change to pypa/pyproject-hooks#171, with the logic changes in pip. As it is, this is a little messy but it works nicely.

This is not API-compatible with the existing pyproject-hooks, since it imports BuildBackendWarning which doesn't exist in the currently vendored copy.

(and, yes, I considered using logging.captureWarnings but discarded that idea since I wanted to filter for only BuildBackendWarning in that context)

@pfmoore
Copy link
Member

pfmoore commented Jun 19, 2023

I'm finding it difficult to internalise what precisely is happening here. Could you describe the intended behaviour in words? It seems to me that the idea is roughly

If the build backend raises a warning that is a subclass of UserWarning, pip will print it when the build succeeds using log level "warning". This will be affected by verbosity flags, just like any other pip output.

Will the backend warnings be controlled by the standard Python warning filters? If not, what way do we have to control warnings? Do we need a way? (I'd have said no, but the recent issue with the pkg_resources deprecation makes me prefer not to assume...)

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.

None yet

2 participants