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

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

Merged
merged 1 commit into from Mar 6, 2015

Conversation

Projects
None yet
4 participants
@msabramo
Contributor

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 #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

This comment has been minimized.

Show comment
Hide comment
@aconrad

aconrad Mar 5, 2015

Contributor

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

Contributor

aconrad commented Mar 5, 2015

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

@dstufft

This comment has been minimized.

Show comment
Hide comment
@dstufft

dstufft Mar 5, 2015

Member

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

Member

dstufft commented Mar 5, 2015

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

@msabramo

This comment has been minimized.

Show comment
Hide comment
@msabramo

msabramo Mar 5, 2015

Contributor

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

Contributor

msabramo commented Mar 5, 2015

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

install: Less output on success; once on failure
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 #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

This comment has been minimized.

Show comment
Hide comment
@msabramo

msabramo Mar 6, 2015

Contributor

OK, I fixed the test failures.

Contributor

msabramo commented Mar 6, 2015

OK, I fixed the test failures.

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

Merge pull request #2487 from msabramo/install_less_output_on_success…
…_and_failure

install: Less output on success; once on failure

@dstufft dstufft merged commit f893abc into pypa:develop Mar 6, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@msabramo

This comment has been minimized.

Show comment
Hide comment
@msabramo

msabramo Mar 6, 2015

Contributor

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.

Contributor

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 msabramo:install_less_output_on_success_and_failure branch Mar 6, 2015

@aconrad

This comment has been minimized.

Show comment
Hide comment
@aconrad

aconrad Mar 6, 2015

Contributor

changelog!

Contributor

aconrad commented Mar 6, 2015

changelog!

@msabramo

This comment has been minimized.

Show comment
Hide comment
@msabramo

msabramo Mar 6, 2015

Contributor

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

Contributor

msabramo commented Mar 6, 2015

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

@piotr-dobrogost

This comment has been minimized.

Show comment
Hide comment
@piotr-dobrogost

piotr-dobrogost commented Mar 7, 2015

@msabramo

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment