Skip to content

add show command for pip (issue #33)#517

Closed
bernardobarreto wants to merge 8 commits intopypa:developfrom
bernardobarreto:issue33
Closed

add show command for pip (issue #33)#517
bernardobarreto wants to merge 8 commits intopypa:developfrom
bernardobarreto:issue33

Conversation

@bernardobarreto
Copy link
Contributor

usage:

I'll use specloud as example

$ pip show specloud

Package: specloud
Version: 0.4.4
Requires:
nose
figleaf
pinocchio

if the package doesn't have dependencies (figleaf for example):

$ pip show figleaf
Package: figleaf
Version: 0.6.1

I hope everything is alright.

@pnasrat
Copy link
Contributor

pnasrat commented May 2, 2012

Thanks for taking the time for doing this, about to review.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe 'Show detailed information about an installed package'

@pnasrat
Copy link
Contributor

pnasrat commented May 2, 2012

I'm also wondering about the command name, it probably makes sense to have a single command to query installed packages with options for display (freeze output would be a special case of this). @carljm @jezdez views?

@bernardobarreto
Copy link
Contributor Author

@pnasrat if you want me to change something, or if you'd rather implement the changes yourself, just let me know. It's up to you. =]

@pnasrat
Copy link
Contributor

pnasrat commented May 2, 2012

Sure I'm just thinking out loud in the code review. I'll take another look and give you more feedback tomorrow.

@trbs
Copy link

trbs commented May 5, 2012

Hi Guys,

I forked bernardofire's patches at https://github.com/trbs/pip

Making the pip show command a little bit more like apt-cache show.
In that it now also looks at PyPi when a package is not installed locally and showing latest version information.

Hopefully I didn't go too much outside of the scope of issue #33 :)

Example:

$ pip show celery
Package:        celery
Summary:        Distributed Task Queue
Version:        2.4.6
Latest Version: 2.5.3
Author:         Ask Solem
Documentation:  http://celeryproject.org
Homepage:       http://celeryproject.org
License:        BSD

Requires:
    anyjson>=0.3.1
    kombu>=1.4.3,<3.0.0
    python-dateutil>=1.5.0,<2.0.0

It tries to get it's information from both the local resources and PyPi where PyPi takes precedence unless --no-index is specified.

Points of improvements:

  • Tests, quite brittle since most of the meta data can change. Like homepages, summary's, etc.
  • Handling both pkgresoures + PKG-INFO and PyPi, not as clean as could be in my current patches i guess. And it relies now for a large part on thirdparty 'pkginfo' package since I didn't want to include an additional PKG-INFO file parser.
  • Add more of the meta data ?
  • Add the options for mirrors, alternative index urls, etc ? (like in pip install)

@bernardobarreto
Copy link
Contributor Author

Since @trbs added more information, what about verbose options for this command ?

@trbs
Copy link

trbs commented May 6, 2012

That might be sensible :) I just the fields that seem the most reasonable/useful to me.

I do kinda like this list... maybe documentation can go into verbose with other meta information about packages.
Think most others would be helpful to have in the default. As I think this gives the user a pretty decent overview
about the package.

There is also a 'describe' command ticket in github... This might have the same function as displaying the full meta data of a package in 'pip show -v'.

@pnasrat How shall we coordinate to get this merged ?

  • You commented earlier that the unit tests needs some love
  • We can add the -v flag
  • If the external dependency is completely unwanted (which i can understand) I could try and parse PKG-INFO another way.
  • I can recommit my patches in @bernardofire issue33 branch.

@merwok
Copy link

merwok commented May 7, 2012

FYI with distutils2 you have the metadata action: pysetup metadata projectname

@gvalkov gvalkov mentioned this pull request May 15, 2012
@pnasrat
Copy link
Contributor

pnasrat commented May 19, 2012

@trbs I'm travelling at the moment, I don't know if I'll have a chance to look at this before I get back - I may be able to do it one evening this week.

@piotr-dobrogost
Copy link

It would be great to have additional information recorded by code in #507 being displayed as well.

@pnasrat
Copy link
Contributor

pnasrat commented Jul 1, 2012

Needs rebasing to current develop.

@qwcode
Copy link
Contributor

qwcode commented Sep 12, 2012

@carljm close? considering pull #664? also close #33 too?

@carljm
Copy link
Contributor

carljm commented Sep 13, 2012

Hmm, sorry for the duplicated work here, I'd forgotten about this pull request and merged something very similar in #664. I'm going to leave this open for a bit as a reminder that I'd like to add in the dependencies bit into the merged show command, which doesn't have that.

The additions from @trbs look interesting, but I don't think we should use the PyPI XML-RPC interface at all, which I think means we can't do that type of feature. The experience with the search command (which also uses XML-RPC) has been a real hassle - if you depend on PyPI XML-RPC you can't support mirrors, you can't support custom package indexes, you can't support find-links... In practice link-scraping and setup.py metadata are the (janky) interface that pip supports to know about packages, and it only confuses things to support that type of interface in install but then something quite different, that may know about an entirely different set of packages, in search and show.

@carljm
Copy link
Contributor

carljm commented Sep 13, 2012

(Oh, and thanks @qwcode for drawing my attention to this and helping herd tickets...)

@carljm
Copy link
Contributor

carljm commented Sep 21, 2012

Added dependencies to show command in 28aeb03

@carljm carljm closed this Sep 21, 2012
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 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.

7 participants