Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide structured JSON output for pip index versions #13194

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

KrishanBhasin
Copy link

The first part of #13188, providing a structured JSON-formatted output for pip index versions command.

Usage:

❯ pip index versions build --json
{"name": "build", "versions": ["1.2.2.post1", "1.2.2", "1.2.1", "1.1.1", "1.0.3", "1.0.0", "0.10.0", "0.9.0", "0.8.0", "0.7.0", "0.6.0.post1", "0.5.1", "0.5.0", "0.4.0", "0.3.1.post1", "0.3.1", "0.3.0", "0.2.1", "0.2.0", "0.1.0", "0.0.4", "0.0.3.1", "0.0.2", "0.0.1"], "latest": "1.2.2.post1", "installed_version": "1.2.2.post1"}

which is properly formatted JSON - it prettifies to:

{
  "name": "build",
  "versions": [
    "1.2.2.post1",
    "1.2.2",
    "1.2.1",
    "1.1.1",
    "1.0.3",
    "1.0.0",
    "0.10.0",
    "0.9.0",
    "0.8.0",
    "0.7.0",
    "0.6.0.post1",
    "0.5.1",
    "0.5.0",
    "0.4.0",
    "0.3.1.post1",
    "0.3.1",
    "0.3.0",
    "0.2.1",
    "0.2.0",
    "0.1.0",
    "0.0.4",
    "0.0.3.1",
    "0.0.2",
    "0.0.1"
  ],
  "latest": "1.2.2.post1",
  "installed_version": "1.2.2.post1"
}

@KrishanBhasin KrishanBhasin changed the title Kb/f/pip index versions json Provide structured JSON output for pip index versions Jan 30, 2025
@KrishanBhasin KrishanBhasin marked this pull request as ready for review January 31, 2025 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants