Skip to content

Show basic information about the build environment without --verbose #13302

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

Open
1 task done
zahlman opened this issue Mar 25, 2025 · 2 comments
Open
1 task done

Show basic information about the build environment without --verbose #13302

zahlman opened this issue Mar 25, 2025 · 2 comments
Labels
C: logging Information Logging type: feature request Request for a new feature

Comments

@zahlman
Copy link

zahlman commented Mar 25, 2025

What's the problem this feature will solve?

While investigating the recent issue with Setuptools 78.x, it occurred to me that when Pip builds a wheel, the default output doesn't actually describe the build dependencies:

$ rm -r pip-isolation-test/
$ python -m venv pip-isolation-test --without-pip
$ pip cache purge -q
$ pip --python pip-isolation-test/bin/python install --no-binary=requests requests
Collecting requests
  Downloading requests-2.32.3.tar.gz (131 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done

Etc. With --verbose we find out the version of setuptools that was used in the isolated build environment, but we also get many more pages of output describing the entire (error-free) build process, as well as details about the build environment creation process.

It would also be nice for the output to be clearer about the fact that these installations are for a temporary build environment.

Describe the solution you'd like

We should just be able to see something like:

Collecting requests
  Downloading requests-2.32.3.tar.gz (131 kB)
  Setting up isolated (temporary) build environment ...
    Installing build dependencies ...
      Successfully installed setuptools-78.0.2
      # possibly other things listed here, if pyproject.toml demanded them.
    ... done
    Getting requirements to build wheel ...
      # possibly other things listed here, if the PEP 517 hooks trigger such installation.
    ... done
  ... done
  Preparing metadata (pyproject.toml) ... done

Alternative Solutions

N/A

Additional context

N/A

Code of Conduct

@zahlman zahlman added S: needs triage Issues/PRs that need to be triaged type: feature request Request for a new feature labels Mar 25, 2025
@notatallshaw
Copy link
Member

notatallshaw commented Mar 25, 2025

It would also be nice for the output to be clearer about the fact that these installations are for a temporary build environment.

Tthere's an important balance here, we don't want people to misinterpret this as those build dependencies are being installed into their current environment, or to be too verbose so the logs become less useful to casual readers.

IMO, I think your example is too vebose, but think exposing the build dependency name and versions makes sense, e.g.

Installing build dependencies into isolated build environment: setuptools-78.0.1

@notatallshaw notatallshaw added C: logging Information Logging and removed S: needs triage Issues/PRs that need to be triaged labels Mar 25, 2025
@ichard26
Copy link
Member

I'm generally in favour, specifically with @notatallshaw's suggestion.

This is somewhat complicated by the fact pip calls itself in a subprocess to install build dependencies so the root pip process won't have access to sufficient state to reproduce a similar successfully installed message. We'd have to extract the message from the pip subprocess which is fragile. It's probably best to do this on a "best-effort" basis with a fallback to the status quo if it breaks due to unexpected output (until #9081 which would sidestep this issue is resolved).

Also, this is impossible:

Installing build dependencies into isolated build environment: setuptools-78.0.1

The root pip process won't know exactly what packages (and especially versions!) are going to be installed in the build environment. I suppose the solution is to replace the done with setuptools-78.0.1 although that's a bit janky... I just don't want to add a ton of additional lines to pip's output here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: logging Information Logging type: feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants