pip list #752

Merged
merged 31 commits into from Dec 20, 2012

Conversation

Projects
None yet
5 participants
@qwcode
Contributor

qwcode commented Dec 18, 2012

here's the pull from @rafaelcaricio (#675) plus some changes:

  • compliance with the new command registry from @gvalkov
  • the "Package Index Options" group was refactored out into a shared module, since 2 commands use it now
  • no unnecessary conversion from Distribution objects to InstallRequirements
  • comparison using parsed versions, not version strings
  • --uptodate/--outdated excludes editables (like mentioned in the original pull)
  • an --editables" option (like mentioned in the original pull)
  • 2 new options for util.get_installed_distributions: include_editables and editables_only

peer review requested on any of it, especially on the editable output format.
(@pfmoore, @pnasrat, @jezdez, @rafaelcaricio, @hltbra)

sample outputs:

pip list

pip-test-package (0.1.1) editable src at /my/venv/src/pip-test-package
wsgiref (0.1.2)
Pygments (1.5)
mock (1.0b1)

pip list --editables

pip-test-package (0.1.1) editable src at /my/venv/src/pip-test-package

pip list --outdated

mock (CURRENT: 1.0b1 LATEST: 1.0.1)

pip list --uptodate

wsgiref (0.1.2)
Pygments (1.5

dgladkov and others added some commits Mar 19, 2011

Updating pip outdated to use `PackageFinder` instead. Adding extra op…
…tions like '--index-url' or '--find-links'. Changing version comparison to use > not !=

All work done here is based on @carljm suggestions made in pull request #235, so that pip outdated gets merged into master asap.
@qwcode

This comment has been minimized.

Show comment Hide comment
@qwcode

qwcode Dec 18, 2012

Contributor

and I still need to add some docs....

Contributor

qwcode commented Dec 18, 2012

and I still need to add some docs....

@pnasrat

This comment has been minimized.

Show comment Hide comment
@pnasrat

pnasrat Dec 18, 2012

Contributor

In general the feature is greate - I'm wondering if we should support output formats, allowing reuse of the output of one command as input to another (pipe friendly). Or maybe a verbose format for the extra thing

One output option should be as a requirement.

pip-test-package==0.1.1

Another would be as RFC-822 supporting metadata http://www.python.org/dev/peps/pep-0426/

Basically I want the output easily parsable by tools without having to resort to regex's to eg extract the version (either sed/cut/awk/etc)

One option would be allow specifying a query format based on some metadata tags eg '%{name}-%{version}' ala RPM/yum or dpkg-query.

Contributor

pnasrat commented Dec 18, 2012

In general the feature is greate - I'm wondering if we should support output formats, allowing reuse of the output of one command as input to another (pipe friendly). Or maybe a verbose format for the extra thing

One output option should be as a requirement.

pip-test-package==0.1.1

Another would be as RFC-822 supporting metadata http://www.python.org/dev/peps/pep-0426/

Basically I want the output easily parsable by tools without having to resort to regex's to eg extract the version (either sed/cut/awk/etc)

One option would be allow specifying a query format based on some metadata tags eg '%{name}-%{version}' ala RPM/yum or dpkg-query.

@pnasrat

This comment has been minimized.

Show comment Hide comment
@pnasrat

pnasrat Dec 18, 2012

Contributor

Of course that could be in a follow up to this - don't block on my account

Contributor

pnasrat commented Dec 18, 2012

Of course that could be in a follow up to this - don't block on my account

@qwcode

This comment has been minimized.

Show comment Hide comment
@qwcode

qwcode Dec 18, 2012

Contributor

agreed on output formats, maybe csv and json (good next pull for @rafaelcaricio ?)
pep-426 could be an output format for "pip show" maybe?

also note that the original pull mentioned a "--freeze" option that was just equivalent to "pip freeze", but I'm not sure it's worth it? maybe nice to drop "pip freeze" at some pt after deprecating it for awhile.

for editables, we have to keep in mind that presenting them as "name==version" can be confusing since it looks like a requirement, and that's not the requirement for an editable (rather its usually the vcs url to the origin reference)

as for the default "human readable" format, maybe this instead of the verbiage about "src" (where "pip-test-package" is an editable)

pip-test-package (0.1.1, /my/venv/src/pip-test-package)
wsgiref (0.1.2)

or, maybe since the version for editables often doesn't represent very much during the dev process.

pip-test-package (/my/venv/src/pip-test-package)
wsgiref (0.1.2)
Contributor

qwcode commented Dec 18, 2012

agreed on output formats, maybe csv and json (good next pull for @rafaelcaricio ?)
pep-426 could be an output format for "pip show" maybe?

also note that the original pull mentioned a "--freeze" option that was just equivalent to "pip freeze", but I'm not sure it's worth it? maybe nice to drop "pip freeze" at some pt after deprecating it for awhile.

for editables, we have to keep in mind that presenting them as "name==version" can be confusing since it looks like a requirement, and that's not the requirement for an editable (rather its usually the vcs url to the origin reference)

as for the default "human readable" format, maybe this instead of the verbiage about "src" (where "pip-test-package" is an editable)

pip-test-package (0.1.1, /my/venv/src/pip-test-package)
wsgiref (0.1.2)

or, maybe since the version for editables often doesn't represent very much during the dev process.

pip-test-package (/my/venv/src/pip-test-package)
wsgiref (0.1.2)

@qwcode qwcode closed this Dec 18, 2012

@qwcode qwcode reopened this Dec 18, 2012

@qwcode

This comment has been minimized.

Show comment Hide comment
@qwcode

qwcode Dec 18, 2012

Contributor

if we did allow the slight confusion over using "==" for editables, maybe this for the default format.

pip list

pip-test-package==0.1.1 (/my/venv/src/pip-test-package)
wsgiref==0.1.2
Pygments==1.5
mock==1.0b1

pip list --editables

pip-test-package==0.1.1  (/my/venv/src/pip-test-package)

pip list --outdated

mock==1.0b1 (latest: 1.0.1)

pip list --uptodate

wsgiref==0.1.2
Pygments==1.5

pip list --freeze (TBD in a future pull)

-e git+https://github.com/pypa/pip-test-package.git@65cf0a5#egg=pip_test_package-dev
wsgiref==0.1.2
Pygments==1.5
mock==1.0b1
Contributor

qwcode commented Dec 18, 2012

if we did allow the slight confusion over using "==" for editables, maybe this for the default format.

pip list

pip-test-package==0.1.1 (/my/venv/src/pip-test-package)
wsgiref==0.1.2
Pygments==1.5
mock==1.0b1

pip list --editables

pip-test-package==0.1.1  (/my/venv/src/pip-test-package)

pip list --outdated

mock==1.0b1 (latest: 1.0.1)

pip list --uptodate

wsgiref==0.1.2
Pygments==1.5

pip list --freeze (TBD in a future pull)

-e git+https://github.com/pypa/pip-test-package.git@65cf0a5#egg=pip_test_package-dev
wsgiref==0.1.2
Pygments==1.5
mock==1.0b1

qwcode added a commit that referenced this pull request Dec 20, 2012

@qwcode qwcode merged commit ffad700 into pypa:develop Dec 20, 2012

1 check was pending

default The Travis build is in progress
Details
@qwcode

This comment has been minimized.

Show comment Hide comment
@qwcode

qwcode Dec 20, 2012

Contributor

merged. I didn't put much effort into the docs for pip list, since I'm already working on a rewrite for the pip docs as a whole.

Contributor

qwcode commented Dec 20, 2012

merged. I didn't put much effort into the docs for pip list, since I'm already working on a rewrite for the pip docs as a whole.

@rafaelcaricio

This comment has been minimized.

Show comment Hide comment
@rafaelcaricio

rafaelcaricio Dec 21, 2012

Contributor

Hi, nice to see that it get finally merged! 👍

It´s a good idea to do a new pull request with the output formats. As soon as possible I will start working on it (right now I´m in the middle of my moving to another country, so I'm a little busy).

Thank you @qwcode and all the guys.

Contributor

rafaelcaricio commented Dec 21, 2012

Hi, nice to see that it get finally merged! 👍

It´s a good idea to do a new pull request with the output formats. As soon as possible I will start working on it (right now I´m in the middle of my moving to another country, so I'm a little busy).

Thank you @qwcode and all the guys.

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