question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Better reporting on output from PEP 517 build backends

See original GitHub issue

Currently, pip install and pip wheel on a PEP 517 compliant source tree hides all output on stdout and stderr from the build backend. Only if an error occurs, both are printed (though it sometimes misses parts of stdout). This means you can’t show the user any information about the progress of long compilations (or even that it’s still progressing and hasn’t got stuck anywhere). It also hides any warnings.

Is there any designated way to communicate from build backends to the user, and if not, would it be possible for pip to forward the stdout and/or stderr from build backends?

Running with -v is also problematic because it contains lots of noise, duplicates the build backend’s output in case of errors and prints an irrelevant stack trace. (Apparently, there’s no difference between -v, -vv and -vvv with pip install). The current output capturing also means that all tools checking for a tty won’t output any color, making error and log messages less readable.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
pradyunsgcommented, Feb 20, 2022

Running with -v is also problematic because it contains lots of noise, duplicates the build backend’s output in case of errors and prints an irrelevant stack trace.

These issues are no longer a concern. We’ve improved handling of output from the build-backends in 22.0 and also reduced the verbosity of a single -v flag in releases since this issue was filed.

I’m going to go ahead and close this now – I think we’re in a good spot w.r.t. output handling from build backends, but if folks think there’s specific improvements we can make, I’d like you to chip in at https://discuss.python.org/t/13779/ (you can log in via GitHub) since the relevant changes here likely affect more tools than just pip (at the very least, it affects build backends).

1reaction
cjerdonekcommented, Jul 25, 2019

It seems like six different issues or proposed improvements are being mentioned:

  1. Verbose mode logs too many messages
  2. The setup.py clean traceback isn’t needed
  3. The InstallationError traceback at the end isn’t needed
  4. The subprocess build output (stdout and/or stderr) shouldn’t require verbose mode to display
  5. The build output should forward directly to the console instead of going through pip when displayed (e.g. to take advantage of tty)
  6. ~The beginning and end of the build output should be distinguished / delineated better~ (This was addressed by PR #6655.)

To keep the discussions manageable, I think it would be best to separate these into different issues. Each one can be discussed separately, and any resolution / PR if it gets to that point could likely be implemented independent of the PR for any other. Here it seems like the interest is mainly in (4) and (5). I would suggest creating a new issue for each one you think should be addressed.

I started by creating an issue for (2) here: https://github.com/pypa/pip/issues/6642 (But I’m not completely sure it’s an issue after starting to investigate.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

PEP 517 – A build-system independent format for source trees
A build frontend is a tool that users might run that takes arbitrary source trees or source distributions and builds wheels from them....
Read more >
pep517 - PyPI
PEP 517 specifies a standard API for systems which build Python packages. PEP 660 extends it with a build mode that leads to...
Read more >
A pyproject.toml Developer's Cheat Sheet | by Ricardo Mendes
In this sense, a fundamental change promoted by PEP 517 is that Pip is not "hardcoded" to use Setuptools as the build backend...
Read more >
Changelog - pip documentation v22.3.1
Improved usefulness of pip config --help output. (#11074) ... (#9944). Fix detection of existing standalone pip instance for PEP 517 builds. (#9953) ...
Read more >
Could not build wheels for scikits.odes which use pep 517 and ...
If you have more than one Python interpreter installed locally, ... So I'm using the typical PEP517 based build, install and test cycle...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found