Today, pyproject.toml-based build backends do not have any mechanism from the Python hooks to communicate to the caller, other than sys.stdout
and sys.stderr
. Currently, both of these are fairly noisy on multiple build-backends (especially when they spawn subprocesses) and suppressed by default with pip
, and via an opt-in with build
.
There is a noted desire for having a less-noisy side-channel for additional communication, that’s come up thus far: presenting warnings.
Concretely, this will help build-backends show warnings about usage patterns that they are discouraging use of to the end user. Using a new mechanism to communicate information that is intended to be user-facing, from the backend to the frontend, would avoid burying this information in a wall of output from the build-backends.
Since the underlying build-backend is expected to have a Python interface, I’m proposing to enable forwarding warnings.warn
messages that derive from UserWarning
(concretely, by overriding showwarning
in the subprocess-that-wraps-the-hook). Notably, this mechanism will also work with the current somewhat-ad-hoc workaround for this implemented by setuptools
, which uses a UserWarning
-derived base class.
This is an interoperability piece though, so I’m bringing it up here. I’m unsure if this needs a PEP (I’m hoping it doesn’t, and expecting it does ) since it’s primarily using a piece of the standard library to forward information.