-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
S: needs triageIssues/PRs that need to be triagedIssues/PRs that need to be triagedtype: feature requestRequest for a new featureRequest for a new feature
Description
What's the problem this feature will solve?
pip index versions
is an experimental command that scratches the itch to check latest and available versions from index servers.
The output is clearly readable for humans but inconvenient to parse programmatically.
The two questions I think someone might want to query are:
- is a specific version equal to the latest version?
- is a specific version available?
To answer these, one has to resort to parsing the current output, and that depends on current formatting of the output.
Describe the solution you'd like
There should be at least an option/flag to provide the output in a machine readable format. For example as json that one could conveniently parse with jq
.
Alternatively there could be other subcommands to pip index
that answer the two questions I noted directly.
Alternative Solutions
is PACKAGE_VERSION
in available versions?
echo "$index_versions_output, " | grep -q "${PACKAGE_VERSION}, "
get latest version
echo ${index_versions_output} | grep -o "${package_name} \(.*\)" | sed -E -n "s/.*\((.*)\).*$/\1/p"
Additional context
Code of Conduct
- I agree to follow the PSF Code of Conduct.
jtmoon79, Jgfrausing and merlinr68
Metadata
Metadata
Assignees
Labels
S: needs triageIssues/PRs that need to be triagedIssues/PRs that need to be triagedtype: feature requestRequest for a new featureRequest for a new feature