Skip to content

install: Less output on success; once on failure #2487

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

Merged

Conversation

msabramo
Copy link
Contributor

@msabramo msabramo commented Mar 5, 2015

This fixes 2 aspects of pip install output:

  1. When pip install succeeds, it's still printing a lot of output from the package's setup.py. The average consumer of Python packages, when they do pip install lxml, probably doesn't care to see a bunch of output about:

    • copying files to a build directory
    • installing and running Cython
    • compiling C code

    This is noise to most when the pip install succeeds. It's useful to see all the output when the install fails, which is the subject of pip install -r requirements.txt doesn't know when package installation fails during native compilation #2 below. On success, the output is now very clean with 5 short lines:

    $ pip install lxml
    Collecting lxml
     Using cached lxml-3.4.2.tar.gz
    Installing collected packages: lxml
     Running setup.py install for lxml
    Successfully installed lxml-3.4.2
    
  2. When there's an error from pip install, it's annoying to have to scroll through 2 different copies of the failure output (especially when one is filtered and one is unfiltered so one might have stuff that the other doesn't). This makes it not print the filtered version so that there is just the unfiltered version and nothing is repeated.

    $ pip install ~/dev/git-repos/lxml
    Processing /Users/marca/dev/git-repos/lxml
    Installing collected packages: lxml
     Running setup.py install for lxml
       Complete output from command ...
       cc -c /var/folders/gw/w0clrs515zx9x_55zgtpv4mm0000gp/T/xmlCheckVersion4tBaVV.c -o var/folders/gw/w0clrs515zx9x_55zgtpv4mm0000gp/T/xmlCheckVersion4tBaVV.o
       /var/folders/gw/w0clrs515zx9x_55zgtpv4mm0000gp/T/xmlCheckVersion4tBaVV.c:1:10: fatal error: 'libxml/xmlversion.h' file not found
       #include "libxml/xmlversion.h"
                ^
       1 error generated.
       ----------------------------------------
       Command "/Users/marca/python/virtualenvs/pip/bin/python -c ...
    

    None of the lines above are repeated.

Cc: @sudarkoff, @aconrad

@aconrad
Copy link
Contributor

aconrad commented Mar 5, 2015

Only show the details for a failed step, I like it!

@dstufft
Copy link
Member

dstufft commented Mar 5, 2015

This broke something, not quite sure what. But I like the change.

@msabramo
Copy link
Contributor Author

msabramo commented Mar 5, 2015

I think I know why this broke Python 3. Let me see if I can fix.

This fixes 2 aspects of `pip install output`:

1. When `pip install` succeeds, it's still printing a lot of output from
   the package's setup.py. The average consumer of Python packages, when
   they do `pip install lxml`, probably doesn't care to see a bunch of
   output about:

   - copying files to a `build` directory
   - installing and running Cython
   - compiling C code

   This is noise to most when the `pip install` succeeds. It's useful to
   see all the output when the install fails, which is the subject of pypa#2
   below. On success, the output is now very clean with 5 short lines:

       $ pip install lxml
       Collecting lxml
         Using cached lxml-3.4.2.tar.gz
       Installing collected packages: lxml
         Running setup.py install for lxml
       Successfully installed lxml-3.4.2

2. When there's an error from `pip install`, it's annoying to have to
   scroll through 2 different copies of the failure output (especially when
   one is filtered and one is unfiltered so one might have stuff that the
   other doesn't). This makes it not print the filtered version so that
   there is just the unfiltered version and nothing is repeated.

       $ pip install ~/dev/git-repos/lxml
       Processing /Users/marca/dev/git-repos/lxml
       Installing collected packages: lxml
         Running setup.py install for lxml
           Complete output from command ...
           cc -c /var/folders/gw/w0clrs515zx9x_55zgtpv4mm0000gp/T/xmlCheckVersion4tBaVV.c -o var/folders/gw/w0clrs515zx9x_55zgtpv4mm0000gp/T/xmlCheckVersion4tBaVV.o
           /var/folders/gw/w0clrs515zx9x_55zgtpv4mm0000gp/T/xmlCheckVersion4tBaVV.c:1:10: fatal error: 'libxml/xmlversion.h' file not found
           #include "libxml/xmlversion.h"
                    ^
           1 error generated.
           ----------------------------------------
           Command "/Users/marca/python/virtualenvs/pip/bin/python -c ...

   None of the lines above are repeated.
@msabramo msabramo force-pushed the install_less_output_on_success_and_failure branch from a934b35 to c1d21e3 Compare March 6, 2015 00:49
@msabramo
Copy link
Contributor Author

msabramo commented Mar 6, 2015

OK, I fixed the test failures.

dstufft added a commit that referenced this pull request Mar 6, 2015
…_and_failure

install: Less output on success; once on failure
@dstufft dstufft merged commit f893abc into pypa:develop Mar 6, 2015
@msabramo
Copy link
Contributor Author

msabramo commented Mar 6, 2015

Awesome! I've long been bugged by the verbosity of pip, but I've always just lived with it. Turns out it wasn't super hard to fix.

@msabramo msabramo deleted the install_less_output_on_success_and_failure branch March 6, 2015 01:17
@aconrad
Copy link
Contributor

aconrad commented Mar 6, 2015

changelog!

@msabramo
Copy link
Contributor Author

msabramo commented Mar 6, 2015

For posterity, to set a good example for future contributions, changelog was added in #2490

@piotr-dobrogost
Copy link

@msabramo

Thank you!

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants