option to show what version would be installed #53

Open
vbabiy opened this Issue Mar 15, 2011 · 28 comments

Comments

Projects
None yet
Contributor

vbabiy commented Mar 15, 2011

"pip install django" will install the latest version on pypi, but I would like to know what version that is before I install it.

Seems reasonable that something like "pip search django" would list the version next to all the hits.


Contributor

vbabiy commented Mar 15, 2011

Hmm, maybe we need a command to list all package versions available in PyPI.
What you think?

Like:

$ pip list Django

1.2.4

1.2.3

1.2.2

1.2.1

1.2

1.1.3

1.1.2

1.0.4

$

Original Comment By: Hugo Lopes Tavares
Contributor

vbabiy commented Mar 15, 2011

i like that idea.


Original Comment By: CarlFK
Contributor

vbabiy commented Mar 15, 2011

I just implemented it in my fork. I want carljm, jezdez and ianb's opinions
before merging.

Check it here: https://bitbucket.org/hltbra/pip-list-
command/changeset/e5c135a46204


Original Comment By: Hugo Lopes Tavares
Contributor

vbabiy commented Mar 15, 2011

I haven't thought about this deeply, but it seems better to me to improve the
"search" command to also list versions (maybe list all versions with a -v flag
or something), rather than adding a new separate command. This functionality
seems to be logically a part of search.


Original Comment By: Carl Meyer
Contributor

vbabiy commented Mar 15, 2011

I would be ok with adding this to search as long as my other ER is implemented
too so that I don't get 3000 lines (really) when I look for django's versions.
(there are over 1000 hits to "pip search django" because of all the django-foo
packages. )


Original Comment By: CarlFK
Contributor

vbabiy commented Mar 15, 2011

I think it's unnecessary to show what version would be installed as long as
there is a list of available versions, because it's easy to determine which of
these is the latest. Furthermore there is no reason for using a new flag to
enable the output of this list, because the overhead tends toward zero. It's
just a small change:
https://bitbucket.org/jumpa/pip/changeset/62076643cf33


Original Comment By: jumpa
Contributor

vbabiy commented Mar 15, 2011

Hi Carl, I have though about adding an option to search command, but my fear
was happen what happened to install command: if you want to "upgrade" a
package, you need to use "install" option - that's weird, and we know that.

And if most people think adding an option to search is better, I don't see too
much problem about using search --versions or search -v.


Original Comment By: Hugo Lopes Tavares
Contributor

vbabiy commented Mar 15, 2011

I think listing all available versions by default is too verbose. Some
packages have many available versions on pypi - ten or twenty isn't uncommon
at all. Listing the latest version by default and all versions with a flag
seems reasonable.

And I agree with CarlFK that we also need improvements to search make it
easier to narrow. The trouble there is we depend on what PyPI's API gives us,
which isn't much: we aren't going to download all of PyPI and do a regex
search locally! I'd be in favor of something like an --exact flag to search as
part of this change, so you can search for e.g. "--exact django" and only get
django itself in your result.


Original Comment By: Carl Meyer
Contributor

vbabiy commented Mar 15, 2011

Hi jumpa, Great idea to show the versions using the one got from xmlrpc
connection!

I got the following snip searching for pip:

pip                       - pip installs packages.  Python packages.  An

easy_install replacement (versions: 0.2, 0.2.1, 0.3, 0.3.1, 0.4, 0.5, 0.5.1,
0.6, 0.6.1, 0.6.2, 0.6.3, 0.7, 0.7.1, 0.7.2, 0.8, 0.8.1, 0.8.2)

This is going to be such a big list of packages, using lots of versions -
because our search cares about names and summaries. Should we care about it?


Original Comment By: Hugo Lopes Tavares
Contributor

vbabiy commented Mar 15, 2011

As an enduser, I like the idea of having a separate list command*. As time
goes on a separate command maybe easier to modify and enhance in isolation. To
make a separate list command more useful you could indicate which version, if
any, is currently installed.

pip list Django


1.2.4

1.2.3 installed

1.2.2

1.2.1

1.2

1.1.3

1.1.2

1.0.4

Note: Many popular package managers such as YUM(RedHat), pkglist(BSD),
dpkg(Debain) provide a separate list flag or command.


Original Comment By: Kelsey Hightower
Contributor

vbabiy commented Mar 15, 2011

Carl, I was thinking another day about this issue, and I have to agree with
Kelsey: another command is not bad.

Think about we using a flag to indicate I want just that package name, and
another flag to indicate I want to retrieve all available version.

It is a bit odd.

Let's try to illustrate:

$ pip search -v --exact Django

versus

$ pip list Django

Kelsey's idea of showing what version is installed just improves the list
command.


Original Comment By: Hugo Lopes Tavares

phuihock commented Apr 2, 2011

I made the changes into search command.

Since the search command already shows the installed and latest version available, it probably makes more sense to augment search command to list also all available versions too.

Here's my changeset: https://github.com/phuihock/pip/commit/46bad23b5bf31850a02803ea1ca18be5deca9db3

LucianU commented Oct 4, 2013

What's the status with this? Can one see the latest available version on PyPI by using pip?

Is this implemented already? This has been nagging me for about two years now, and I would love to see this solved.
The limited search combined with a flag for versions looks like a very usable solution.

inoatech commented Feb 5, 2014

Just wanted to add here that I just ran across this thread while doing a search for how to show versions... I tried pip search -v package -- somehow that would have made intuitive sense to me: a verbose description of the package to be installed, including version info...

smarinov commented Mar 2, 2014

I just realised this functionality is still not implemented after a colleague of mine asked me about it. Are there any plans that it will become available in the coming versions of pip?

Member

Ivoz commented Mar 2, 2014

I believe this PR might be relevant, that's currently being worked on?

You might also be interested in the Linuxconf 2014 talk "Python Packaging 2.0: Playing Well With Others" on the current situation, as well as the future, of python packaging. The speaker said (if I understood correctly) that some of the limitations on metadata in pip are a consequence of the design of PyPI, which was originally based on CPAN, and that reworking PyPI's backend (whilst remaining compatible with the current one using tests) should improve the situation. He was mostly talking about "system integrators" i.e. downstream packagers, but I guess that would affect things like this issue, making them easier to resolve.

+1,000,000

@wallrj wallrj added a commit to ClusterHQ/flocker that referenced this issue Oct 16, 2014

@wallrj wallrj This step could be simplified or removed if pip could report the vers…
…ion of the package it was about to install. See pypa/pip#53
3f0522c

oraant commented May 16, 2016

and how's it now?

realknorke commented Aug 24, 2016 edited

Now, is there any way to show which version is latest without installing it?
This issue is open since 2011 an the patch I've seen above is just one line. :(

This seems like a minor feature to enable, how is there not an option equivalent to say apt-cache madison at this point?

mdeguzis commented Sep 8, 2016

I would really like to see the latest version of the PyPi package when searching as well. Having an exact match works, but I use awk as a workaround.

balzss commented Oct 25, 2016

This frustrated me as well and seeing that there's little to no hope on this I decided that creating an alternative might worth my time. Alongside with this problem I implemented some other requested features (like regex search and colorized output, etc.). If you are interested you can check it out here

bleepnetworks commented Nov 7, 2016 edited

wget -qO- https://pypi.python.org/pypi/uWSGI | egrep -o "uwsgi-[0-9].[0-9].[0-9][0-9].tar.gz" | sort -u

andreif commented Feb 16, 2017

wget -qO- https://pypi.python.org/pypi/uWSGI/json | grep '"version"'

t-animal commented Feb 19, 2017 edited

@andreif This will not alwasy find the correct version (pip ignores alphas, betas, release candidates, etc unless --pre is provided). This is closer (but no guarantees either):
wget -qO- https://pypi.python.org/pypi/uWSGI/json | grep -E ' {8}"[0-9."]*": \[' | sort -V | tail -n 1 | tr -d ' ":['

andreif commented Feb 19, 2017 edited

Ok, then the JSON response should include something like "pre-version": "1.2.3a4", so one can grep both of them with a simple expression.

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