Skip to content

Command to list all available versions pip finds for a package #7975

@uranusjr

Description

@uranusjr

What's the problem this feature will solve?
This is a feature suggestion I got during a user interview conducted by @ei8fdb. Currently pip does not seem to have a way to invoke PackageFinder without also select a “best match”. A common operation for users is however to look at the list of versions, in order to decide how they want to specify the version range.

Describe the solution you'd like
A command in pip to discover and output available versions for a package (or packages). It’d be also useful if the command can also include extra information, e.g. what dists are available for each version, and which version is currently installed, in a table form.

Something like:

$ py -3.8 -m pip discover numpy
I? version	sdist	 wheel
   1.18.2   zip      cp38-cp38m-win_amd64 ...
v  1.18.1   zip  	 cp38-cp38m-win_amd64 ...
(more lines ...)

Each line represents a version. The sdist column shows what format the source dist is in (another common output would be tar.gz), and wheel shows compatible wheels. The dot dot dot at the ends indicates there are more wheels, but incompatible with the host. The I? column shows whether this version is installed. All fields except version can be blank if there’s not a match found.

Similar to install and download, the command would accept index and format options, and filter the output accordingly.

Alternative Solutions
The best solution currently is to manually look at the index directly, but this can be especially cumbersome if the package is not on pypi.org. And even for pypi.org, it is cumbersome to either fire up a browser, or directly use the JSON or simple API.

One other hack the user reported using is to tell pip to install a non-existent version (pip>1000000). pip would output available versions in the error message 😆

Additional context
I didn’t think of any.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: cliCommand line interface related things (optparse, option grouping etc)UXUser experience relatedUX: functionality research epicTemporary label to link tickets to #8516type: feature requestRequest for a new feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions